MATLAB Answers


optimization for trajectory input variables

Nivedhitha S さんによって質問されました 2019 年 8 月 20 日
最新アクティビティ Nivedhitha S さんによって コメントされました 2019 年 8 月 30 日
Dear community,
I am a newbie in matlab. I would like to know the method to define an objective function for an optimization function. I have a set of 6 ode equations which has 4 input variables for its calculation. I would to like to manipulate these 4 input variables sunch that one of my variable (ODE) can be optimized (maxima/minima). How to implement an objecive function and obtain the trajectory profile for these 4 input variables? I would like to obtain a continuous time varying profile for these 4 input variables. The system is a continuous time varying setup with interdependant ode. Please give me any suggestions for the same.

  0 件のコメント

サインイン to comment.

1 件の回答

回答者: Prabhan Purwar 2019 年 8 月 27 日

The problem basically consists of an optimizing system of differential equations.
A model with varying parameters can be used to find the best-fitted model parameters for the same.
This can be achieved either through MATLAB or Simulink, both are discussed below, suitability relies upon the complexity and nature of the problem.
Following illustrates formation and solution to a differential equation.
  • Using MATLAB
k1 = ...; % set constant k1
k2 = ...; % set constant k2
k3 = ...; % set constant k3
f = @(t,y)[9-k1*y(2)^2*y(1)+k2*y(1)^2 ; k3*y(2)^2+y(1)*y(2)]; % define differential equations
tspan = [0 20]; % set interval of integration
u0 = ...; % set initial condition for u
omega0 = ...; % set initial condition for Omega
y0 = [u0 ; omega0]; % set vector of initial values
[T Y] = ode45(f,tspan,y0); % call integrator
plot(t,y(:,1),'-o',t,y(:,2),'-o') % plot results
  • Using Simulink
Optimization of differential equations
  • Using MATLAB
Making use of fminsearch(), fminbnd() and optimset() functions or optimization toolbox for complex problems after solving the differential equation.
For real-time optimization of differential equation refer to Simulink
  • Using Simulink
Model can be optimized as illustrated in video

  1 件のコメント

Nivedhitha S 2019 年 8 月 30 日
Thank you for detailed help and suggestions.
But i was asking about the possibility of a trajectory optimization for my problem.

サインイン to comment.

Translated by