ODE function return additional time dependent values

3 visualizaciones (últimos 30 días)
구구
구구 el 28 de Ag. de 2023
Respondida: Ayush Anand el 6 de Sept. de 2023
The equation I'm integrating is M x'' = F, which is the basic rigid body equation of motion and also performs transient heat conduction analysis.
Adding temperature to the ODE variables would add too many degrees of freedom, so I want to analyze that part separately.
However, in order to perform the transient heat conduction analysis, I need the previous time step and the temperature at that time, is there any way to get these values as additional output variables from the ODE function at specific time step?
  1 comentario
Torsten
Torsten el 28 de Ag. de 2023
Adding temperature to the ODE variables would add too many degrees of freedom, so I want to analyze that part separately.
If you can start the thermal model from the solution of the rigid body model, you can also solve both of them combined.

Iniciar sesión para comentar.

Respuesta aceptada

Ayush Anand
Ayush Anand el 6 de Sept. de 2023
Hi,
I understand you are integrating the rigid body equation of motion and perform transient heat conduction analysis alongside and want to know if there is a way to get previous timestep and temperature as additional output variables from the ODE function.
This can be implemented using the “OutputFcn” option in the ODE solvers such as “ode45”. This would involve defining a custom function and storing previous timestep and previous temperature values in an array every timestep. This custom function can then be passed as the “OutputFcnargument with the solver.
For more information on ODE solvers, please refer to the following resources:
  1. https://in.mathworks.com/matlabcentral/answers/312549-get-variable-out-of-ode-45 (This answer explains how to extract extra parameters from the ode45 differential equation solver)
  2. https://in.mathworks.com/matlabcentral/answers/97074-how-do-i-solve-an-ode-with-time-dependent-parameters-in-matlab (How to solve an ode with time-dependent parameters in MATLAB)
I hope this helps!

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by