Error occurring while solving odes using ode15s
이전 댓글 표시
Hello,
I am trying to solve a systems of nonlinear ODE using ODE15s but I keep getting an error after about 29 seconds and I can't figure out what is causing the error.
see a screen shot of the error.
What could be the likely cause of this error.

댓글 수: 10
Walter Roberson
2021년 8월 1일
Did you configure a sparse mass matrix? And does your ode routine return a single precision vector?
Telema Harry
2021년 8월 1일
편집: Telema Harry
2021년 8월 2일
Walter Roberson
2021년 8월 1일
Are you able to post your code for testing?
Telema Harry
2021년 8월 2일
Walter Roberson
2021년 8월 2일
When you invoke your ode function passing in your initial time and your initial conditions, what is class() of the result?
Also, have you configured Mass Matrix? Have you configured any special functions such as for estimation of the gradient? Is it possible that you passed in your time as single precision, or your boundary conditions as single precision?
That particular section of code, you could potentially get that error depending upon what a Mass Matrix function returned, I suspect.
Telema Harry
2021년 8월 2일
편집: Telema Harry
2021년 8월 2일
Walter Roberson
2021년 8월 2일
Put a breakpoint at the call to ode45. Run until there. Then command
class(tspan)
class(In0)
class(wind)
class(I)
class(B)
class(DATE)
test_output = dynamics(tspan(1), In0, wind)
class(test_output)
and tell us what results show up.
Walter Roberson
2021년 8월 2일
By the way, it is recommended that you get rid of your global variables, and that you do not use that form of ode*() call to pass extra variables. That method of passing extra variables has not been documented for over 15 years, and there are cases where it will pass the wrong information (it is incompatible with some of the newer documented options, and the documented options have priority.)
Telema Harry
2021년 8월 3일
Telema Harry
2021년 8월 3일
답변 (1개)
Sulaymon Eshkabilov
2021년 8월 1일
편집: Sulaymon Eshkabilov
2021년 8월 1일
0 개 추천
The computed solution might be "nan" or "inf" only. Briefly speaking the size mismatch.
댓글 수: 2
Walter Roberson
2021년 8월 1일
I do not understand how this could explain the error message about trying to mix sparse and single in a * operation ?
Telema Harry
2021년 8월 2일
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

