![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/341134/image.png)
How can I use fmincon to solve problems with ODEs
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I would like to use fmincon to analytically find the maximum lateral acceleration acheivable by a car, modeled using the single track bicycle model. I've solved simple problems with linear equations using fmincon (max surface area of a cube) but this one is over my head because one of the equations is an ODE.
The 2 Degree of Freedom (DOF) bicycle model is widely used as a simplified model of a car, used to study lateral dynamics.
The inputs to the simple 2 DOF model are the steering angle (df) and the longitudinal velocity (vx).
Using some constants to describe the car and the tires,
a, b and Iz = geometric constants
m = car mass = constant
Cyf and Cyr = cornering stiffnesses = constants
The car's lateral acceleration is modeled by,
vy_dot = (Fyf/m)*cos(df) + Fyr/m - vx*r;
where,
Fyf = Cyf * Af;
Fyr = Cyr * Ar;
and,
Af = (vy + a*r)/vx - df;
Ar = (vy - b*r)/vx
The car's yaw acceleration is modeled by,
r_dot = time derivative of yaw velocity r = (a/Iz)*Fyf*cos(df) - (b/Iz)*Fyr;
So it would all be simple for me to maximize vy_dot using fmincon if r was not the integral of r_dot. I simply don't know how to represent this r_dot = d/dt (r) in the functions for fmincon.
Thanks in advance for your help!
0 Kommentare
Antworten (1)
J. Alex Lee
am 4 Aug. 2020
I presume you mean to use r at some specific time, where r(0) (or some other time) is known - a standard 1D ODE.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/341134/image.png)
with some initial condition, so either see if your r_dot expression is analytically integrable, or integrate it numerically.
Look into "integral" or "ode45".
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!