Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: 'Plot3' command won't plot 3D
Replies: 1   Last Post: Apr 25, 2014 4:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Edward

Posts: 3
Registered: 4/3/14
'Plot3' command won't plot 3D
Posted: Apr 3, 2014 1:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hi,

I am currently trying to plot a 3d graph of the maximum responses for a system excited by a half-sine pulse for different values of zeta. The plot works in 2D but I would like to plot it in 3D with the x axis as the time period ratio T/tau, the y axis as maximum response ymax and the z axis as zeta. Here is my current script:

clear all

m=1;%mass
F0=1;
wn=1;%natural period of oscillator
for T=0:0.1:20 %period of pulse
T;
tau=(2*pi)/wn; %natural period of oscillator
zeta=[0 1 2 3 4 5]; %damping factor
dT=0.01; %sampling period
N=3000; %number of samples

for j=1:N,
if j<=T/dT+1;F(j)=F0*sin((dT*pi*(j-1))/T);%halfsine pulse
else F(j)=0;
end


end

for i=1:length(zeta),
wd=sqrt(1-zeta(i)^2)*wn; %damped natural frequency of oscillator
n=[1:1:N];
g=(dT/(m*wd))*exp(-(n-1)*zeta(i)*wn*dT).*sin((n-1)*wd*dT);%discrete-time impulse response
c0=conv(F,g); %convolution sum
c1=c0(1:N);
ymax=max(c1);

hold on

plot3(T,ymax,zeta,'.');

end
end



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.