コード例 #1
0
ファイル: arInputFunctionsC.c プロジェクト: ladlung/d2d
double Dspline_pos3(double t, double t1, double p1, double t2, double p2, double t3, double p3, int ss, double dudt, int id) {   
    
    double uout;
    double uspline_pos3;
    double suspline3;
            
    double ps[3];
    
    ps[0] = p1;
    ps[1] = p2;
    ps[2] = p3;
    
    uspline_pos3 = spline_pos3(t, t1, p1, t2, p2, t3, p3, ss, dudt);
    suspline3 = Dspline3(t, t1, p1, t2, p2, t3, p3, ss, dudt, id);
    uout = suspline3 * uspline_pos3 * log(10.0);
    uout = uout / ps[id-1] / log(10.0);
    
    return(uout);
}
コード例 #2
0
ファイル: symbolic_functions.c プロジェクト: paulstapor/AMICI
/**
 * parameter derivative of positive spline function with 3 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 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_pos3(int id, double t, double t1, double p1, double t2, double p2, double t3, double p3, int ss, double dudt) {
    
    double uout;
    double uspline_pos3;
    double suspline3;
    
    double ps[3];
    int did;
    
    
    ps[0] = p1;
    ps[1] = p2;
    ps[2] = p3;
    
    did = floor(id/2-1);
    
    uspline_pos3 = spline_pos3(t, t1, p1, t2, p2, t3, p3, ss, dudt);
    suspline3 = Dspline3(id, t, t1, p1, t2, p2, t3, p3, ss, dudt);
    uout = suspline3 * uspline_pos3 * log(10.0);
    uout = uout / ps[did] / log(10.0);
    
    return(uout);
}