五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

ode23,ode113,ode45,怎么選?對比下就知道了|何必手算?Matl

2023-07-28 23:39 作者:蒼納斯  | 我要投稿


clc

close all

clear


syms y(t) t

equ = diff(y)-y+2*t/y == 0;

cond = y(0) == 1;

res = dsolve(equ, cond)

fplot(res, 'LineWidth', 2);

grid on;

hold on;


fcn = @(t, y)y-2*t/y;

tspan = [0 4];


timerValue = tic;

[t23, y23] = ode23(fcn, tspan, 1);

timer23 = toc(timerValue);

plot(t23, y23, 'LineWidth', 2);


timerValue = tic;

[t113, y113] = ode113(fcn, tspan, 1);

timer113 = toc(timerValue);

plot(t113, y113, 'LineWidth', 2);


timerValue = tic;

[t45, y45] = ode45(fcn, tspan, 1);

timer45 = toc(timerValue);

plot(t45, y45, 'LineWidth', 2);


legend('$\sqrt{1+2t}$', 'ode23', 'ode113', 'ode45', 'Interpreter', 'latex', 'Location', 'northwest');


errorfun = @(t, y)sqrt(sum((sqrt(1+2*t)-y).^2)/length(t));

ode23error = [timer23 errorfun(t23, y23)]

ode113error = [timer113 errorfun(t113, y113)]

ode45error = [timer45 errorfun(t45, y45)]

ode23,ode113,ode45,怎么選?對比下就知道了|何必手算?Matl的評論 (共 條)

分享到微博請遵守國家法律
宝兴县| 襄城县| 郸城县| 临朐县| 柳州市| 毕节市| 海晏县| 肥东县| 宁晋县| 青龙| 鱼台县| 阆中市| 巴南区| 南投县| 兴隆县| 海宁市| 翁源县| 万宁市| 谷城县| 桐庐县| 汉源县| 仙游县| 习水县| 古丈县| 肥西县| 饶平县| 南汇区| 济阳县| 浮梁县| 郯城县| 齐齐哈尔市| 曲靖市| 神农架林区| 广安市| 南木林县| 望城县| 淳安县| 武冈市| 柳江县| 北碚区| 新安县|