필터 지우기
필터 지우기

Fit an Ordinary Differential Equation (ODE) using lsqcurvefit

조회 수: 3 (최근 30일)
Jonas Hilpert
Jonas Hilpert 2018년 11월 14일
댓글: Torsten 2018년 11월 15일
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?

채택된 답변

Torsten
Torsten 2018년 11월 14일
편집: Torsten 2018년 11월 14일
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
Jonas Hilpert
Jonas Hilpert 2018년 11월 15일
thank you very much for your answer! You are right, my constraints are more complicated. Actually i need as follows: x(1)+x(2)+x(3)+x(4)+x(5)+x(6) = 5 or probably even more constraints.....
I have tried your suggestion, unfortunately this is not working really well. I was thinking "fmincon" is not working for a system of ode's, or am I wrong? I hope you have another suggestion for me
Torsten
Torsten 2018년 11월 15일
"lsqcurvefit" has nothing to do with the integration of the system of ODEs. That's why "fmincon" will work as well as "lsqcurvefit".

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by