ODE function return additional time dependent values

3 次查看(过去 30 天)
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 个评论
Torsten
Torsten 2023-8-28
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.

请先登录,再进行评论。

采纳的回答

Ayush Anand
Ayush Anand 2023-9-6
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!

更多回答(0 个)

类别

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