필터 지우기
필터 지우기

How can I use fmincon to solve problems with ODEs

조회 수: 1 (최근 30일)
Justin Taylor
Justin Taylor 2020년 8월 3일
댓글: Justin Taylor 2020년 8월 6일
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!

답변 (1개)

J. Alex Lee
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.
with some initial condition, so either see if your r_dot expression is analytically integrable, or integrate it numerically.
Look into "integral" or "ode45".
  댓글 수: 1
Justin Taylor
Justin Taylor 2020년 8월 6일
Yes perhaps I can use ode45 (or variant) in the ceq portion of the nonl argument. I'll give it a go, thanks!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by