cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Plotting a tan function

ptc-4449700
1-Visitor

Plotting a tan function

Hi, I'm having an odd problem where a tan function is not plotting over the range I've evaluated it for. The function itself is working over the range, but the plot seems to stop short? See the attached sheet. Any ideas what I'm doing wrong?

Thanks, Pete.

ACCEPTED SOLUTION

Accepted Solutions

Seems to have to do with tan(pi/2), of course. Mathcad seems to have difficulties to connect points of a graph if some point are to much way out of the window (10^16) in your case.

Let the limits on the abscissa (now handset to +/-2) be chosen by mathcad automatically and enjoy a very strange "tangens" over the whole range. Chose a symbol in traces and you can see all of your twelve values.

Just realized: If you chose a symbol you see all the visible points even with your range from -2 to 2. Mathcad simply can not connect the points for some reason. Change the line type from lines to draw and it works!

Similar problem as with plotting a family of curves.

WE

View solution in original post

6 REPLIES 6

Note the typo in the description written at the top of the sheet, it is alpha and theta that are not working, whereas beta is... (this will make sense when you look at the attached sheet!). Thanks, Pete.

Strange!

It must have something to do with the step choice you made. If you disable evaluation of alpha and theta (right-click on the expression to get the menu) then the graphs complete. It's not clear why the graphs you have don't plot, but it does the same for me in Mathcad 15.0 (M010 [MC15_M010_20110622])

Seems to have to do with tan(pi/2), of course. Mathcad seems to have difficulties to connect points of a graph if some point are to much way out of the window (10^16) in your case.

Let the limits on the abscissa (now handset to +/-2) be chosen by mathcad automatically and enjoy a very strange "tangens" over the whole range. Chose a symbol in traces and you can see all of your twelve values.

Just realized: If you chose a symbol you see all the visible points even with your range from -2 to 2. Mathcad simply can not connect the points for some reason. Change the line type from lines to draw and it works!

Similar problem as with plotting a family of curves.

WE

Thanks Werner, I would have never figured this one out on my own! I've got several ideas on how to deal with this large value curve plotting issue for my real problem - I think I am going to wrap the tan function inside another function which caps the 'out of bounds' values so that I can still line plot the result.

Thanks, Pete.

Hi Valery, I'm not sure what I'm looking for on that link. I know that tan is not continuous, but the tabulated results for the ranges I've specified evaluate to a real result at every value in the range I've specified, whereas the plots (which I think should show the same results as the tabulated results) do not plot all of the results.

Thanks, Pete.

Announcements

Top Tags