//---------------------------------------------------------- // void _nlsfBDF( // Fit Parameter(s): double k1, double OH, // Independent Variable(s): double x, // Dependent Variable(s): double& y) { // Beginning of editable part
NLFitContext *pCtxt = Project.GetNLFitContext();
if ( pCtxt ) { static vector vX, vY; static int nSize;
BOOL bIsNewParamValues = pCtxt->IsNewParamValues(); // If parameters were updated, we will recalculate the ODE result. if ( bIsNewParamValues ) { //Initial and final values of the independent variable double tstart = 0.0, tend = 0.0015, tinc; int nout = 1001; //Number of points
//Interpolate y from fitting data's x on the ODE result. ocmath_interpolate( &x, &y, 1, vX, vY, nSize ); } // End of editable part }
When compiling, I always got: Error, invalid explicit cast, for the line "d02ejc(neq, fcn, pederv, &x, y, s.xend, tol, Nag_Relative, NULLFN, NULLFN, &comm, NAGERR_DEFAULT)" namely when the solver is called.
My first thought is that there is something unsupported in the function of d02ejc, which I couldn't see. However, if I'm wrong, and/or if there is a way to do what my piece of code is supposed to do, I would appreciate you tell me.
p.s. I have tried before using a more basic solver, d02pcc, and succeeded. However, I want to try d02ejc to solve a more stiff system.
3 L A T E S T R E P L I E S (Newest First)
mablitz
Posted - 05/20/2016 : 5:20:08 PM In order to do data analysis the ODE needs to be called from within Origin C. How do you call the ODE solver App from Origin C? The code for this App appears to be hidden so it cannot be written into the Origin C code.