Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi!
Assume the following simple equations, which I want first to define x=b+5 and later solve the second equation for b.
How can I do that?
The same question when we add units as well. Here, I think I need a symbolic variable (a) defined first and then solve Z for a to find the a.
Any help is much appreciated.
Solved! Go to Solution.
You should always attach your sheet as well, not just the pictures and it makes sense to say which version of Prime you are using (I tend to overlook the info in the subject ;-)!
Here are a few ways to deal with your first example:
Unfortunately
which is prohibiting!
By the way, questioners here are expected to come back and close the threads they opened.
-> Solve equation with/without units - PTC Community
You should always attach your sheet as well, not just the pictures and it makes sense to say which version of Prime you are using (I tend to overlook the info in the subject ;-)!
Here are a few ways to deal with your first example:
Unfortunately
which is prohibiting!
By the way, questioners here are expected to come back and close the threads they opened.
-> Solve equation with/without units - PTC Community
Your second problem has to do with Primes buggy and faulty auto-labeling. As can be seen in your screenshot, some of the units (m, s) are not blue which means they are not considered being units. This makes the numeric evaluation at the end fail because this s and m are considered unknown variables. The wrong different labeling of the two "s" is also the reason why Prime does not cancel the seconds.
So far there is no fix for this known bug, just a few workarounds which you can try - they may help or may not 😞
In the calc options you should check the option to use units and constants in symbolics.
Sometimes it helps to manually re-label the units in the definitions as being units.
Sometimes it helps to retype the one or other expression
You may also try to add "substitute, m=m" in the symbolic evaluation. The first m should be labeled as "Variable", the second as "Unit".
Good luck!
In case you wonder why the sine is not numerically evaluated - this is because Primes symbolics does not know anything about units and treats them as unknowns. If you want the symbolics to evaluate the sine, you have to define deg:=pi/180 somewhere at the top of the sheet (deg should be labeled as unit).
And in case you wonder why Primes symolics automatically switch to float mode and show 0.6666666.. instead of the exact 2/3. This is because of the number 1.4 you used in the definition of Z and the 0.0005 for B. As soon as just one single floating point number is involved, the symbolics switch completely in float mode. A nasty habit. You can avoid it in your example if you use 14/10 (or 7/5 of course) instead of 1.4 and 5/10000 instead of 0.0005.
Thank you so much for your swift reply.
I tried your suggestions for the second problem, but couldn't manage!
would you please attach your sheet please?
Thanks again.
@S1 wrote:
Thank you so much for your swift reply.
I tried your suggestions for the second problem, but couldn't manage!
would you please attach your sheet please?
Thanks again.
Sorry, I had not kept/saved the sheet. And even if I would had done so, you would not be able to open it as it was done in Prime 9.
I can only suggest that turn on the usage of units/constants in symbolics and then retype all assignments and expressions from scratch. Often this helps as the erroneous auto-labeling most often happens when using the symbolics and when editing expressions back and forth. Other options you may try (relabel units, usage of substitute,s=s,m=m were already mentioned above. No guarantee be if you play around you may have success.
Of course the preferred way should be to avoid the symbolics and use Primes numeric solvers (root function or a solve block with find). And to express that one quantity is dependent on another we should use functions.
Prime 9 worksheet attached 😉
EDIT: BTW, I just tried to symbolically solve the equation using this functional approach and ran into the wrong auto-label bug.
I placed the cursor in every unit (s, m, deg) in the definition of C, B and theta and pressed Ctrl-U to label it as unit manually. And voila, the symbolic eval worked and could be followed by a numeric one.
Werner's sheet converted to Prime 6.
Success!
Luc
If you have this error, Put the two definitions before it.
Then you can get.