Need help calculating thrust required curve

I need to calculate a thrust required curve for an aircraft to find the velocity at maximum lift-drag ratio. I keep getting errors; either it says that 'v' is undefined or that there aren't enough input arguments. No, I don't have a specific value for velocity, the curve is supposed to tell me that. Please help.
%initial data
function fval=TRc(v)
rho=1.225; %kg/m^3
s=47; %m^2
AR=6.5; %unitless
e=0.87; %unitless
w=103047; %N
cd0=0.032; %unitless
ET=40298; %N%engine thrust
PA=2*ET; %N
cl = (2*w)/(v^2*rho*s); %lift coefficient
cd=cd0+(cl^2/(pi*e*AR)); %drag coefficient
TR=w/(cl/cd); %N
PR=TR*v; %W
fval=(PA-PR)/w;
plot(v,fval);
end

 Accepted Answer

You must call TRc with a numerical input vector for v to get a plot.
v = linspace(1,20,100);
fval = TRc(v);
plot(v,fval)
function fval=TRc(v)
rho=1.225; %kg/m^3
s=47; %m^2
AR=6.5; %unitless
e=0.87; %unitless
w=103047; %N
cd0=0.032; %unitless
ET=40298; %N%engine thrust
PA=2*ET; %N
cl = (2*w)./(v.^2*rho*s); %lift coefficient
cd=cd0+(cl.^2/(pi*e*AR)); %drag coefficient
TR=w./(cl./cd); %N
PR=TR.*v; %W
fval=(PA-PR)./w;
end

More Answers (0)

Categories

Find more on Nonlinear Dynamics in Help Center and File Exchange

Products

Release

R2021b

Asked:

on 23 Feb 2023

Moved:

on 23 Feb 2023

Community Treasure Hunt

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

Start Hunting!