cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Solver Block Problem

Suki
10-Marble

Solver Block Problem

Hi Guys, 

 

I am trying to use solver block to find 2 variables. The solver says the solution cannot be found even though the solution exists. Please help me out by checking the constraints.

 

Thanks,

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Suki)

For better clearness the solve block should only contain the guess values, equations to solve and constraints. All the rest outside and above.

You have three equations but want to solve for two variables only. This may work, but most of the time doesn't. In your case it doesn't. Prime will only find a solution if I disable one of the equations and also one of the constraints:

Werner_E_0-1673123056001.png

Using all equations and constraints works if you use "minerr" instead of "find":

Werner_E_2-1673123195911.png

 

 

 

 

View solution in original post

3 REPLIES 3
Werner_E
25-Diamond I
(To:Suki)

For better clearness the solve block should only contain the guess values, equations to solve and constraints. All the rest outside and above.

You have three equations but want to solve for two variables only. This may work, but most of the time doesn't. In your case it doesn't. Prime will only find a solution if I disable one of the equations and also one of the constraints:

Werner_E_0-1673123056001.png

Using all equations and constraints works if you use "minerr" instead of "find":

Werner_E_2-1673123195911.png

 

 

 

 

Suki
10-Marble
(To:Werner_E)

Thanks Werner, what is the difference between find and minerr function? When shall I use each of them?

why does the find function unable to solve the problem?

Werner_E
25-Diamond I
(To:Suki)

"find" tries to find a solution (within a certain tolerance) which fulfills ALL equations and constraints.

"minerr" tries to find values where the sum of (squared) errors with respect to the equations and constraints is minimized. Usually no equation/constraint is exactly fulfilled exactly. So its no problem if you demand more equations than variables to be "fulfilled".

From the help:

minerr differs from find or minimize in that, if the chosen algorithm fails to converge, whatever answer found on the last allowable iteration is returned, even if it doesn't meet the convergence criteria. If convergence occurs, then minerr returns the same results as find.

 

See: https://support.ptc.com/help/mathcad/r8.0/en/index.html#page/PTC_Mathcad_Help/system_of_equations_functions.html#wwID0ETSC5

 

BTW, one of your constraints seems to be hard to fulfill:

Werner_E_0-1673134484780.png

 

Announcements

Top Tags