Trouble plotting 3-D graphs Vector question
Show older comments
% 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
Answers (1)
Azzi Abdelmalek
on 29 Mar 2016
0 votes
Fn and Teta are different sizes
2 Comments
Azzi Abdelmalek
on 29 Mar 2016
Edited: Azzi Abdelmalek
on 29 Mar 2016
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
on 29 Mar 2016
Categories
Find more on General Applications in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!