error solving differential equation

2 次查看(过去 30 天)
Hello everyone !!
I am trying to solve with simulink a simple differential equation such as : dT/dt = A T + C, where A is a squared matrix with zero elements except for A(i,i), A(i,i+1) and A(i-1,i).
Whatever I put as initial conditions or vector for C, the result is a vector with values of order 10^^300!!!
I am using an integrator, isn'it compatible with matrix?
I am quite new to Simulink and any help from you would be really nice, thank you.
yorelchr
  3 个评论
Christine
Christine 2019-1-21
Thank you for your reply Shubham Gupta.
I think that my problem is a problem of stiff matrix. I have tried with ode15s solver but results are not what they should be.
Shubham Gupta
Shubham Gupta 2019-1-24
If you can share the model and/or differential equation it would be helpful to understand the actual problem. One possible way for integrator to give large values is if the differential equation is always increasing or worse always increasing exponentially.
For example if you integrate exp(x) from t=0 to t=100. Then, you know that you will get the values in higher order. So, I am reluctant to say this but it might be possible that you made some kind of mistake in the equation or model and the differential equation became always increasing.
Also, Changing the solver shouldn't change your basic trend for the result, imo. I can't comment any further unless I see the model and/or equation.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by