Skip to main content
10-Marble
June 2, 2025
Solved

Solution was not found. What tools/options can I use to try and make it solve?

  • June 2, 2025
  • 3 replies
  • 3307 views

I am trying to solve this equation without success so far

 

CN_13593194_0-1748891029907.png

 

am I missing something here or the equation simply does not have a solution?

mathcad prime 9.0.0.0

thanks!

Best answer by Werner_E

"idx2val" is a function I wrote.

The "match" function returns a vector consisting of 1 or more 2x1 vectors which contain row and column of the position the value was found. "idx2val" uses such a 2x1 vector as input and returns the corresponding alpha and phi value.

The function definition is to the right of the right margin so you may have  to switch from "page view" to "draft view" to see it.

Werner_E_0-1749062502161.png

The function definition could also be seen in the screenshot I posted here: Link to reply

 

EDIT: The zero after "Match" is not a function argument so it does not appear in the argument list. Simply type an opening square bracket after the closing parenthesis in "match(....)" which is the keyboard shortcut for a vector/matrix index

Werner_E_1-1749063064941.png

 

3 replies

25-Diamond I
June 2, 2025

You will have to define BB as a function of alpha to be able to take the derivative with respect to alpha.

I can't check if Prime will be able to give you a symbolic solution for the zero(s) of the derivative (phi, L, p and Mu are undefined) because I am limited to Prime express which does not allow for symbolic operations.
Usually the symbolics ignores the assume modifier or even chokes on it.

Do you really need a symbolic solution?

If you can provide values for the undefined variables you may use the numeric "root" function or a solve block with "find" to get a numeric solution.

 

BTW, the symbolics does not know anything about units and so it also does not know about the pseudo-unit 'deg'.

But you can tell the symbolics what 'deg' means by writing

Werner_E_1-1748893165960.png

somewhere at the top of the sheet maybe on the right hand not printable side or in a collapsed area. 'deg' should be labelled as "Unit" for consistency.

Did you realize that in your assume-modifier you used 'psi" but 'psi' does not appear at all in the function definition of BB. Probably you meant 'phi'.  But as already written I doubt that the symbolics will respect that assume-modifier at all.

'phi' appears  cos(phi) but also outside a trig function at the end - is this as it should be? But I guess its value does not matter anyway if you solve for alpha. But then, I doubt that Prime will be able to find a symbolic solution anyway.

 

EDIT: I have to correct what I had written. It its not mandatory to define BB as a function of alpha (although it would certainly be good style to do so). It would work OK the way you did as well. So if Prime comes up with "no solution found", it could either mean that no solution exists or that Primes symbolics is not capable enough to find it. In your case, I suspect that the derivative actually has no zeros.

 

netoprax10-MarbleAuthor
10-Marble
June 3, 2025

Thank you, still a lot of useful information here

 

maybe, what if I was to rephrase the problem and instead of finding the zeros (which, from the figure that the other reply posted, doesnt seem to exist if I am looking at it correctly) instead I wanted to find the value of alpha and psi that results in the lowest value of BB? that is what i am trying to achieve here. I dont need to do it symbolically btw. Any input is appreciated.

ttokoro
21-Topaz I
21-Topaz I
June 2, 2025
netoprax10-MarbleAuthor
10-Marble
June 3, 2025

thank you for sharing this..what I am trying to achieve is to find the value of alpha and psi that results in the lowest value of BB

I dont need to do it symbolically btw. If you have any advice that would be great.

25-Diamond I
June 3, 2025

So your function BB should be a function dependent on TWO arguments, alpha and phi? Is this correct?

Then a partial derivative wrt alpha would not have given you the desired extremum.

You would have to solve the system you get when you set zero both partial derivatives (wrt alpha AND wrt phi).

 

If you don't need a symbolic solution you sure can try to numerically solve the above mentioned system.
But you would have to provide numeric values for L, M.u and p ! 

Guess they should not all equal to 1 as ttokoro had chosen in the absence of a specification from you.

Once you provide numeric values, a solve block with "find" should be able to find a solution.

 

Another way would be kind of brute force. Create a matrix using a more or less dense net of alpha and phi values and use the "min" function to fund the minimum of all values. To get the indices of the corresponding alpha and phi values you could use the "match" function.
But again - this is a numeric approach and you would need to provide numeric values for the three unknowns.

 

A further option is to use the "minimize" function on function BB. You may use it in a solve block so you can add the additional restrictions for alpha and phi. Of course you still need values for L, p and M.u.

 

An additional problem is that your function BB may also return non-real values and you have to decide what to do with them.
If you want them to be ignored by 'minimize' and 'min' you may define and use a function which sets non-real values to a very high value, like

Werner_E_1-1748982524671.png

To avoid having to evaluate BB2 twice you may use a local variable to store it.

Here in MC15

Werner_E_2-1748982610368.png

 

25-Diamond I
June 5, 2025

Finally here is a generic function for finding the minimum of a function in two variables by brute force.

Arguments are:

1) the function in question (should be unit-less in arguments and result)

2) a 2x1 vector with the low and high bounds of the first function argument ("x")

3) a 2x1 vector with the low and high bounds of the second function argument ("y")

4) either a 2x1 vector with the grid line numbers in x- and y-direction or a single scalar which is then used for both directions

5) a number which determines how often the algorithm should run. With each run only the small space around the minumum found in the previous run is considered, so this number indicates how far we zoom in. If the number is 1 the result is similar to what we had achieved so far by creating a matrix and using the min function.

 

To save memory the program does not create huge matrices and uses min on them but rather cycles through the grid, calculates the function value and keeps the smallest so far.

 

Examples show that its still important to use a larger number for the grid size because if the first grid misses the local min, further zooming in will not bring it back again. Its also quite sensible with respect to the grid number. 499 might give a good result while 500 may return a value not that good.

So experimenting and trial and error still applies.

 

Here is the function

Werner_E_0-1749148265675.png

And here some usage examples

Werner_E_1-1749148572759.png

 

MC15 sheet attached, the function is on the last page