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

## "Value must be real" error, simple graphing task Visitor

## "Value must be real" error, simple graphing task

Hi everyone,
&nbsp;
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
6 REPLIES 6 Opal
(in response to cjarnutowski)

## 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 Opal
(in response to cjarnutowski)

## 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 Opal
(in response to terryhendicott)

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

Hi meant to say:

Mathcad calculates right to the left and down a sheet. Opal
(in response to terryhendicott)

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

sorry finally got it right Visitor
(in response to terryhendicott)

## 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 Opal
(in response to cjarnutowski)

## 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.