您好,欢迎访问三七文档
弹道学第二次作业1题目计算空地导弹在铅垂平面内无动力滑行的质点轨道,画出弹道曲线及速度随时间变化的曲线。初始条件:𝑚0=260𝑘𝑔;s=1.2;M0=2;ℎ0=5000𝑚;𝜃0=0;音速a=340;Cx=[M^2,M,1]*[0.0002,0.0038,0.1582;-0.0022,-0.0132,-0.8520;0.0115,-0.0044,1.9712]*[𝛼2,𝛼,1]'Cy=[M^2,M,1]*[-0.0173,0.0434,0.3275]'*𝛼密度公式:ρ=1.225ℯ−0.00015ℎ(h为高度,单位为米)假定飞行过程中攻角始终为2度,仿真至导弹掉地为止。一、数学模型1空气动力与推力的展开表达式X=12𝜌𝑉2𝑆𝐶𝑥Y=12𝜌𝑉2𝑆𝐶𝑦推力P=0;2垂直平面运动方程组m𝑑𝑉𝑑𝑡=−12𝜌𝑉2𝑆𝐶𝑥−𝑚𝑔𝑠𝑖𝑛𝜃mV𝑑𝜃𝑑𝑡=12𝜌𝑉2𝑆𝐶𝑦−𝑚𝑔𝑐𝑜𝑠𝜃𝑑𝑦𝑑𝑡=𝑉𝑠𝑖𝑛𝜃𝑑𝑥𝑑𝑡=𝑉𝑐𝑜𝑠𝜃弹道学第二次作业2二、弹道积分算法与仿真结果将上述运动方程组转化为如下形式:[𝑑𝑦1𝑑𝑡𝑑𝑦2𝑑𝑡𝑑𝑦3𝑑𝑡𝑑𝑦4𝑑𝑡]=[−𝜌𝑉2𝑆𝐶𝑥2𝑚−𝑔𝑠𝑖𝑛𝜃𝜌𝑉𝑆𝐶𝑦2𝑚−𝑔𝑐𝑜𝑠𝜃𝑉𝑉𝑠𝑖𝑛𝜃𝑉𝑐𝑜𝑠𝜃],[𝑦1(0)𝑦2(0)𝑦3(0)𝑦4(0)]=[680050000]1直接调用函数库中ode45指令1.1构建M函数文件dydt.m1functionydot=dydt(t,y)2ydot=zeros(4,1);3m=260;4M=y(1)/340;5Cx=[M^2,M,1]*[0.0002,0.0038,0.1582;-0.0022,-0.0132,-0.8520;0.0115,-0.0044,1.9712]*[(pi/90)^2,pi/90,1]';6Cy=[M^2,M,1]*[-0.0173,0.0434,0.3275]'*pi/90;7rol=1.225*exp(-0.00015*y(3));8ydot=[-0.5*rol*y(1)^2*1.2*Cx/m-9.8*sin(y(2));0.5*rol*y(1)*1.2*Cy/m-9.8*cos(y(2))/y(1);y(1)*sin(y(2));y(1)*cos(y(2))];1.2构建条件判断函数events.m1function[valueisterminaldirection]=events(tt,yy)2land=yy(3);3value=land;4%到达检测条件时,ode45停止运行5isterminal=1;6%value穿过零点的方向为由正到负7direction=-1;1.3构建主程序main.m1tspan=[0105];弹道学第二次作业32y0=[680;0;5000;0];3options=odeset('events',@events);%设置导弹掉地检测条件4[ttyy]=ode45(@dydt,tspan,y0);%第一列为速度;第二列为θ5figure;%第三列为Y;第四列为X6plot(tt,yy(:,1))7xlabel('t'),ylabel('V')8title('速度—时间曲线')9figure;10plot(yy(:,4),yy(:,3))11xlabel('X'),ylabel('Y')12title('弹道轨迹')1.4仿真结果弹道学第二次作业42自编四阶龙格—库塔算法2.1四阶龙格—库塔原理121324311234(,)(,)22(,)22(,)(22)6nnnnnnnnnnKfxyhhKfxyKhhKfxyKKfxhyhKhyyKKKK2.2构建M函数文件longgekuta.m3function[endtime,v,sita,y,x]=longgekuta(a,b,v0,sita0,y0,x0,h)45f1=@f1;6f2=@f2;7f3=@f3;8f4=@f4;910t=a:h:b;11v(1)=v0;12sita(1)=sita0;13y(1)=y0;14x(1)=x0;15flag=1;16i=2;1718while(flag)1920if(y(i-1)0)%导弹落地检测条件21K(1,1)=f1(t(i-1),v(i-1),sita(i-1),y(i-1),x(i-1));22K(2,1)=f2(t(i-1),v(i-1),sita(i-1),y(i-1),x(i-1));23K(3,1)=f3(t(i-1),v(i-1),sita(i-1),y(i-1),x(i-1));24K(4,1)=f4(t(i-1),v(i-1),sita(i-1),y(i-1),x(i-1));25K(1,2)=f1(t(i-1)+h/2,v(i-1)+K(1,1)/2,sita(i-1)+K(2,1)/2,y(i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+2*K(2,3)+K(2,4));39y(i)=y(i-1)+h/6*(K(3,1)+2*K(3,2)+2*K(3,3)+K(3,4));40x(i)=x(i-1)+h/6*(K(4,1)+2*K(4,2)+2*K(4,3)+K(4,4));41i=i+1;42else43flag=0;44endtime=a+h*(i-2);%输出导弹掉地时刻45end46end4748t1=length(v);弹道学第二次作业649ind=[1:t1];50t2=t(ind);%修改数组t的长度使之与数组v匹配5152figure;53plot(t2,v)54xlabel('t'),ylabel('V')55title('速度—时间曲线')56figure;57plot(x,y)58xlabel('X'),ylabel('Y')59title('导弹轨迹')6061functionf=f1(t,v,sita,y,x)62m=260;63M=v/340;64Cx=[M.^2,M,1]*[0.0002,0.0038,0.1582;-0.0022,-0.0132,-0.8520;0.0115,-0.0044,1.9712]*[4,2,1]';65rol=1.225*exp(-0.00015*y);66f=-0.5*rol*v^2*1.2*Cx/m-9.8*sin(sita);6768functionf=f2(t,v,sita,y,x)69m=260;70M=v/340;71Cy=[M.^2,M,1]*[-0.0173,0.0434,0.3275]'*2;72rol=1.225*exp(-0.00015*y);73f=0.5*rol*v*1.2*Cy/m-9.8*cos(sita)/v;7475functionf=f3(t,v,sita,y,x)76f=v*sin(sita);7778functionf=f4(t,v,sita,y,x)79f=v*cos(sita);802.3构建主函数mainkutta.m1[endtime]=longgekuta(0,130,680,0,5000,0,0.01)%积分时长0至130;步长0.01;速度初值680;初值0;Y=5000;X=0;指令框中显示:mainkuttaendtime=135.2700弹道学第二次作业72.4仿真结果
本文标题:弹道学作业2
链接地址:https://www.777doc.com/doc-6024513 .html