I wrote a program containing 40 differential equations and after running the program with ode 45 command, I encountered the following message.
"Warning: Failure at t=7.384867e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.776357e-15) at time t."
i can't understand it and need urgent help.

 채택된 답변

Walter Roberson
Walter Roberson 2022년 8월 11일

0 개 추천

You could experiment with ode23s but it will probably lead to the same result.

You have a singularity in your equations when calculated from that starting point.

  • you might have implemented the equations incorrectly
  • the equations might be unstable together
  • a different starting point might be necessary
  • the equations might not be differentiable. For example you might have "if" in them or linear interpolation

I recommend setting up plotting of the components using the PlotFcn option so that you can get a better idea of how the components are behaving.

댓글 수: 4

Walter Roberson
Walter Roberson 2022년 8월 12일
if you have the symbolic toolbox, then I recommend setting up the equations symbolically and then following the workflow shown in the first example in the odeFunction documentation to convert to a numeric routine. This will help reduce the risk that you used the wrong variables in places or transferred derivatives the wrong way.
ali ziaei
ali ziaei 2022년 8월 13일
thank you for your attention me
ali ziaei
ali ziaei 2022년 8월 13일
Hello Mr Walter Roberson.
I asked a question that you answered. Thank you very much.
The truth is that I have been stuck in these equations for a long time and I really don't know what to do. Thank you for helping me.
The next step is to use the Symbolic Toolbox to build the system of equations, and then follow the steps shown in odeFunction()
When you try to build a system with 40 equations, it is quite difficult to visualize whether you have created corect code. It is much easier to examine symbolic formulas. Especially if you use LiveScript and code to add subscripts and accents; see https://www.mathworks.com/help/symbolic/add-suffixes-to-symbolic-results.html
For example this is probably easier to read than the code for setting up numerically directly
syms theta(t) phi(t)
theta__dot = diff(theta,t);
phi__dot = diff(phi(t));
eqn1 = theta__dot == phi
eqn1(t) = 
eqn2 = phi__dot == phi - theta
eqn2(t) = 
eqns = [eqn1, eqn2]
eqns(t) = 
sol = dsolve(eqns);
simplify(sol.phi)
ans = 
simplify(sol.theta)
ans = 

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

질문:

2022년 8월 11일

댓글:

2022년 8월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by