文档介绍:相平面分析 matlab程序
〈〈应用非线性控制》,程代展译
1、 P13:质量-弹簧系统 1
2、 P14:非线性二阶系统 2
3、 P15: 一阶非线性系统 3
4、 P17:卫星控制系统 4
5、 P26:课后习题 7
7
10
1、P13:质量-弹簧系统
x x = 0
clear
clc
x=1; %修改此值
Dx=0;
n=1;
t=0;
Dt=;
for i=1:8000
DDx=-x;
Dx=Dx+DDx*Dt;
x=x+Dx*Dt;
Dx_store(n)=Dx;
x_store(n)=x;
n=n+1;
t=t+Dt;
end
figure(1)
plot(x_store,Dx_store)
xlabel('x')
ylabel('Dx')
title('相平面分析')
hold on
2、P14:非线性二阶系统
x 3x x? = 0
相平面分析
clear
clc
% x=-6; %i=1:10000
% Dx=10;
% x=-8; %i=10000
% Dx=15;
% x=5; %i=1:1700
% Dx=7;
% x=4; %i=2000
% Dx=8;
% x=-7; %i=1:1500 % Dx=10;
x=-5; %i=1:1200
Dx=4;
n=1;
t=0;
Dt=;
for i=1:1200
DDx=-*Dx-3*x-xA2;
Dx=Dx+DDx*Dt;
x=x+Dx*Dt;
Dx_store(n)=Dx;
x_store(n)=x;
n=n+1;
t=t+Dt;
end
figure(1)
plot(x_store,Dx_store)
xlabel('x')
ylabel('Dx')
title('相平面分析')
hold on
3、P15: 一阶非线性系统
相平面分析
x = -4x x3
4
2
x -
D 0
-2
-2
-4
clear clc
x=; %i=1:2000
%x=-; %i=1:3000
%x=-; %i=1:700
n=1;
t=0;
Dt=;
for i=1:2000
Dx=-4*x+xA3;
x=x+Dx*Dt;
Dx_store(n)=Dx;
x_store(n)=x;
n=n+1;
t=t+Dt;
end
figure(1)
plot(x_store,Dx_store)
xlabel('x')
ylabel('Dx')
title('相平面分析')
hold on
4、P17:卫星控制系统
-5—0 u =
5 elseother
相平面分析
clear clc x=; %i=1:5000
Dx=;
% x=1; %i=1:5000
% Dx=1;
% %
% x=2; %i=1:5000
% Dx=2;
%
% x=3; %i=1:5000
% Dx=3;
n=1;
t=0;
Dt=;
for i=1:5000
if x>0
u=-5;
else
u=5;
end
DDx=u;
Dx=Dx+DDx*Dt;
x=x+Dx*Dt;
Dx_store(n)=Dx;
x_store(n)=x;
n=n+1;
t=t+Dt;
end
figure(1)
plot(x_store,Dx_store)
xlabel('x')
ylabel('Dx')
title('相平面分析')
hold on
5、P19:范德波尔方程
x (x2 - 1)x x = 0
相平面分析
-2 0 2
x
clear
clc
x=0; %i=1:20000
Dx=10;
% x=0; %i=1:7000
% Dx=2;
% x=0;%i=1:50000
% Dx=;
n=1;
t=0;
Dt=;
for i=1:20000
DDx=-*(xA2-1)*Dx-x;
Dx=Dx+DDx*Dt;
x=x+Dx*Dt;
Dx_store(n)=Dx;
x_store(n)=x;
n=n+1;
t=t+Dt;
end
figure(1)
plot(x_store,Dx_store)
xlabel('x')
ylabel('Dx')
title('相平面分析')