upd
This commit is contained in:
7
labs/lab1/scripts/1_4/1_4.m
Normal file
7
labs/lab1/scripts/1_4/1_4.m
Normal file
@@ -0,0 +1,7 @@
|
||||
f = @(t,y) y.^2 - t;
|
||||
y0 = 1;
|
||||
tspan = [0 1.05]; % tspan = [0 1.5];
|
||||
opts = odeset('RelTol',1e-12,'AbsTol',1e-14);
|
||||
[t1,y1] = ode45(f,tspan,y0,opts);
|
||||
plot(t1,y1)
|
||||
print -dpng "plot.png"
|
||||
BIN
labs/lab1/scripts/1_4/plot.png
Normal file
BIN
labs/lab1/scripts/1_4/plot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
9
labs/lab1/scripts/2_4/2_4.m
Normal file
9
labs/lab1/scripts/2_4/2_4.m
Normal file
@@ -0,0 +1,9 @@
|
||||
lambda = 2000;
|
||||
f = @(t,y) -lambda*y + t;
|
||||
y0 = 0;
|
||||
tspan = [0 1];
|
||||
opts = odeset('RelTol',1e-12,'AbsTol',1e-14);
|
||||
[t2,y2] = ode15s(f,tspan,y0,opts);
|
||||
plot(t2,y2)
|
||||
print -dpng "plot.png"
|
||||
|
||||
BIN
labs/lab1/scripts/2_4/plot.png
Normal file
BIN
labs/lab1/scripts/2_4/plot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Reference in New Issue
Block a user