Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
In attached file I'm trying to plot a function of time but am getting a "Replace complex values and NaNs by real numbers". If I include units in my "t" range definition I can plot my second function. If I exclude units I can plot my first function. But not both at same time. I can't see what is wrong.
Solved! Go to Solution.
Your range for t is defined unitless!
Thats OK with the unitless function v.AB, but in d(t) you use "d0" and "velocity" with correctly assigned units. So you have also to use a range for t with units as otherwise you run into a unit mismatch as you can't add feet and feet/seconds.
Define t:=0s,10^-6 s .. 0.01 s (you have to add a time unit to all three values).
Hi Werner,
Yes, and as you will see in my attached file, when I do define the units (exactly as you describe), then the bottom plot fails. How do I correct that?
thank you
t with unit. Then bottom plot can make.
You had set up v.ab() without units, so you either change v.ab() that is uses unit (make the 60 to 60 Hz, etc.) or you have to use a unitless range for t.
On contrary you had set up d() to use units and so you either have to use a range for t with units or you divide by the unit seconds when it comes to plotting (as ppal and Terry had shown).
One of the benefits in using Mathcad or Prime is that it can handle units well and so I would recommend using correct units throughout. You may also consider using the predefined units microseconds and milliseconds:
Hi,
Distance is the integration of velocity. The velocity varies so you need to do this.
Cheers
Terry
Hi Terry - in this case my Vab is a voltage, not a distance. But, thank you.