ode15i_example.m
来自「matlab7.0从入门到精通(光盘内容)」· M 代码 · 共 11 行
M
11 行
%ode15i_example.m
%解完全隐式微分方程
t0 = 1; %猜想的初值
y0 = sqrt(3/2);
yp0 = 0;
[y0,yp0] = decic(@ode_weissfun,t0,y0,1,yp0,0); %求出自洽初值,并保值y0值不变
[t,y] = ode15i(@ode_weissfun,[1 10],y0,yp0); %求在[1 10]区间内的解
ytrue = sqrt(t.^2 + 0.5); %解析解
plot(t,y,t,ytrue,'o'); %画图比较数值解与解析解
xlabel('t');
ylabel('y'); %
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?