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

3 ビュー (過去 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 Center および File ExchangeSolver 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