optimization for trajectory input variables

2 visualizzazioni (ultimi 30 giorni)
Nivedhitha S
Nivedhitha S il 20 Ago 2019
Commentato: Nivedhitha S il 30 Ago 2019
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.

Risposte (1)

Prabhan Purwar
Prabhan Purwar il 27 Ago 2019
Hey,
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
Links:
  • Using Simulink
Links:
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.
Links:
For real-time optimization of differential equation refer to Simulink
  • Using Simulink
Model can be optimized as illustrated in video
Link:
  1 Commento
Nivedhitha S
Nivedhitha S il 30 Ago 2019
Thank you for detailed help and suggestions.
But i was asking about the possibility of a trajectory optimization for my problem.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by