Filter löschen
Filter löschen

Error in Plotting The Surface graph.

33 Ansichten (letzte 30 Tage)
Shivam Bajpai
Shivam Bajpai am 24 Apr. 2022
Kommentiert: Walter Roberson am 25 Apr. 2022
clc
clear all
close all
%% Aircraft Parameters
b= 222.6664; %ft
l=247.9163; % ft
S=6200; %ft^2
CR=45.4165; %ft
CT=15.332; %ft
AR=7.3;
TR=0.34;
lamda= 25; %degree
W=650000; %pound
mach=0.77;
sound_speed=967.52; %in feet/sec
density=5.87; % in slug/ft^3
cruise_weight=650000; %in pounds
%% Wake model
b_red=(3.14/4)*b;
velocity=mach*sound_speed;
Circulation=cruise_weight/(velocity*density*b_red);
y=-0.3*b:9:0.1*b;
z=-0.3*b:9:0.1*b;
[y,z]=meshgrid(y,z);
x=2*b +zeros(10,10);
rc=5;
% %%upwash_avg
syms s
chord_length=((2*S)/(b*(1+TR))*(1-(1-TR)*(2*s)/b));
right_wing=(Circulation/(4*3.14))*((y+s)./( (y+s).^2+ z.^2 + rc.^2)).*(1+(x./sqrt(x.^2+(y+s).^2+z.^2)))*chord_length;
left_wing=(Circulation/(4*3.14))*((y+b+s)./( (y+b+s).^2+ z.^2 + rc.^2)).*(1+(x./sqrt(x.^2+(y+b+s).^2+z.^2)));
I = (1/b)*((left_wing+right_wing)*chord_length);
qwe=int(I,s,0,b);
surf( y/b,z/b,qwe)
%%Error is Showing
Error using matlab.graphics.chart.primitive.Surface
Invalid parameter/value pair arguments.
Error in surf (line 145)
hh = matlab.graphics.chart.primitive.Surface(allargs{:});
Error in research_ff (line 38)
surf( y/b,z/b,qwe)
>>

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Apr. 2022
qwe=int(I,s,0,b);
That is symbolic
surf( y/b,z/b,qwe)
surf cannot handle symbolic arguments, even if the symbols could be fully approximated as double.
You need to double(qwe) if it does not contain any free variables after integrating. If it contains free variables then fsurf()
  1 Kommentar
Walter Roberson
Walter Roberson am 25 Apr. 2022
clc
clear all
close all
%% Aircraft Parameters
b= 222.6664; %ft
l=247.9163; % ft
S=6200; %ft^2
CR=45.4165; %ft
CT=15.332; %ft
AR=7.3;
TR=0.34;
lamda= 25; %degree
W=650000; %pound
mach=0.77;
sound_speed=967.52; %in feet/sec
density=5.87; % in slug/ft^3
cruise_weight=650000; %in pounds
%% Wake model
b_red=(3.14/4)*b;
velocity=mach*sound_speed;
Circulation=cruise_weight/(velocity*density*b_red);
y=-0.3*b:9:0.1*b;
z=-0.3*b:9:0.1*b;
[y,z]=meshgrid(y,z);
x=2*b +zeros(10,10);
rc=5;
% %%upwash_avg
syms s
chord_length=((2*S)/(b*(1+TR))*(1-(1-TR)*(2*s)/b));
right_wing=(Circulation/(4*3.14))*((y+s)./( (y+s).^2+ z.^2 + rc.^2)).*(1+(x./sqrt(x.^2+(y+s).^2+z.^2)))*chord_length;
left_wing=(Circulation/(4*3.14))*((y+b+s)./( (y+b+s).^2+ z.^2 + rc.^2)).*(1+(x./sqrt(x.^2+(y+b+s).^2+z.^2)));
I = (1/b)*((left_wing+right_wing)*chord_length);
qwe = vpaintegral(I, s, 0, b);
whos
Name Size Bytes Class Attributes AR 1x1 8 double CR 1x1 8 double CT 1x1 8 double Circulation 1x1 8 double I 10x10 8 sym S 1x1 8 double TR 1x1 8 double W 1x1 8 double b 1x1 8 double b_red 1x1 8 double chord_length 1x1 8 sym cruise_weight 1x1 8 double density 1x1 8 double l 1x1 8 double lamda 1x1 8 double left_wing 10x10 8 sym mach 1x1 8 double qwe 10x10 8 sym rc 1x1 8 double right_wing 10x10 8 sym s 1x1 8 sym sound_speed 1x1 8 double velocity 1x1 8 double x 10x10 800 double y 10x10 800 double z 10x10 800 double
surf( y/b, z/b, double(qwe))

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by