![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/341134/image.png)
How can I use fmincon to solve problems with ODEs
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
J. Alex Lee
2020 年 8 月 4 日
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".
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!