資源描述:
《彈道仿真C源程序.doc》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、.彈道仿真C源程序/*鉛垂平面內(nèi)飛行器彈道仿真C源程序*/#include"math.h"#include"stdio.h"#include"stdlib.h"#defineRAD57.3doubleACX[5][6],ACY[5][6],AMZAF[5][6],AMZWZ[5][2],AXG[11][2],AJZ[3][2],AP[2],AMC[2],AGC[2],ANDM[2],ANDAF[2],Y[8],B[3],L,S,SONIC,RHO;/*ACX[5][6]:
2、阻力系數(shù)數(shù)組;ACY[5][6]:升力系數(shù)數(shù)組;*//*AMZAF[5][6]:某一質(zhì)心位置下的靜穩(wěn)定性導(dǎo)數(shù)數(shù)組;AMZWF[5][2]:阻尼力矩系數(shù)導(dǎo)數(shù)數(shù)組;*//*AXG[10][2]:質(zhì)心位置Xg隨時間的變化規(guī)律;AJZ[3][2]:轉(zhuǎn)動慣量Jz隨時間的變化規(guī)律;*//*AP[2]:起飛,續(xù)航發(fā)動機的推力值;AMC[2]:起飛,續(xù)航發(fā)動機燃料質(zhì)量秒流量值;*//*AGC[2]:質(zhì)心位置變化的始末值;ANDM[2]:氣動數(shù)據(jù)插值所需要的Ma數(shù)的最大最小值;*//*ANDAF[2]:氣動數(shù)據(jù)插值所需要的攻角的最大最小值;Y[8]
3、存放積分結(jié)果的數(shù)組;*//*B[3]:存放三個時間值的數(shù)組;L:特征長度;S:特征面積;SONIC:聲速;RHO:大氣密度;*/doubleMA,ABC_ALPHA,CX,CY,MZAF,MZWZ,XG,JZ,ALPHA;/*MA:馬赫數(shù);ABC_ALPHA:攻角的絕對值;CX:阻力系數(shù);CY:升力系數(shù);MZAF:靜穩(wěn)定性導(dǎo)數(shù)值;*//*MZWZ:阻尼力矩導(dǎo)數(shù)值;XG:質(zhì)心位置;JZ:轉(zhuǎn)動慣量;ALPHA:攻角;*/FILE*fi,*fo;/*主函數(shù)*/voidmain(){voidrk();/*調(diào)用rk函數(shù)*/voidresul
4、t();/*調(diào)用result函數(shù)*/inti,j;doubleh;/*h為步長*/fi=fopen("input.dat","r");..for(i=0;i<5;i++){for(j=0;j<6;j++)fscanf(fi,"%lf",&ACX[i][j]);}for(i=0;i<5;i++){for(j=0;j<6;j++)fscanf(fi,"%lf",&ACY[i][j]);}for(i=0;i<5;
5、i++){for(j=0;j<6;j++)fscanf(fi,"%lf",&AMZAF[i][j]);}for(i=0;i<5;i++){for(j=0;j<2;j++)fscanf(fi,"%lf",&AMZWZ[i][j]);}for(i=0;i<10;i++){for(j=0;j<2;j++)fscanf(fi,"%lf",&AXG[i][j]);}for(i=0;i<3;i++){for(j=0;j<
6、;2;j++)fscanf(fi,"%lf",&AJZ[i][j]);}for(i=0;i<2;i++)fscanf(fi,"%lf",&AP[i]);for(i=0;i<2;i++)fscanf(fi,"%lf",&AMC[i]);for(i=0;i<2;i++)fscanf(fi,"%lf",&AGC[i]);for(i=0;i<2;i++)fscanf(fi,"%lf",
7、&ANDM[i]);..for(i=0;i<2;i++)fscanf(fi,"%lf",&ANDAF[i]);for(i=0;i<8;i++)fscanf(fi,"%lf",&Y[i]);for(i=0;i<3;i++)fscanf(fi,"%lf",&B[i]);fscanf(fi,"%lf%lf%lf%lf%lf",&L,&S,&SONIC,&RHO,&h);
8、fclose(fi);fo=fopen("output.dat","w");fprintf(fo,"%s","TIMEALPHAVXY");fprintf(fo,&qu