find the minimum objective for a given ode as boundary value problem

조회 수: 2 (최근 30일)
Marko
Marko 2022년 1월 17일
편집: Torsten 2022년 1월 17일
Hello Community,
could you give me hint how to tackle this problem.
I have an ode (c has a positive value):
dxdt2 = a+b*t - c*dxdt^2;
with this boundary conditions:
t(0) = t0;
x(0) = x0;
dxdt(0) = v0;
x(end) = xEnd;
dxdt(end) = vEnd;
dxdt2(end) = 0;
and with these unkowns:
t(end)
a is positive;
b is either positive or negative
also the objective funktion an energy metric have to be minimzed:
E = Integral of c*dxdt^2 from t0 to tEnd
So at first i have to define the ode-function and the objective-function.
But do i need the bvp solver and the fmincon-solver?
Thank you in advance.
  댓글 수: 4
Torsten
Torsten 2022년 1월 17일
편집: Torsten 2022년 1월 17일
I see now that tend is also a free parameter. So you have 5 conditions and 6 degrees of freedom. Ok.
By dxdt2 you mean d^2x/dt^2 ? And by dxdt^2 you mean (dx/dt)^2 ?
Marko
Marko 2022년 1월 17일
yes, your interpretation is correct.

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

채택된 답변

Alan Weiss
Alan Weiss 2022년 1월 17일
For examples of optimizing a function given as the solution to an ODE, see Fit ODE, Problem-Based and Fit an Ordinary Differential Equation (ODE). These examples minimize a sum of squared difference between a given curve and the ODE solution, but the techniques apply to your problem as well. For more information, see Optimizing a Simulation or Ordinary Differential Equation.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (1개)

Torsten
Torsten 2022년 1월 17일
편집: Torsten 2022년 1월 17일
Vector of unknowns for fmincon:
(y1,y2,y3,y4)=(a,b,c,tend)
Objective for fmincon:
f(a,b,c,tend) = integral_{t=0}^{tend} c*(dx/dt)^2
Can be obtained by solving with ODE45
z' = c*x2^2 , z(0) = 0
x1' = x2 , x1(0) = x0
x2' = a+b*t-c*x2^2, x2(0) = v0
in [0 tend]
z(end) is the value to be returned
Constraints (to be supplied in nlcon):
ceq(1) = x2(end) - vend == 0
ceq(2) = a+b*tend-c*x2(end)^2 == 0
x2(end) can be obtained by solving with ODE45
x1' = x2 , x1(0) = x0
x2' = a+b*t-c*x2^2, x2(0) = v0
in [0 tend]
Upper and lower bounds:
a >= 0
tend >= 0 ?

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by