气动学基于matlab气动力导弹姿态控制含Matlab源码 969期

Posted 紫极神光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了气动学基于matlab气动力导弹姿态控制含Matlab源码 969期相关的知识,希望对你有一定的参考价值。

一、获取代码方式

获取代码方式1:
完整代码已上传我的资源:【气动学】基于matlab气动力导弹姿态控制【含Matlab源码 969期】

获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。

备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);

二、部分源代码

clc;clear;
%------------------------定义导弹、大气、地球等固定参数---------------------%
Jx=2.95;Jy=168.2;Jz=168.2;
m=300;S=0.0616;L=0.3;
rho=1.2;g=9.8;
i=10000;
ii=i/10;
t=zeros(1,ii-1);dt=0.001;
H=pi/180;K=180/pi;
%-------------------------定义初始位置参数---------------------------------%
x=zeros(1,i);y=zeros(1,i);z=zeros(1,i);
y(1)=30000;
%-------------------------定义初始速度参数---------------------------------%
V=zeros(1,i);Vx=zeros(1,i);Vy=zeros(1,i);Vz=zeros(1,i);
V(1)=2275;Vx(1)=2275;
%-------------------------定义初始弹道参数---------------------------------%
theta=zeros(1,i);psiv=zeros(1,i);gammav=zeros(1,i);
theta(1)=(40*pi)/180;
%-------------------------定义初始姿态参数---------------------------------%
htheta=zeros(1,i);psi=zeros(1,i);gamma=zeros(1,i);
htheta(1)=40*H;psi(1)=0*H;gamma(1)=5*H;
htheta0=50*H;psi0=10*H;gamma0=0*H;
%---------------------------定义初始舵偏角---------------------------------%
deltax=zeros(1,i);deltay=zeros(1,i);deltaz=zeros(1,i);
%--------------------------定义初始姿态角速度参数---------------------------%
omegax=zeros(1,i);omegay=zeros(1,i);omegaz=zeros(1,i);
%-------------------------定义攻角/侧滑角----------------------------------%
alpha=zeros(1,i);beta=zeros(1,i);dalpha=0;dbeta=0;
%--------------------定义空气动力和空气动力矩-------------------------------%
X=zeros(1,i);Y=zeros(1,i);Z=zeros(1,i);
Mx=zeros(1,i);My=zeros(1,i);Mz=zeros(1,i);
%--------------------------定义控制律参数----------------------------------%
Kpx=-1.5;   Kdx=-0.018;
Kpy=-1.5;   Kdy=-0.05;
Kpz=-1.8;   Kdz=-0.05;
%--------------------------------定义绘图用数组----------------------------%
hthetat=zeros(1,ii-1);psit=zeros(1,ii-1);gammat=zeros(1,ii-1);
omegaxt=zeros(1,ii-1);omegayt=zeros(1,ii-1);omegazt=zeros(1,ii-1);
xt=zeros(1,ii-1);yt=zeros(1,ii-1);zt=zeros(1,ii-1);
Mxt=zeros(1,ii-1);Myt=zeros(1,ii-1);Mzt=zeros(1,ii-1);
deltaxt=zeros(1,ii-1);deltayt=zeros(1,ii-1);deltazt=zeros(1,ii-1);
%------------------------定义气动力、气动力矩的插值矩阵---------------------%
B = [-6,-4,-2,0,2,4,6];
A = [-6;-4;-2;0;2;3;4;6;8;10];

CX = [0.926,0.750,0.636,0.583,0.614,0.722,0.888;0.758,0.596,0.511,0.468,0.489,0.570,0.726;
      0.644,0.504,0.426,0.398,0.411,0.487,0.614;0.602,0.477,0.399,0.367,0.390,0.458,0.574;
      0.650,0.508,0.428,0.410,0.415,0.502,0.627;0.699,0.547,0.463,0.434,0.449,0.533,0.674;
      0.762,0.601,0.512,0.471,0.497,0.585,0.739;0.921,0.749,0.628,0.578,0.613,0.735,0.902;
      1.136,0.949,0.817,0.763,0.800,0.934,1.115;1.405,1.212,1.080,1.029,1.067,1.200,1.388];

CY = [-2.694,-2.563,-2.426,-2.351,-2.427,-2.605,-2.686;-1.854,-1.710,-1.642,-1.593,-1.618,-1.711,-1.800;
      -0.920,-0.818,-0.802,-0.794,-0.797,-0.798,-0.873;0.034,0.036,0.015,0.033,0.009,0.004,0.031;
      0.930,0.894,0.868,0.808,0.802,0.836,0.928;1.373,1.331,1.275,1.190,1.233,1.257,1.340;
      1.825,1.751,1.685,1.566,1.633,1.715,1.787;2.704,2.647,2.460,2.344,2.428,2.583,2.677;
      3.411,3.458,3.365,3.276,3.312,3.397,3.392;4.175,4.292,4.283,4.241,4.218,4.263,4.181];

CZ = [2.703,1.833,0.932,0,-0.932,-1.833,-2.703;2.619,1.753,0.880,0,-0.880,-1.753,-2.619;
      2.479,1.634,0.846,0,-0.846,-1.634,-2.479;2.447,1.620,0.806,0,-0.806,-1.620,-2.447;
      2.513,1.670,0.816,0,-0.816,-1.670,-2.513;2.582,1.693,0.829,0,-0.829,-1.693,-2.582;
      2.637,1.719,0.845,0,-0.845,-1.719,-2.637;2.717,1.823,0.931,0,-0.931,-1.823,-2.717;
      2.700,1.930,1.000,0,-1.000,-1.930,-2.700;2.775,1.999,1.027,0,-1.027,-1.999,-2.775];

MX = [-0.035,-0.008,0.030,0,-0.030,0.008,0.035;0.027,0.006,0.020,0,-0.020,-0.006,-0.027;
      0.021,0.060,0.008,0,-0.008,-0.060,-0.021;0.000,0.000,0.000,0,0.000,0.000,0.000;
      -0.017,-0.034,-0.002,0,0.002,0.034,0.017;-0.032,-0.047,0.001,0,-0.001,0.047,0.032;
      -0.034,-0.012,0.037,0,-0.037,0.012,0.034;0.014,0.028,0.038,0,-0.038,-0.028,-0.014;
      0.022,0.095,0.025,0,-0.025,-0.095,-0.022;0.007,0.195,0.098,0,-0.098,-0.195,-0.007];

MY = [2.096,1.498,0.750,0,-0.750,-1.498,-2.096;1.893,1.314,0.671,0,-0.671,-1.314,-1.893;
      1.658,1.126,0.612,0,-0.612,-1.126,-1.658;1.612,1.138,0.530,0,-0.530,-1.138,-1.612;
      1.763,1.224,0.564,0,-0.564,-1.224,-1.763;1.873,1.223,0.545,0,-0.545,-1.223,-1.873;
    

以上是关于气动学基于matlab气动力导弹姿态控制含Matlab源码 969期的主要内容,如果未能解决你的问题,请参考以下文章

气动学基于matlab GUI二维气体模拟含Matlab源码 2328期

气动学基于matlab GUI外弹道仿真系统含Matlab源码 1044期

气动学基于matlab GUI二维气体模拟含Matlab源码 2328期

气动学基于matlab GUI弹道问题(含初始角度速度空气阻力水平风)含Matlab源码 2117期

气动学基于matlab GUI弹道问题(含初始角度速度空气阻力水平风)含Matlab源码 2117期

气动学基于matlab GUI弹道仿真含Matlab源码 1136期