How can I solve a second order ODE backwards in simulink or matlab?

17 次查看(过去 30 天)
Hi,
I have a second order ODE of the form:
spp=inv(DD)*(tau-CC*[spx;spy;ap]-gg);
sppx=spp(1);
sppy=spp(2);
app=0;
Let q=(sx,sy,a), qp=(spx,spy,ap) and qpp=(sppx,sppy,app). Where qp=d/dt*q and qpp=d/dt*qp.
DD and CC are matrizes, tau and gg are vectors. These matrizes and vectors may contain variables of the vector q or qp.
I know how to solve this equation in simulink numerically for a specific initial condition at time t=0. However. I would like to know the solution of the ODE if I gave matlab not an initial condition but a solution at a certain point in time t1 != 0.
Specifically, the ODE above describes an object falling through the air and I would like to know the initial conditions q0 at time t=0 if I knew when the object hits the ground. So i know that at time t1 sy=0 and sx is some value sE.
Which method do I use for this kind of problem? I am grateful for any help.
Thanks

采纳的回答

Stephan
Stephan 2019-10-7
编辑:Stephan 2019-10-7
It is allowed to integrate backwards with ode45 just by declaring tspan backwards:
tspan = [t1 0]
Then your ending conditions are used as initial conditions - you can do this without any special functions.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by