Fit an Ordinary Differential Equation (ODE) using lsqcurvefit
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jonas Hilpert
am 14 Nov. 2018
Kommentiert: Torsten
am 15 Nov. 2018
Hello,
i have a system of 11 ODE's (ode45) and want to fit them to measured data. For that i have 11 variables i want to optimate. My Question:
Additional to the lb and ub in the lsqcurvefot solver, i want a condition for the variables like x(1)+x(2)=5. Is that possible?
0 Kommentare
Akzeptierte Antwort
Torsten
am 14 Nov. 2018
Bearbeitet: Torsten
am 14 Nov. 2018
Remove parameters x(1) and x(2) from your list and introduce one new variable x(12). From x(12), calculate x1=5*cos^2(x(12)) and x2=5*sin^2(x(12)) and insert x1 and x2 instead of x(1) and x(2) in your ODE system.
If your constraints are more complicated than this one, use "fmincon" instead of "lsqcurvefit".
2 Kommentare
Torsten
am 15 Nov. 2018
"lsqcurvefit" has nothing to do with the integration of the system of ODEs. That's why "fmincon" will work as well as "lsqcurvefit".
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Nonlinear Least Squares (Curve Fitting) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!