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

Not graphing correctly

cybercrypt13-di
1-Newbie

Not graphing correctly

I have an equation I'm trying to graph in Matchcad and it doesn't appear to be graphing correctly. Wanted to see if anyone could help me get this fixed.

I've attached the file and as you can quickly see from the equation, the curve is not continuous at f(4). The graph should have a jump at that point since it switches to a new equation at x>4. However, Mathcad always connects the points of all areas of the curve even if it shouldn't and if you do not pay attention it will cause you to think you are looking at something continuous that is really not.

Is there a way to get Mathcad to more correctly draw these types of graphs?

Thanks,

glenn
19 REPLIES 19

On 1/26/2007 4:02:47 PM, cybercrypt13 wrote:
== Is there a way to get Mathcad to more correctly draw these types of (discontinuous) graphs?

One way is to open up the trace dialog and select the 'point' type rather than 'line'. Mathcad will then simply plot the calculated points. You need to take care that any 'x' variable isn't too sparse.

Stuart

*XMCD limits to those using these version.
11 can't open your sheet.
Attach 11 or lower .

jmG

I can't look at your sheet at the moment, as you posted in MC13 format and I'm currently in an environment that only supports MC11.

You need to remember that Mathcad is a numeric engine. It cannot plot a function, indeed, has no idea about the mathematics of a function. When you request the plot of a function it just evaluates the function at a number of points (to Mathcad a function is just an evaluation rule) and connects the points. That will always appear as a continuous line (although it might have a very steep slope over one interval).

To actually show a disconinuity you have a number of choices. You could simply plot as points rather than lines. If you make the point x intervals small enough the points on the continuous sections will visually merge, giving the appearance of a line (although the line will be of rather poor quality).

You could plot the continuous segments as separate functions, each over their own range. Thus if your function is discontinuous at four because it if function f below four and g above four you could plot f(x) from zero to four and g(x) from four to ten. Depending on how you defined the ranges the plot at four could be eighet f(x) or g(x), or be omitted (undefined), or could even show both values (a multivalued function, which is not really a function).

You also have the option of not plotting a function but tabling the points you want to plot into a vector. You can use a NaN in the vector to cause a point, and its connecting lines, to be omitted. Using vectors for plotting you can actually plot any number of curves of any shapes (not just curves representing function) on a plot.

� � � � Tom Gutman

Sorry, Here is an v11 file

glenn

On 1/26/2007 5:13:29 PM, cybercrypt13 wrote:
>Sorry, Here is an v11 file
>
>glenn
_____________________

So, what is the quiz in there ?




jmG



... just plot points for the view .
That won't change the maths under the hood !

jmG

Thank you very much. Boy, I never realized I'd get this kind of service here. Especially not so quickly. Looks like I've found home... 🙂

Thanks a lot and have a great weekend.

glenn

I have a similar problem if someone can add to the discussion still.

 

I have a graph of values over a range of a variable and I graph a constant alongside the function. My problem is that where the two functions intersect is *not* the correct answer. The graph shows a different value of intersection from that when it is calculated in MathCAD (I also checked the calculation outside of MathCAD to be sure).

 

I've tried dividing the units of both axes and that didn't work. I can't figure out how to change the line graph to a point graph as someone else suggested. Can someone tell me why the graph is obviously wrong? 

 

The example problem does not have a jump discontinuity, both are smooth functions that are defined over the range.

 

PS I'm sorry, but I can't post an example file as my work has me under an NDA so I can't share my work with anyone.

Too bad you can't attach your worksheet or at least a picture showing the problem. Without seeing what you are doing its hard to advice.

You should try to recreate the problem in a simplified dummy sheet which does not contain any sensible, confident data.
Also you might get a better response if you open a new thread with your question.

Its also important to know which flavor of the program you are using, Prime or real Mathcad.

trip12345
4-Participant
(To:Werner_E)

I appreciate the response. I will work on making a dummy file.

I can't start my own thread as I am using the trial version so I don't have technical support. I'm looking into opensource alternatives that I can donate to with my own money (my work doesn't want to pay for a subscription just for me). I have a lot of problem solving ahead me as I am taking it on to learn the new program and play around with MathCAD while I have the free access.
ttokoro
17-Peridot
(To:trip12345)

image.pngimage.png


@trip12345 wrote:
I appreciate the response. I will work on making a dummy file.

I can't start my own thread as I am using the trial version so I don't have technical support. I'm looking into opensource alternatives that I can donate to with my own money (my work doesn't want to pay for a subscription just for me). I have a lot of problem solving ahead me as I am taking it on to learn the new program and play around with MathCAD while I have the free access.

Are you sure that you can't open a new thread in this forum? I thought the forum is free to post for anyone. Just click at "Start a topic" on the right side of the large green bar and chose any label. It doesn't matter which one as nobody cares - just be sure to post in the Mathcad area.
While its not open source you might have a look at SMath Studio which is kind of a free Mathcad clone. It does not have the full power of Mathcad in some respects (symbolic calculations, plots) but is ahead of Mathcad in others (e.g. possibility to add features like better plotting via Add-ons). SMath Studio is the only alternative to Mathcad that I know of when it comes to the scratchpad approach where you can write live working math expression at any position similar to what you would do by hand, too. Like Mathcad, Smath is also unit-aware.

 

trip12345
4-Participant
(To:Werner_E)

I tried to figure out how to post to the forums but the option is greyed out for me and when I follow the breadcrumbs to the PTC community it seems that posting to the forum is part of their "support" package. My patience is wearing thin with PTC and I've been problem solving with SMath. It's pretty close to the MathCAD 15 release and there are problems but it is free so I'll probably dedicate my time to it right now as I am making progress rewriting my old MathCAD code in that environment. I appreciate the response but it doesn't look like PTC wants freeloaders like me.


@trip12345 wrote:
I tried to figure out how to post to the forums but the option is greyed out for me and when I follow the breadcrumbs to the PTC community it seems that posting to the forum is part of their "support" package. My patience is wearing thin with PTC and I've been problem solving with SMath. It's pretty close to the MathCAD 15 release and there are problems but it is free so I'll probably dedicate my time to it right now as I am making progress rewriting my old MathCAD code in that environment. I appreciate the response but it doesn't look like PTC wants freeloaders like me.


To me it looks like PTC doesn't want Mathcad-users in general (otherwise Prime would be quite differently) but to be fair one also has to mention that they give away a limited version of Prime for free. The trial of Prime falls back in the so called "Express" mode where a lot of features are considered "premium" and are not available. Nonetheless some people might find that the basic features left are all they need.

 

But I am really surprised to hear that you are not allowed to open a new thread here in the forum.

@Jaime_Lee  can you confirm that only users with a standing maintainance/support for a PTC product are allowed to open a new thread?

Jaime_Lee
Community Manager
(To:Werner_E)

Hi, @trip12345 

 

 @Werner_E  is correct.  Maintenance agreement or no maintenance agreement, we definitely want you to share your questions and insights on this discussion forum.  I tested your account, and I was able to start a new thread.  In the Mathcad Ideas area of the community you do have to have a license agreement, but you can vote on other community member's ideas.  Great catch on the labels @Werner_E !  We do care about labels, but we haven't been doing a good job "cleaning" them up when content is moved into the Mathcad area.  We will work on this!

trip12345
4-Participant
(To:Jaime_Lee)

So yes, I can now figure out how to navigate the site to post a new discussion. But now it is not needed because I can't recreate the error I was running into when I tried to make a dummy sheet to display the problem. Somehow, I imagine it had to do with units somewhere along the way. 

 

I really like PTC 6.0 but I'm afraid I will run into problems whether I run with PTC 6.0 or an open source tool like SMath and I might as well save my very low income and invest in improving my problem solving skills instead of investing in such an expensive (and I'll admit, powerful) tool. It just doesn't make sense for me at this point in my career. I'm kicking around the idea of having someone help me pay for it but as of now the cost is the main factor in not being 100% on board with it. 

 

Again, thanks to the community for helping the noobs navigate the support.

Don't give up!

 

When Prime runs without a license (like after the 30 day free trial,) you have Prime Express.

 

Express can do two things:

  1. It can show you a complete version of a Prime file (any version less than or equal to your current version) just as it was saved from fully capable Prime.  DON'T SAVE IT AGAIN FROM EXPRESS, or all the "premium" features will be disabled.
  2. You have a (surprisingly capable) free Mathcad application.  The premium features don't work.  (What's "premium" and what's not can be puzzling.) 
  • There are no symbolics. 
  • There is no programming.  (But the old EXCEL style IF statement still works.) 
  • The new graphing app won't work.  (Have you read the discussions here about that app?) 
  • You can't embed an EXCEL sheet.  

What's "left" is a Mathcad that functions nearly as well as version 7 did but it's FREE!  And people have been finding "work-arounds" for some things that we might still need.  (There's a grid-drawing program that will give you a grid (including log plots) in the original Prime plots (cntrl-2).  

 

Express is worth keeping even if just to read other contributor's files; but it can do some fairly interesting stuff itself--you just need to be innovative!

 

Sample attached, created in Prime 4.0 Express.

Thanks for the clarification, @Jaime_Lee .

BTW, as far as I am aware nobody can vote for ideas in the Mathcad section since the forum migration. I don't think that's intentional but IMHO its not a big loss anyway 😉

Jaime_Lee
Community Manager
(To:Werner_E)

Hi, @Werner_E 

 

Ability to vote for  Mathcad Ideas  is now fixed!  Thank you for bringing this issue to our attention. 

 

Vote, vote, vote 🙂

 

 

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."