フィルターのクリア

What is the meaning of the error?

2 ビュー (過去 30 日間)
Zeynep Toprak
Zeynep Toprak 2020 年 5 月 8 日
コメント済み: Zeynep Toprak 2020 年 5 月 17 日
Question is from Tobin's book.
For part (a)'s matlab code and result,
n = 100 ; h = 2/n; %n intervals, width 2/n
x = -1 + h* (1: n-1)'; %node locations
D2 = toeplitz ([-2 1 zeros(1, n-3)]/ h^2); %diff matrix for u_xx
f = @(t, u) (0.2*D2*u ) + u.^2; % discretized du/dt
u0 = (1 - x.^2) ./ (1 + 50*x.^2); %initial condition
[t, u] = ode15s (f, [0 2], u0); %solve
waterfall (x, t, u)
And for part (b),
n = 100 ; h = 2/n; %n intervals, width 2/n
x = -1 + h* (1: n-1)'; %node locations
D2 = toeplitz ([-2 1 zeros(1, n-3)]/ h^2); %diff matrix for u_xx
f = @(t, u) (0.2*D2*u ) + u.^2; % discretized du/dt
u0 = 10 * (1 - x.^2) ./ (1 + 50*x.^2); %initial condition
[t, u] = ode15s (f, [0 2], u0); %solve
waterfall (x, t, u)
I get the following error when I run the code for the part b,
Warning: Failure at t=1.993395e-01. Unable to meet integration tolerances without reducing the step size below the smallest value
allowed (4.440892e-16) at time t.
> In ode15s (line 730)
In exercise_714_part_b (line 13)
I also get the following graph for the part b
Why did I face this error message? What is the meaning of it? and how can I correct it? Where is my mistake? And The graph for the part b is a bit nonsense. I cannot interpret this part and the graph.
  2 件のコメント
Gokberk Yildirim
Gokberk Yildirim 2020 年 5 月 16 日
Zeynep if you decrease the tolerance of time t, this graph will work without any warning. For example, you can change this part [t, u] = ode15s (f, [0 2], u0) like this [t, u] = ode15s (f, [0 0.1], u0). It gives us enough tolerance for calculation of integration in ode15s.
Zeynep Toprak
Zeynep Toprak 2020 年 5 月 17 日
Gokberk, thanks a lot :)

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeEigenvalue Problems についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by