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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Mathcad 14.0 M020 (14.0.2.5) 2D plot questions

Ninetrees
12-Amethyst

Mathcad 14.0 M020 (14.0.2.5) 2D plot questions

I searched the collab for a clue to this because it seems that I have seen it discussed previously. Didn't strike paydirt.

I had some step plots that I was using - many of them. I got tired of resetting the index variable

i:=last(table)
x:=1 x[i:=i

so I changed to using the method in the attached file. I didn't get the result I expected.

Is there a way to get the plots I want with out having to reset the x index all the time?

Rich
http://www.downeastengineering.com/
9 REPLIES 9

Quickplot (using an undefined variable for the ordinate) is for plotting functions, not discrete values. The implied range for the ordinate is not integers, so using it as a subscript results in many errors, hence a discontinuous graph. You can use a range variable or a vector for the ordinate, but you must set it up yourself, so that the values are the integer indices for the data.
__________________
� � � � Tom Gutman

Well, that helps a lot. Thanks, Tom. It also showed me how to save some steps in the file that I am working with, so I'll make those corrections in the next day or so. I have excerpted a few items because I have a question about them: Why does the step plot work in one place and not the other? I'm guessing that I am missing some implication of your earlier post. Sorry to others for my post in M14, but I suspect that my issues are M14 questions.





Rich


http://www.downeastengineering.com/

Your issues have nothing to do with MC14 -- just the way quickplot works.

Your first graph appears to work. Your range is from 0 to 2000. Divided into 1000 steps (the way quickplot works) you get an effective step size of two. All ordinate values are integers and work as subscripts. But you are only seeing every other point.

You second plot has a much reduced range, and in a thousand parts just about none of the values are valid indices. Hence no plot.

I reiterate -- quickplot is for plotting functions, not discrete data. If you persist in attempting to use quickplot with discrete data, you will run into all kinds or errors and anomalies. Don't do it.
__________________
� � � � Tom Gutman

>Your range is from 0 to 2000. Divided into 1000 steps (the way quickplot works)

...I didn't notice the change in the graph when I pasted it into the file to be posted. I had reviewed QuickPlots before and after your post, and didn't / don't see a reference to the 1000 points, so I assumed that if I specified the limits on the x-axis then those intervals would be used for the index, rather than the -10..+10 referenced in Help, and not changed to 0..1000.

>Don't do it.
...not to fear...immediately following your first post, I changed both working files to reflect what you had said. I posted the last file because I still had questions. The process had mixed results in that I had to include simplified ranges for my plots (a plus), but then needed to add subscripts to my plot arguments (a minus). Overall worth it because it all works correctly now. I rarely use QuickPlots, so wasn't familiar with all the subtleties. Perhaps Help should declare that QuickPlots are for functions only. It is implied, perhaps: "To create a 2D QuickPlot, simply insert a plot operator, type x in the bottom placeholder, and x^2 in the left-hand placeholder." but I didn't interpret it that way. A note in Help regarding the way QuickPlots can change range intervals might be in order in light of this Help comment: "To modify the range of x in the QuickPlot, change the plot limits."

Rich
http://www.downeastengineering.com/

Yes, the limits for the implied range variable are set by the x axis limits (or default to -10 to +10. But the limits are only a part of a range variable, there is also the step size. The implied step size for quickplots is not documented (at least not that I know of), but is in fact one thousand steps.
__________________
� � � � Tom Gutman
IRstuff
12-Amethyst
(To:TomGutman)

While not documented, it can be easily verified. If you expand the plot horizontally, and turn on Trace, you can step through the default plot, and see that x increments by 0.02 per step, which is 1/1000 of the range from -10 to +10.



TTFN,
Eden
Ninetrees
12-Amethyst
(To:IRstuff)

I appreciate the comments. I have passed along to Mathcad the comments in this thread with a hope that they will find their way into future Help documents.

Rich
http://www.downeastengineering.com/

On 3/28/2010 11:02:30 AM, woodwise wrote:
...
>Is there a way to get the
>plots I want with out having
>to reset the x index all the
>time?
>
>Rich
_____________________________

YES, use my traditional discretizer.
Attach your ws 11 if you wish.

jmG


This has been logged for documentation for Mathcad 14 and 15. I don't know if the same issue is true in Mathcad Prime, since the 2D plots differ, but I will check.

Mona
Announcements

Top Tags