Get Help

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- "Value must be real" error, simple graphing task

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-24-2017
06:27 PM

10-24-2017
06:27 PM

"Value must be real" error, simple graphing task

Hi everyone,

I am attempting to plot one column vector against another (one contains my x values and the other contains my intended y values). I embedded an excel sheet into mathcad and added units to the data. When trying to plot two vectors of the same length, I get "value must be real" error. There is nothing complex in my calculations. Im sure this is something simple, please help!

Thanks,

Chris

I am attempting to plot one column vector against another (one contains my x values and the other contains my intended y values). I embedded an excel sheet into mathcad and added units to the data. When trying to plot two vectors of the same length, I get "value must be real" error. There is nothing complex in my calculations. Im sure this is something simple, please help!

Thanks,

Chris

Labels:

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-25-2017
12:05 AM

10-25-2017
12:05 AM

Re: "Value must be real" error, simple graphing task

Hi,

You have done everything right bar a subtle position error.

Mathcad calculates to the left and down a sheet. The graph was above the position where displacement was calculated.

Move you graph down and it calculates.

Cheers

Terry

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-25-2017
12:06 AM

10-25-2017
12:06 AM

Re: "Value must be real" error, simple graphing task

Hi,

You have done everything right bar a subtle position error.

Mathcad calculates to the left and down a sheet. The graph was above the position where displacement was calculated.

Move you graph down and it calculates.

Cheers

Terry

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-25-2017
12:14 AM

10-25-2017
12:14 AM

Re: "Value must be real" error, simple graphing task

Hi meant to say:

Mathcad calculates right to the left and down a sheet.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-25-2017
12:16 AM

10-25-2017
12:16 AM

Re: "Value must be real" error, simple graphing task

Mathcad calculates left to right

sorry finally got it right

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-26-2017
07:30 PM

10-26-2017
07:30 PM

Re: "Value must be real" error, simple graphing task

Hi guys,

Thanks for catching the position thing. Still having some weird results. When I graph voltage vs. displacement, my voltage values are scaled up such that they range from 52.6 to 85.5. If I graph (voltage/volts) vs displacement, I get the data as expected. Why would the unit of volts scale my graph? Do I always need to divide out the units before graphing?

Thanks, Chris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-26-2017
09:11 PM

10-26-2017
09:11 PM

Re: "Value must be real" error, simple graphing task

I think it's a bug.

If you graph something it will plot in the default units for the worksheet, which you have set to US units. An example is your x-axis, which is plotted in feet. If you want to see it in inches, you need to divide the variable by that unit. You see the same thing if you simply evaluate the vector "Displacement", but then you do get to see the units, whereas on a graph you don't. As such, it's good practice to always divide by the unit when graphing. Then you know what the units are on each axis.

That does not explain the problem you are seeing though, because Mathcad only has one unit for voltage, volt (or V, which I will note that you have overwritten by defining a variable of that name). If you evaluate the vector it shows the correct values, with units of volt, but if you graph it the values are scaled by 23.7303604. I have no idea where that number comes from.

If you change the unit system to SI, the problem goes away.