I need to graph multiple parabolas on one plot, but when I plot the entire parabola (symmetric across the y-axis) it intersects itself.
clc;clear;close;RPM_v = [0.1,0.2,0.3,0.4,0.5];R = .05;h0 = .15;%define constants and change units
omega_v = RPM_v.*2*pi/60; %[rad/s]
g = 9.807; %[m/s^2]
r = linspace(0,R); %[m]
phi = linspace(0,2*pi); %[rad]
r_R = r./R;%PLOT
%2D figure
Fig_2 = figure('Name','Graphical Display with Ratio Measurements',... 'Units','normalized','Position',[.005,.005,.4,.5]);Axes_2 = axes('Parent', Fig_2,'NextPlot', 'add');z_v = 1;n = 1;while length(z_v) ~= 6%equation of surface
z_z0 = (h0 - omega_v(n)^2/(2*g)*(R^2/2 - r.^2))/h0 %[m]xlabel('r/R');ylabel('z/z0');title('RPM on a Height vs. Radius Graph');plot(Axes_2,[-r_R,r_R],[z_z0,z_z0]);z_v(n+1) = 1;n = n+1;endRPM_num = {'RPM = 0.1','RPM = 0.2','RPM = 0.3','RPM = 0.4',... 'RPM = 0.5'};legend(Axes_2,RPM_num);
When I just use
plot(Axes_2,r_R,z_z0);
it doesn't graph both sides of the graph. I do not know how to modify this so it displays like a normal parabola.
Best Answer