Skip to main content
10-Marble
November 13, 2025
Solved

Symbolic function error

  • November 13, 2025
  • 3 replies
  • 607 views

Hi, I'm having trouble finding the value of a variable using symbolic operations. Let me explain:
I want to find the variable (theta) of a symbolic function within a range of values

pannus0_0-1763029785126.png

I'm using Mathcad 11

Best answer by Werner_E

Prime's symbolic engine is not as capable as you would like it to be.

It simply is not capable enough to solve your equation the way its defined and that has nothing to do with the "assume" modifier (which is ignored by the symbolics ever so often anyway).

It also can't solve the equation if you try to do it before defining the variables (which would be a justification for using the symbolics and not a numeric method) and it can't solve it after the variable definitions if the variables are defined with units (even though your equation only requires to cancel unit "m" on both sides).

It also does not help to turn on the calculation option "Units/Constants in Symbolics" (which always should be done anyway).

But Prime is at least capable to solve the equation if you remove the units yourself manually:

Werner_E_0-1763044646568.png

But I fully agree with Alan that symbolic "solve" is the wrong tool use here. It's not just because your problem simply doesn't require a symbolic solution, but also because the symbolic in Prime is not capable enough.

For example is 1.4575 the only solution the symbolics ever will find. It is unable to find, let's say, a solutions greater than 2:

Werner_E_1-1763045028542.png

let alone all solutions

Werner_E_2-1763045661480.png

 

Alan already had shown the way to go. For finding a numerical solution you should use a numerical method.  In Prime, this is either a solve block with “find,” the ‘root’ function with a guess value, or the “root” function with an interval provided..

Alan just made a sign error when defining the function f which is the reason his function has no solution in the interval [1; 2]

Werner_E_3-1763045843970.png

When providing an interval  the interval limits must be chosen carefully, as the function values at these points must have different signs.
To get the solution 4.2..., the interval [4; 5] is therefore unsuitable, but using [4; 4.5] works.

Werner_E_1-1763046716379.png

 

If you use the "root" function with a guess, there is no guarantee that the solution found is always near the guess value

Werner_E_0-1763047474396.png

 

When using a solve block with "find" you also have to provide a guess. A solve block takes up more space and looks quite ugly in Prime, but it has the advantage that you can use the equation as it is and furthermore you can add constraints like 1<=theta<2 which may (!, no guarantee) give you the desired solution even if you provide an inappropriate guess value

Werner_E_1-1763047699792.png

 

 

3 replies

19-Tanzanite
November 13, 2025

You can see from the graphs below that there is no solution in the range from 1 to 2.  

Also, there is little point in using a symbolic solver for a purely numerical solution.

 

Graph.png

 

Alan

Werner_E25-Diamond IAnswer
25-Diamond I
November 13, 2025

Prime's symbolic engine is not as capable as you would like it to be.

It simply is not capable enough to solve your equation the way its defined and that has nothing to do with the "assume" modifier (which is ignored by the symbolics ever so often anyway).

It also can't solve the equation if you try to do it before defining the variables (which would be a justification for using the symbolics and not a numeric method) and it can't solve it after the variable definitions if the variables are defined with units (even though your equation only requires to cancel unit "m" on both sides).

It also does not help to turn on the calculation option "Units/Constants in Symbolics" (which always should be done anyway).

But Prime is at least capable to solve the equation if you remove the units yourself manually:

Werner_E_0-1763044646568.png

But I fully agree with Alan that symbolic "solve" is the wrong tool use here. It's not just because your problem simply doesn't require a symbolic solution, but also because the symbolic in Prime is not capable enough.

For example is 1.4575 the only solution the symbolics ever will find. It is unable to find, let's say, a solutions greater than 2:

Werner_E_1-1763045028542.png

let alone all solutions

Werner_E_2-1763045661480.png

 

Alan already had shown the way to go. For finding a numerical solution you should use a numerical method.  In Prime, this is either a solve block with “find,” the ‘root’ function with a guess value, or the “root” function with an interval provided..

Alan just made a sign error when defining the function f which is the reason his function has no solution in the interval [1; 2]

Werner_E_3-1763045843970.png

When providing an interval  the interval limits must be chosen carefully, as the function values at these points must have different signs.
To get the solution 4.2..., the interval [4; 5] is therefore unsuitable, but using [4; 4.5] works.

Werner_E_1-1763046716379.png

 

If you use the "root" function with a guess, there is no guarantee that the solution found is always near the guess value

Werner_E_0-1763047474396.png

 

When using a solve block with "find" you also have to provide a guess. A solve block takes up more space and looks quite ugly in Prime, but it has the advantage that you can use the equation as it is and furthermore you can add constraints like 1<=theta<2 which may (!, no guarantee) give you the desired solution even if you provide an inappropriate guess value

Werner_E_1-1763047699792.png

 

 

pannus010-MarbleAuthor
10-Marble
November 16, 2025
Spoiler

 Dear Werner_E and Alan, thank you for your responses.

I understand that the best option is to perform the operation using a solver block; however, for this example, I wanted to find the value using a symbolic operation, which led me to the following question:

1.-In example 01, I perform this symbolic operation with its units, and the Prime program solves it.

pannus0_2-1763257017582.png

 I believe this is because in this example there is only one variable, D, that needs to be found.

2.-In example 02, I perform this symbolic operation and it shows me the error.

pannus0_5-1763258216822.png

3.0 I should add to Werner_E's answer that the units can be turned off using the SIUnitsOf(e) and SIUnitsOf(R) functions.

pannus0_3-1763257946375.png

 



 

25-Diamond I
November 16, 2025

Spoiler?? Why?

And which "question" are you referring to? I can see no question in the picture you post.

Furthermore you should be very careful when using the "float" modifier. Its not just for display but it affects the precision of the whole calculation which is done just with rounded values!

19-Tanzanite
November 15, 2025

"Alan just made a sign error when defining the function f ..."

 

Oops! Apologies, that was careless!

 

Alan