Jacobian matrix in ode15s
28 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am using ode15s to solve a set of stiff odes and the final model is developed in the form of
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739006/image.png)
where M(t,y) is the mass matrix, and y is the generalised coordinate vector. According to the syntax of ode15s, it is crucial to provide its Jacobian matrix to raise the accuracy.
I do not know too much numerical calculation of stiff odes, and here I want to know, is the Jacobian matrix JJ calculated in this manner:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739011/image.png)
If not, how to arrive at a correct one?
Many thanks!
采纳的回答
Dheeraj
2024-7-22
Hi Tony chegg,
I understand you want to know how to calculate jacobian matrix in order to increase the accuracy of your model.
When solving stiff differential equations with "ODE15s", you are typically dealing with equations of the form:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739026/image.png)
where
is the mass matrix, and
represents the nonlinear term.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739031/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739036/image.png)
To use "ODE15s" effectively, you need to provide the Jacobian matrix of the function
with respect to y, which is used to handle the stiffness in the system. This Jacobian matrix is denoted as "J" and is defined as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739041/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739046/image.png)
You can easily calculate Jacobian matrix if you have an explicit expression for
, you can compute the Jacobian matrix analytically. This involves differentiating
with respect to each component of y.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739051/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1739056/image.png)
Or You could use "jacobian" fucntion part of Symbolic Math Toolbox to do the same.
You could refer to the below MATLAB's documentation to know more about "jacobian" fucntion and it's usage:
Thank You.
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!