double Dspline_pos4(double t, double t1, double p1, double t2, double p2, double t3, double p3, double t4, double p4, int ss, double dudt, int id) { double uout; double uspline_pos4; double suspline4; double ps[4]; ps[0] = p1; ps[1] = p2; ps[2] = p3; ps[3] = p4; uspline_pos4 = spline_pos4(t, t1, p1, t2, p2, t3, p3, t4, p4, ss, dudt); suspline4 = Dspline4(t, t1, p1, t2, p2, t3, p3, t4, p4, ss, dudt, id); uout = suspline4 * uspline_pos4 * log(10.0); uout = uout / ps[id-1] / log(10.0); return(uout); }
/** * parameter derivative of positive spline function with 4 nodes * * @param id argument index for differentiation * @param t point at which the spline should be evaluated * @param t1 location of node 1 * @param p1 spline value at node 1 * @param t2 location of node 2 * @param p2 spline value at node 2 * @param t3 location of node 3 * @param p3 spline value at node 3 * @param t4 location of node 4 * @param p4 spline value at node 4 * @param ss flag indicating whether slope at first node should be user defined * @param dudt user defined slope at first node * * @return dspline(t)dp(id) * */ double Dspline_pos4(int id, double t, double t1, double p1, double t2, double p2, double t3, double p3, double t4, double p4, int ss, double dudt) { double uout; double uspline_pos4; double suspline4; double ps[4]; int did; ps[0] = p1; ps[1] = p2; ps[2] = p3; ps[3] = p4; did = floor(id/2-1); uspline_pos4 = spline_pos4(t, t1, p1, t2, p2, t3, p3, t4, p4, ss, dudt); suspline4 = Dspline4(id, t, t1, p1, t2, p2, t3, p3, t4, p4, ss, dudt); uout = suspline4 * uspline_pos4 * log(10.0); uout = uout / ps[did] / log(10.0); return(uout); }