Error tolerance in matlab

12 ビュー (過去 30 日間)
University Glasgow
University Glasgow 2022 年 10 月 6 日
コメント済み: Star Strider 2022 年 10 月 6 日
I'm using R2022a: I received this when I tried solve of mixed PDEs using finite difference method.
Warning: Failure at t=6.122922e-01. Unable to meet integration tolerances without reducing the step size below the
smallest value allowed (1.776357e-15) at time t.
  3 件のコメント
University Glasgow
University Glasgow 2022 年 10 月 6 日
Hmmmm, Okay, thank you.
Star Strider
Star Strider 2022 年 10 月 6 日
My pleasure!

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2022 年 10 月 6 日
Singularities occur when the denominator of a fraction approaches zero, or for certrain transcendental functions (e.g. exp, tan) when they have arguments that cause them to approach ±Inf, and (similar to exp) a value is raised to a power and the value is high enough to create a singularity.
Look for those occurrences. Plotting the function over the intended independent variable range defining the integration is the easiest way to find them.
I looked at your code, however I can’t follow what you’re doing. The initial conditions vector ‘u0’ is a 198-element column vector, indicating to me that you’re integrating 198 separate differential equations.
I discourage the use of global variables, since they create problems and make the code extremely difficult to troubleshoot. It would be better to pass them as additional parameters, as described in Passing Extra Parameters.
.
  2 件のコメント
University Glasgow
University Glasgow 2022 年 10 月 6 日
Okay, thank you.
Star Strider
Star Strider 2022 年 10 月 6 日
My pleasure!

サインインしてコメントする。

その他の回答 (1 件)

Torsten
Torsten 2022 年 10 月 6 日
The ode integrators try to guarantee a predefined error tolerance when solving your system of ordinary differential equations. If they cannot succeed (even by reducing the stepsize dt to a very small value), they give up.
Usual reasons are errors in the implementation, singularities in the solutions for the differential equations etc.
  4 件のコメント
University Glasgow
University Glasgow 2022 年 10 月 6 日
I don't understand what you are saying. Find attached the code
Torsten
Torsten 2022 年 10 月 6 日
I mean integrate up to t=0.6 and write out "rhsode" to inspect its values.
Further plot the solution up to 0.6 to see if it looks as expected.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBoundary Conditions についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by