tft每日頭條

 > 生活

 > matlab怎樣求微分方程組特解

matlab怎樣求微分方程組特解

生活 更新时间:2024-07-29 16:24:36

很多小夥伴問MATLAB 解偏微分方程組的數值解法編程問題,這裡提供2種常用的MATLAB數值解法及源代碼(ODE45和ODE15s)。

洛倫茲混沌

clc;clear;close all

tspan=[0,100];

cond=[1.3 4 2];

opts=odeset('RelTol',1e-5,'AbsTol',1e-5);

[t,x]=ode45(@chaos,tspan,cond,opts)

plot(x(:,1),x(:,2))

plot(x(:,1),x(:,3))

plot(x(:,2),x(:,3))

plot3(x(:,1),x(:,2),x(:,3))

opts=odeset('RelTol',1e-5,'AbsTol',1e-5);

[t,x]=ode15s(@chaos,tspan,cond,opts)

plot(x(:,1),x(:,2))

plot(x(:,1),x(:,3))

plot(x(:,2),x(:,3))

plot3(x(:,1),x(:,2),x(:,3))

function dx=chaos(t,x)

ru=10;

b=8/3;

r=28;

dx=[ru*(x(2)-x(1));r*x(1)-x(2)-x(1)*x(3);x(1)*x(2)-b*x(3)];

end

得到的圖形為:

matlab怎樣求微分方程組特解(解偏微分方程組的數值解法)1

matlab怎樣求微分方程組特解(解偏微分方程組的數值解法)2

matlab怎樣求微分方程組特解(解偏微分方程組的數值解法)3

matlab怎樣求微分方程組特解(解偏微分方程組的數值解法)4

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关生活资讯推荐

热门生活资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved