Trouble plotting 3-D graphs Vector question
古いコメントを表示
% density
p=1000
% Diameter
D=0.2
% Area
A=(pi*D^2)/4
%facility velocity
T = 5
%time
t=[0:0.01:T]
Omega= 2* pi/T
Umax=1.89
Um=Umax*sin(Omega*t)
% Acceleration
syms Omega t T
T = 5
Omega= 2* pi/T
t=[0:0.01:T];
dUm= gradient(sin(Omega*t),0.01)
%Inertia
Ci=2.9
%Drag
Cd=1.25
%------------- Lift
CL=1.2
FDrag= 0.5*D*p*Cd*Um.*abs(Um);
Finertia = Ci*A*p*dUm;
FLift= CL*0.5*p*D*Um.*Um;
Fn= Finertia+FDrag;
The code works fine from this point, whilst an error appear the last part of the code:
Theta = [0:1:90]
Fmaax= Fn.*cos(Theta)+FLift.*sin(Theta)
figure (1)
plot3(t,Fmax,theta)
plot3('max force', 'time', 'theta')
Error using .* Matrix dimensions must agree.
Error in FORCEMAX Fmaax= Fn.*cos(Theta)+FLift.*sin(Theta)
Using the code above
I have been having problems with this code all morning, any help will be appreciated. I would like to produce a 3-D plot, I am able to produce 2-D plot using the time matrices against the force for all types of forces but I am having trouble plotting a 3-D plot.
I am looking to work out the maximum force at which a combination of Fn and Flift because that will be the true maximum force, due to Fn being a horizontal vector and Flif vertical vector. How would I go about using the 3D plot.
The aim is to find the maximum force along theta
回答 (1 件)
Azzi Abdelmalek
2016 年 3 月 29 日
0 投票
Fn and Teta are different sizes
2 件のコメント
Azzi Abdelmalek
2016 年 3 月 29 日
編集済み: Azzi Abdelmalek
2016 年 3 月 29 日
To correct this you can write:
Theta=linspace(0,90,numel(Fn))
Fmax= Fn.*cos(Theta)+FLift.*sin(Theta)
figure (1)
plot3(t,Fmax,Theta)
eddy
2016 年 3 月 29 日
カテゴリ
ヘルプ センター および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!