don't know how to fix this

1 visualizzazione (ultimi 30 giorni)
saeed abdallah
saeed abdallah il 28 Apr 2018
Risposto: Walter Roberson il 28 Apr 2018
i'm unable to get the results using when i used for loop
Ae = sym('Ae');
cd = sym('cd');
cl = sym('cl');
clt = sym('clt');
clw = sym('clw');
ct = sym('ct');
K = 0.045;
Ve = 0;
a = 5.19;
aw0 = -2/57.3;
awr = 1/57.3;
cd0 = 0.03;
cm0 = -0.0711;
cw = 1.716;
g = 9.81;
h = 0.29;
h0 = -0.08;
ht = 2000.0976;
k = 0;
lt = 6.184;
m = 6300;
ro = 1.006;
s = 25.08;
st = 7.79;
ztw = 0.312;
Vt=(st*lt)/(s*cw);
for v=100:15:250
vi = v*0.515;
eqn = [(((2*m*g)*sin(Ae+Ve)/(ro*s))/vi^2)-ct*cos(k)+cd*cos(Ae)-cl*sin(Ae)==0, ...
(((2*m*g)*cos(Ae+Ve)/(ro*s))/vi^2)-cl*cos(Ae)-cd*sin(Ae)-cd*sin(k)==0, ...
(cm0+((h-h0)*clw))-(Vt*clt)+ct*(ztw/cw)==0, ...
cl-clw-(clt*st/s)==0, ...
cd-cd0-K*cl^2==0, ...
clw-a*(Ae+awr-aw0)==0 ];
[Ae,ct,cd,clt,clw,cl] = solve(eqn,Ae,ct,cd,clt,clw,cl);
Ae, ct, cd, clt, clw, cl
end

Risposta accettata

Walter Roberson
Walter Roberson il 28 Apr 2018
Ae = sym('Ae');
cd = sym('cd');
cl = sym('cl');
clt = sym('clt');
clw = sym('clw');
ct = sym('ct');
K = 0.045;
Ve = 0;
a = 5.19;
aw0 = -2/57.3;
awr = 1/57.3;
cd0 = 0.03;
cm0 = -0.0711;
cw = 1.716;
g = 9.81;
h = 0.29;
h0 = -0.08;
ht = 2000.0976;
k = 0;
lt = 6.184;
m = 6300;
ro = 1.006;
s = 25.08;
st = 7.79;
ztw = 0.312;
Vt=(st*lt)/(s*cw);
for v=100:15:250
vi = v*0.515;
eqn = [(((2*m*g)*sin(Ae+Ve)/(ro*s))/vi^2)-ct*cos(k)+cd*cos(Ae)-cl*sin(Ae)==0, ...
(((2*m*g)*cos(Ae+Ve)/(ro*s))/vi^2)-cl*cos(Ae)-cd*sin(Ae)-cd*sin(k)==0, ...
(cm0+((h-h0)*clw))-(Vt*clt)+ct*(ztw/cw)==0, ...
cl-clw-(clt*st/s)==0, ...
cd-cd0-K*cl^2==0, ...
clw-a*(Ae+awr-aw0)==0 ];
[Ae_,ct_,cd_,clt_,clw_,cl_] = vpasolve(eqn,Ae,ct,cd,clt,clw,cl);
display(v);display(Ae_); display(ct_); display(cd_); display(clt_); display(clw_); display(cl_);
end

Più risposte (0)

Categorie

Scopri di più su Electromagnetism in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by