Why does this matrix have zeros for all but one of the numbers?
Mostra commenti meno recenti
So I am trying to solve a differential equation in Matlab so that I can plot how x will vary with the variable I have named thrustloading, In trying to do so I have tried to define a, b and c for the general form of the differential equation, where b and c are constant and a varies with the thrustloading. I have defined thrustloading as a 31x1 matrix ranging from 0 to 3 in increments of 0.1, when I put this into the equation for a the output is a 1x31 matrix but all of the values in this matrix are zero except for the last one but from calculating by hand none of these should be zero. any ideas on what I need to do to get this to solve correctly? my code and the values for a I obtain are below:
>> clear,
thrustloading = transpose(0:0.1:3);
delta = 1;
theta =1.0849;
CLmax=2.4;
kto=1.2;
friction=0.07;
Cdr=0.1;
Cd0=0.014;
K1=0.0375;
Mto=0.1;
tr=3;
beta=1;
gamma=1.4;
TR=1.087;
g=9.81;
sigma = delta/theta;
theta0=theta*(1+((gamma-1)/2)*Mto^2);
delta0=delta*(1+((gamma-1)/2)*Mto^2)^(gamma/(gamma-1));
density=1.225*sigma;
alpha=delta0*(1-0.49*(sqrt(Mto)));
CL=CLmax/kto^2;
Cd=(K1*CL^2)+Cd0;
XI=Cd-friction*CL;
a=-(beta/(sigma*density*g*XI))*log(1-XI/ ...
((((alpha/beta)*thrustloading)-friction)*CL))
b=tr*kto*sqrt(2*beta/(sigma*density*CLmax))
c = 3048
value for a is:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0236722117939133
1 Commento
Callum Jackson
il 5 Feb 2015
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Linear Algebra in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!