Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hi - in the attached Prime 9 worksheet my last line (solving for the only unknown, L subscript 4) hangs. The variable L subscript 4 is the only unknown in the equation. Is there a better way to solve for it than what I'm doing here?
thanks,
russ
Solved! Go to Solution.
Ah, I just found the reason why the symbolic solve did not work for L4.
The reason is the angle you defined in degree. Primes symbolics does not know anything about units and so "deg" is treated as an unknown variable which makes solving symbolically quite difficult.
You can fix this by (re)defining the unit deg somewhere at the top of the sheet (at least in front of the first usage of "deg"):
Now the symbolics will also solve for L4 as fast as for the other variables.
Nonetheless I still think that using numeric methods should be used if all you look for is a numeric value.
A word of caution: You are using the "float" modifier in your symbolic evaluations. Please note that this does not only affect the display of the result but also the precision of the whole calculation.
Give it a try. After the definition of my function fun evaluate fun(L.4)= you will get a result a little different from zero. Now change "float, 6" to something like "float,26" and you will see that fun(L.4) now evaluates to zero!
Prime 9 file attached
As you are just looking for a numeric result, it might be better to use Primes numeric methods rather than the symbolics.
The disadvantage of doing so is that you either have to provide a guess value or a range where the solution is expected.
I found that your equation is not very sensitive with respect to the guesses as probably any positive guess value will yield the desired result.
See the attached Prime 9 file for three different methods to get the desired value.
Ah, I just found the reason why the symbolic solve did not work for L4.
The reason is the angle you defined in degree. Primes symbolics does not know anything about units and so "deg" is treated as an unknown variable which makes solving symbolically quite difficult.
You can fix this by (re)defining the unit deg somewhere at the top of the sheet (at least in front of the first usage of "deg"):
Now the symbolics will also solve for L4 as fast as for the other variables.
Nonetheless I still think that using numeric methods should be used if all you look for is a numeric value.
A word of caution: You are using the "float" modifier in your symbolic evaluations. Please note that this does not only affect the display of the result but also the precision of the whole calculation.
Give it a try. After the definition of my function fun evaluate fun(L.4)= you will get a result a little different from zero. Now change "float, 6" to something like "float,26" and you will see that fun(L.4) now evaluates to zero!
Prime 9 file attached
Outstanding, It seems like Prime should know the difference between my formatted result with deg, and the actual value. Regardless, thank you very much.
Also, thanks for the clarification on float!!
You can solve the equations fully symbolically and then fill in the numbers so as to not loose precision. It starts with:
The above should result in a large expression, and gives two solutions, apparently you want the (most) positive result.
Then you can fill in the numbers and calculate the result and the data for the next iteration:
Then solve the following:
and calculate the result and the data for the next iteration:
Then solve the following:
and calculate the result:
etc.
Succes!
Luc