Professional Documents
Culture Documents
v23.7
12.09.11
2011
wingopt _ a 2 _ v 23.m ,
Matlab . 3000
. Matlab
,
.
wingopt _ a 2 _ v 23.m Matlab v7.10 ( R 2010a ) .
- () .
, , Apame
Nastran .
Apame
www.3dpanelmethod .com .
wingopt _ a 2 _ v 23.m
Windows , Unix -, ,
Matlab , Apame , Nastran .
Windows -.
, , , mat ,
, airfoil
. 5.1.
130
5.1
,
, *.INI . ,
*.INI .
:
1. ,
.
2. .
3. Apame .
4. Nastran .
5.2.
C:\work11\wingopt_new
C:\work11\airfoil
C:\apame\apame_V2.3\apame23_32_a.exe
C:\MSC.Software\MSC_Nastran\bin\nastran.exe
5.2 *.INI
Matlab
( Current Folder ) .
,
, ( Command Window )
cd % % ,
cd c:\work\wingopt.
131
wingopt _ a 2 _ v 23.m m (
Editor ).
, F 5 ,
m .
( Command Window ) Ctrl + C .
( structure ).
.
5.3.
(m.E)
(m.nu)
(m.den)
(m.den_min)
(m.dop)
5.3
( m )
11 ( 5.4).
1. g
2. p
3. c
4. a
5. ar
6. f
7. fr
8. m
9. res
10.plt
11.path
5.4 ,
132
wingopt _ a 2 _ v 23.m
:
, , .
.
, .
ISAtmosphere.m
alfa_calc_v3.m
beep_fin.m
cosine.m
e_volume.m
export_apame22_v7.m
Apamev2.2(Unix)
export_apame23_v7.m
Apamev2.3(Windows)
export_nastran_v2.m
Nastran
import_apame23_v7.m
Apame
import_nastran_v2.m
Nastran
inputdatafile23.m
intr_cl.m
intr_pl.m
lin.m
mod_af.m
model_apame_v4n.m
opt_tpp_v3.m
post_fig_prep.m
(interpreter,tex)
post_fig_prep_ltx.m
(interpreter,latex)
post_save_tif.m
*.tif
run_apame.m
Apame
run_nastran.m
Nastran
slh.m
wetted_area.m
zeroliftdrag_w.m
zeroliftdrag_f.m
133
zeroliftdrag_n.m
wingopt _ a 2 _ v 23.m
:
1.
(%% wingopt_a2_v23.7)
2.
(%% Sub-functions)
3.
4.
(%% Airfoils),
airfoil .
5.
6.
(%% Paths, Output Folder & Input Data File).
7.
(%% Waitbar).
8.
9.
(%% Geometry).
10.
11.
- (%% FEM).
12.
(%% Geometry
Visualisation).
13.
14.
15.
16.
17.
(%% Loadsp.cwl~=2).
18.
19.
20.
21.
(%% Variable-Density-Body
Optimization).
22.
(%% Deformations).
Matlab .
,
.
134
23.
24.
25.
(%% Visualisation).
26.
(%% End).
,
5.5.
% wingopt_a2_v23.7
% Sub-functions
% Initializing variables
% Airfoils
% Input Data
% Paths, Output Folder & Input Data File
% Waitbar
% Aircraft Parameters
for p1i=1:length(p1) % p1 p2 p3 loop
for p2i=1:length(p2)
for p3i=1:length(p3)
for j=1:p.cyl_mto % Take-off mass estimation loop
% Geometry
for v=1:p.cyl_def % Deformations loop
% Surface Points
% FEM
% Geometry Visualisation
% Aerodynamic Analysis
% Aerodynamic Loads
% Concentrated Weights
% Concentrated Loads
% Loads p.cwl~=2
% Fuel Weight Loads
% FEM Constraints
% Zero-Density Volume
for k=1:p.cyl_tpp
% Variable-Density-Body Optimization
end
% Deformations
end
% Objective Function Evaluation
% Save Results
end
% Save Results
end
end
end
% Visualisation
% End
5.5
135
for p1i=1:length(p1)
for p2i=1:length(p2)
for p3i=1:length(p3)
( p1 , p 2 , p3 ).
for j=1:p.cyl_mto
.
.
for v=1:p.cyl_def
, ,
,
.
.
.
.
for k=1:p.cyl_tpp.
,
,
, , ,
, , ,
.
.
.
136
,
. debug:
debug=0;
% 1- , 0-
fn='test';
% ,
fn ,
.
:
- ( *.id ),
;
- ( errors.log ),
;
- - - Apame ( *.inp , *.log , *.res )
Nastran ( *.dat , *.log , *.f04 , *.f06 , *.pch );
- ( *.tbl );
- ( * _ final.mat ),
;
- ( - *.tif ,
- *. fig ).
,
fn.
.
,
( 5.6).
5.6
Yes, , ,
. , , ,
. No,
137
_n . Cancel
fn.
,
.
,
%:
% p1={'z', 15 30};
% p2=[1 2 3 4];
% p3=[4 6 8];
% 1
% 2
% 3
,
.
:
if p1~=0
g.sa{1}=p1(p1i);
% p1 -
end
if p2~=0
g.tr(1,1)=p2(p2i); % p2
end
if p3~=0
g.ar(1,1)=p3(p3i); % p3
end
,
.
. ,
.
. ,
,
-,
. , ,
, , , V
, .
,
. .
138
%
g.ar=[1.67 6.4];
%
g.tr=[1.73 2.33];
%
g.nop=length(g.ar);
g.afn=cell(1,g.nop+1);
g.afn{1,1}='tsagi_p190k_14.5_31_y.dat';% 1- ()
g.afn{1,2}='tsagi_p266_09.0_31_y.dat';% 2-
g.afn{1,3}='tsagi_p266m_11.0_31_y.dat'; % 3 ()
g.sa0{1}=[25.64 30];% []
g.va=[0 0];
% [] V
g.ta=[0 0 0]; % [] 1/4
g.x0=0;
% []
g.y0=0;
%
( )
g.z0=0;
a.m=[10 20];
g.sa0=0
.
, g.sa0=z.
.
, .
, ,
, .
%
a.stab=2;
a.fin=3;
g.ar(2:3,1)=[5.1;1.7]; % /
g.tr(2:3,1)=[2.9;2.8]; % /
g.afn{2,1}='naca0011_31_cf_afr.dat';
% /
g.afn{2,2}='naca0009_31_cf_afr.dat';
g.afn{3,1}='naca0011_31_cf_afr.dat';
g.afn{3,2}='naca0009_31_cf_afr.dat';
g.sa0{2}=[33];
% [] /
g.sa0{3}=[35];
g.va(2:3,1)=[10;90];
% [] V /
g.ta(2:3,1:2)=[0,0;0,0];% [] /
g.x0(2:3,1)=[-39.9375e3;-38.810e3]; % [] /
g.y0(2:3,1)=[0.622e3;1.56e3];
g.z0(2:3,1)=[0;0];
g.S(2:3,1)=[43.9e6;33.4e6];
% [2] /
g.nop(2,1)=length(nonzeros(g.ar(2,:)));
g.nop(3,1)=length(nonzeros(g.ar(3,:)));
a.m(2:3,1)=[30;30];
% /
g.now=length(g.nop);
a.csn=[1 2];
%
a.csn(2:3,1)=[2;2];
a.sym=1; % 1- ,0-
139
, .
a.csn, :
0 ;
1 ();
2 ;
3 , .
.
( ), ,
V. ,
, ,
.
V.
140
g.now=length(g.nop);
a.csn=[1 2];
%
a.csn(2:3,1)=[2;2];
a.sym=1;
% 1- ,0-
%
a.fslg=0;
0- , /
fnf='geom_v23r.mat';
g.D=3960;
g.L=44750;
%
a.ncl=0;
fnn='nacelle_0r.mat';
g.nD=2300;
g.nL=5600;
g.nx0=1.08;
%
g.ny0=-0.28;
%
g.nz0=0.32;
%
% 1- ,
%
% []
% []
% 1- ,
% 0-
%
% []
% []
% x
%
% y
%
% z
%
*.mat
mat .
, ,
.
, , :
g .D = 3960
g .D = 3800
( 5.7):
- ;
141
- + ;
- + + .
.
5.7
, .
.
-
,
.
%
a.fslg=0;
142
:
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
a.stab=2;
a.fin=3;
g.ar(2:3,1)=[5.1;1.7];
% /
g.tr(2:3,1)=[2.9;2.8];
% /
g.afn{2,1}='naca0011_31_cf_afr.dat';
% /
g.afn{2,2}='naca0009_31_cf_afr.dat';
g.afn{3,1}='naca0011_31_cf_afr.dat';
g.afn{3,2}='naca0009_31_cf_afr.dat';
g.sa0{2}=[33];
% []
% /
g.sa0{3}=[35];
g.va(2:3,1)=[10;90];
% [] V
% /
g.ta(2:3,1:2)=[0,0;0,0]; % []
% /
g.x0(2:3,1)=[-39.9375e3;-38.810e3]; % []
% /
g.y0(2:3,1)=[0.622e3;1.56e3];
g.z0(2:3,1)=[0;0];
g.S(2:3,1)=[43.9e6;33.4e6]; % [2] /
g.nop(2,1)=length(nonzeros(g.ar(2,:)));
g.nop(3,1)=length(nonzeros(g.ar(3,:)));
a.m(2:3,1)=[30;30];
% /
, ,
, .
,
%
a.fslg=1;
, .
143
%
p.p0=6.0e-3;
% [/2]
p.R=3500;
% []
p.n=200;
%
p.mto0=100000;
% []
p.cp=0.6;
% [//]
p.alf=1020;
%
p.phi=2.3;
%
p.beta=1;
%
%
% --------p.ml=20000;
% []
p.mo=(4+p.n/30)*75+0.02*p.mto0; % []
p.mp=0.1;
%
p.mw0=0.1;
%
%
p.me=0.1;
%
p.ms=0.1;
%
%
f.it=0;
%
%
f.res=0;
%
%
1- - ,
0-
1- *.f06
Femap, 0-
p.cwl=2;
%
%
%
%
%
%
0 - ,
1 - ,
2 -
p.uww=1;
%
%
%
%
%
%
1- ,
0-
1- ,
0-
1-
, 0-
p.ufw=1;
p.fix_ar=0;
p.cyl_mto=1;
p.cyl_tpp=15;
p.cyl_def=3;
%
%
%
%
f.x1=0.2;
f.x2=0.7;
f.xf=0.25;
f.dl=[0 0.1 0.3 0.5
f.mf=5;
%
%
%
0.7 0.9 1];
%
%
%
f.clj=round((length(f.dl)+1)/2); %
f.cmj=0;
%
%(<1-, >1- [])
144
%
f.fmz=0.32;
%
%
f.fmx=0.2;
%
%
f.fmv=[ 0
;... % []
-4.7039e+04;...
0];
%
f.fpz=0.32;
%
%
f.fpx=0.2;
%
%
f.fpv=[ 156.96e3;...% []
0;...
0];
%
f.ftzr1=0.1;
%
f.ftzr2=0.9;
%
%
f.cx1=0;
%
f.cx2=0;
%
f.cz1=0;
% []
f.cz2=0;
% []
f.cnl=1;
%
%
m.E=7e4;
m.nu=0.3;
m.den=2.7e-6;
m.den_min=2.7e-15;
m.dop=300;
p.fd=0.8e-6;
c.g=9.81;
%
%
%
%
%
[]
[/3]
[/3]
[]
% [/3]
%[/2]
145
%
%------------------%
p.ne(1)=1;
%
p.f(1)=1;
%
c.H(1)=10000;
% []
c.M(1)=0.8;
%
c.alfa{1}=0:1:5;
% []
%------------------[c.d(1),c.a(1),c.p(1),c.mu(1)]=ISAtmosphere(c.H(1));
c.V(1)=c.M(1)*c.a(1);
c.q(1)=c.d(1)*(c.V(1)^2)/2;
ar.CL(1)=p.ne(1)*p.p0*1e6/c.q(1);
%------------------% A'
p.ne(2)=2.5;
%
p.f(2)=1.5;
%
c.H(2)=10000;
% []
c.M(2)=0.88;
%
c.alfa{2}=0:5:25;
% []
%------------------[c.d(2),c.a(2),c.p(2),c.mu(2)]=ISAtmosphere(c.H(2));
c.V(2)=c.M(2)*c.a(2);
c.q(2)=c.d(2)*(c.V(2)^2)/2;
ar.CL(2)=p.ne(2)*p.p0*1e6/c.q(2);
%------------------%
plt.wb=0;
%
plt.cmf=1;
%
plt.sbp=1;
%
plt.com=0;
%
plt.am=0;
%
plt.ar=0;
%
plt.fem=1;
%
plt.fen=1;
%
plt.flc=1;
%
plt.fr=1;
%
plt.G=1;
%
plt.Ck=0;
%
plt.gamma=0;
%
% (0 - , >0 - )
plt.QM=0;
% ,
%
plt.cg=0;
%
,
.
146
S=
m0 g
.
p0
c0 = 2
S
n
p
i =1
(1 + i )
pi
=
i .
i !
2
i c i =
c0
.
i !
i Si= 0, 25 c02 pi .
i =
li
i Si
, V (
5.8). , ,
,
.
.
g.x0
g.y0
5.8
147
, - ,
,
,
.
.
.
( 5.9).
5.9
- ( 5.10).
( 5.11),
.
148
5.10
5.11 -
.
,
,
V.
( 5.12).
149
5.12
(g.nop , a.m )
model_apame_v4n.m .
Apame , ,
Apame
.
export_apame23_v27.m , run _ apame.m import _ apame23 _ v7.m .
150
( ), , , ; ,
.
,
, ,
.
.
.
:
C ya q S = n m0 g , C ya =
n y m0 g
qS
, C ya =
n y p0
q
C ya
C ya . ,
Apame . C ya
, - ,
C ya .
.
( A ' )
.
. ,
Matlab interp1 . ,
C ya .
Cxa i
C p , Cxa i C p ,
.
151
alfa _ calc _ v3.m .
,
Apame , ,
Cxa 0
.
Cxa 0
, , :
n
Cxa 0 =
C
k =1
f k
k F k kQ k S k
S
C f - ;
k F -
kQ - ;
S - ;
S - .
, .
, ;
.
: zeroliftdrag _ w.m - , zeroliftdrag _ f .m zeroliftdrag _ n - .
wetted _ area.m .
152
-
-
.
( ) (
.
f.dl.
Z
( 5.13).
5.13
, ,
Z . , ,
X
Y . Y .
153
1. (p.cwl=0)
.
.
2. (p.cwl=1)
, .
.
3. (p.cwl=2)
. .
,
:
=
fyi
1 4
( C p j q S j ny j ) ,
4 j =1
C p - ;
q -
S - ;
n y - Y .
, ,
.
P ( 5.14).
5.14
154
P=
R ( x x1 ) + R ( x x2 )
,
( x2 x1 )
R , R -
.
- ,
.
, . ,
.
, .
, ,
, .
, -
, ( 5.15).
,
.
5.15
. .
155
- ,
, ,
export_nastran_v2.m Nastran .
run _ nastran.m Nastran . import _ nastran _ v 2.m
( *.pch ).
:
=
i j i j 1
[ ]
Ei j= E i j ,
[ =
]ij [ ] i j .
, m.den_min.
- .
V
. ,
.
V
, .
:
- ;
- ;
-
;
- ,
;
156
- ;
- ;
- ;
-
;
- .
,
.
5.16
157
5.17
5.18
158
5.19
5.20
159
5.21
5.22
160
5.23
5.24
161