Please help, the value of a function is changing with the domain.
Show older comments
I am required to create a graph of 4 different equations, y1, y2, y3, y4 shown below, where the only difference is this R value. When I start with a domain of theta going from 0-90 degrees (the first graph) you can clearly see a distinction between all 4 equations. When I change the domain from 0-180 degrees, all 4 equations result in identical outputs that overlap. It seems as I get closer to a domain of 180 degrees, the equations become more and more similar. Does anyone know what is causing this problem? Thanks in advance.
if true
R1 = 3;
R2 = 3.5;
R3 = 4;
R4 = 10;
theta = 0:1:180;
y1 = ((pi/2)*sin(theta*pi/180)*(1+ ((cos(theta*pi/180))/(((R1^2) - (sin(theta*pi/180).^2)).^0.5))));
y2 = ((pi/2)*sin(theta*pi/180)*(1+ ((cos(theta*pi/180))/(((R2^2) - (sin(theta*pi/180).^2)).^0.5))));
y3 = ((pi/2)*sin(theta*pi/180)*(1+ ((cos(theta*pi/180))/(((R3^2) - (sin(theta*pi/180).^2)).^0.5))));
y4 = ((pi/2)*sin(theta*pi/180)*(1+ ((cos(theta*pi/180))/(((R4^2) - (sin(theta*pi/180).^2)).^0.5))));
figure; hold all;
plot(theta, y1, theta, y2, theta, y3,theta, y4)
Code:

theta = 0:1:90 :

theta = 0:1:180 :

theta = 0:1:170 :

Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!