Borrar filtros
Borrar filtros

Update the variables in ODE routines?

2 visualizaciones (últimos 30 días)
Hossein
Hossein el 18 de Jun. de 2015
Respondida: Andrew Schenk el 19 de Jun. de 2015
Hi everyone,
I have a question concerning the ODE routines. I should model a complicated nonlinear dynamic system in time domain using ode113 (or any other one). I want to ask if it is possible to update the (by derivatives) predicted variables by easily replacing the optimized value in current time step? eg. we have the Y_1 as the variable in first time step and dY_1 its derivative can we update Y_2 while calculating dY_2 just buy putting Y_2 = .... ?
tnx all

Respuestas (1)

Andrew Schenk
Andrew Schenk el 19 de Jun. de 2015
The purpose of the ODE solver is to solve for the values of Y given a MATLAB function which provides values of dY. If you want to calculate the value of Y at a given step, the ODE solver does not need to solve for it.
You could accomplish this by removing Y2 as a variable from ode113 and instead use a persistent variable in your MATLAB function to calculate Y2 and track the past states.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by