matlab中欧拉法,欧拉法函数

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

function [tout,yout]=euler(ypfun,t0,tfinal,y0,tol,trace)

pow=1/3

if nargin<5,tol=1.e-3; end

if nargin<6,trace=0; end

t=t0;

hmax=(tfinal-t)/16;

h=hmax/8;

y=y0(:);

chunk=128;

tout=zeros(chunk,1);

yout=zeros(chunk,length(y));

tout(k)=t;

yout(k,:)=y.';

if trace

clc,t,h,y

end

while(tt)

if t+h>tfinal,h=tfinal-t;end

%compute the slopes

f=feval(ypfun,t,y);f=f(:);

delta=norm(h*f,'inf');

tau=tol*max(norm(y,'inf'),1.0);

if delta<=tau

t=t+h;

y=y+h*f;

k=k+1;

if k>length(tout)

tout=[tout;zeros(chunk,1)];

yout=[yout;zeros(chunk,length(y))];

end

tout(k)=t;

yout(k,:)=y.';

end

if trace

home,t,h,y

end

if delta ¬=0.0

h=min(hmax,0.9*h*(tau/delta)^pow));

end

end

if (t

disp('Singularity likely.')

t

end

tout=tout(1:k);

yout=yout(1:k,:);

有人知道37行这个~=符号是什么情况吗 ? 谢谢了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值