资源简介
飞行器六自由度建模,并实现仿真。可修改参数加以改进
代码片段和文件信息
#include
#include
#include
#include
class SixDegreeMS
{
private:
int ijkn;
double abcdhtt1T0Tmax;
double *b1*b2*b3*y*x*x1;
//空气动力
double CyAlfaCyDeltz CzBetaCxCzDeltyCyCzAMaRouQSAlfaBetaFxFyFz;
//气动力矩
double Wz_Wy_Wx_LBeta_pMy_DeltYDeltY_pAlfa_pDeltZ_pMzMyMxMz0Mx0MzAlfaMzDeltzMz_WzMz_AlfaPMz_DeltZPMyBetaMyDeltyMy_WyMy_BetaPMy_DeltYPMxBetaMxDeltxMx_Wx;
//舵偏角解算
double DeltCxDeltCyDeltCzAlAh;
double GamacPgmJxJyJz;
public:
SixDegreeMS()
{
a=(sqrt(2)-1)/2;b=(2-sqrt(2))/2;
c=-sqrt(2)/2;d=1+sqrt(2)/2;
P=1.0;
g=1.0;
m=1.0;
Jx=1.0;
Jy=1.0;
Jz=1.0;
}
//************************************************
void func(double pdouble *qdouble *r)//常微分方程
{
// SolutionRudderAngle();
Al=1.0;
Ah=1.0;
DeltCx=-(0.0048*q[6]+0.092*q[11]);
if (q[3]<0.0)
{
DeltCy=0.00045*(82.22*q[7]+1.3004*Al);
DeltCz=0.00045*(82.22*q[8]+1.3004*Ah);
}
else
{
DeltCy=-(0.2*q[7]+q[10]);
DeltCz=-(0.2*q[8]+q[9]);
}
// Aerodynamic();
CyAlfa=1.0;
CyDeltz=1.0;
CzBeta=1.0;
CzDelty=1.0;
Cx=1.0;
Cy=CyAlfa*Alfa+CyDeltz*q[14];
Cz=CzBeta*Beta+CzDelty*q[13];
if(q[2]>=11000.0)
{
A=295;
Rou=0.0371*exp((11000.0-q[2])*1.5758e-4);
Q=0.5*Rou*q[3]*q[3];
Fx=Cx*Q*S;
Fy=Cy*Q*S;
Fy=Cz*Q*S;
Ma=q[3]/A;
}
else if (q[2]>=5000.0)//q[2]<0时情况
{
A=340.0-0.0039*q[2];
Rou=0.125*pow(1.0-q[2]*2.2573*10e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os(Gamac))+Fy*sin(Gamac)+Fz*cos(Gamac))/(-m*q[3]*cos(q[4]));
r[6]=(Mx-(Jz-Jy)*q[7]*q[8])/Jx;
r[7]=(My-(Jx-Jz)*q[8]*q[6])/Jy;
r[8]=(Mz-(Jy-Jx)*q[6]*q[7])/Jz;
r[9]=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3461 2011-04-25 23:30 Modeling of Six Degrees of Freedom\SixDegreeMS.dsp
文件 7535 2011-04-30 23:57 Modeling of Six Degrees of Freedom\SixDegreeMS.cpp
文件 244000 2011-05-09 20:18 Modeling of Six Degrees of Freedom\simul_SixDegreeMS.out
文件 53760 2011-05-09 20:18 Modeling of Six Degrees of Freedom\SixDegreeMS.opt
文件 547 2011-04-25 23:33 Modeling of Six Degrees of Freedom\SixDegreeMS.dsw
文件 1526 2011-04-22 10:37 Modeling of Six Degrees of Freedom\MSixDFreedom.h
文件 50176 2011-05-09 20:18 Modeling of Six Degrees of Freedom\Debug\vc60.idb
文件 69632 2011-04-30 23:57 Modeling of Six Degrees of Freedom\Debug\vc60.pdb
文件 309444 2011-04-23 19:21 Modeling of Six Degrees of Freedom\Debug\SixDegreeMS.pch
文件 262273 2011-05-09 20:18 Modeling of Six Degrees of Freedom\Debug\SixDegreeMS.exe
文件 566272 2011-05-09 20:18 Modeling of Six Degrees of Freedom\Debug\SixDegreeMS.pdb
文件 309408 2011-05-09 20:18 Modeling of Six Degrees of Freedom\Debug\SixDegreeMS.ilk
文件 28479 2011-05-09 20:17 Modeling of Six Degrees of Freedom\Debug\SixDegreeMS.obj
文件 58368 2011-05-09 20:18 Modeling of Six Degrees of Freedom\SixDegreeMS.ncb
文件 761 2011-05-09 20:18 Modeling of Six Degrees of Freedom\SixDegreeMS.plg
目录 0 2011-04-23 19:21 Modeling of Six Degrees of Freedom\Debug
目录 0 2011-04-18 18:23 Modeling of Six Degrees of Freedom
----------- --------- ---------- ----- ----
1965642 17
评论
共有 条评论