⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 seajisi.m

📁 自己编的四节龙格琨塔程序
💻 M
字号:
clear,clf,shg
%Set the definied time
%ts=0:0.05:.5;
%
ts=0:0.1:1.6;
n=length(ts);
x0=[0 0];
a=20;b=40;c=15;
%
%a=35;b=40;c=15;
%
opt=odeset('RelTol',1e-6,'AbsTol',1e-9);

%[t,x]=ode45(@jisi,ts,x0,[],a,b,c);
%
[t,x]=ode45(@jisi,ts,x0,opt,a,b,c);
%exact solution x1=c
y1=a*t;

%output t,x(t),y(t) and draw x(t),y(t)
[t,x,y1]
plot(t,x),grid,gtext('x(t)','FontSize',16),
gtext('y(t)','FontSize',16),pause

%draw y(x): the position of tatch jisi
plot(x(:,1),x(:,2),'r*'),grid
xlabel('x','FontSize',16),ylabel('y','FontSize',16)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -