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

2 次查看(过去 30 天)
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 ?

请先登录,再进行评论。

采纳的回答

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 中查找有关 Ordinary Differential Equations 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by