五月天青色头像情侣网名,国产亚洲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的評論 (共 條)

分享到微博請遵守國家法律
柳河县| 含山县| 丰县| 宜都市| 灵山县| 靖安县| 太谷县| 民乐县| 商丘市| 得荣县| 上高县| 彭州市| 通化县| 澄城县| 无棣县| 琼海市| 宜兴市| 嘉荫县| 车致| 镶黄旗| 平乐县| 德清县| 蒙山县| 南皮县| 东海县| 固原市| 嘉祥县| 略阳县| 扬州市| 鄱阳县| 宝山区| 瓦房店市| 文昌市| 辽源市| 济宁市| 亳州市| 南昌市| 铁岭市| 济阳县| 晋江市| 承德县|