Skip to main content
8-Gravel
March 22, 2023
Solved

Solve Block maximum value solution with multiple dependent variables

  • March 22, 2023
  • 1 reply
  • 2851 views

I would like to solve a non-linear equation for the maximum value.  The equation has 2 dependent variables and the solution represents the maximum value for a given number of independent variables. (see equations below).

 

The dependent variables are initialized at the start of the solution and the largest values of Ka and Kp are calculated for the independent variables.

 

I will try the solve block solution with 2 guess variables and see how the results compare to the published solutions.  I would appreciate comments/suggestions if there are other methods of solving the equations.  

 

wbell_0-1679500065030.png

 

Best answer by Werner_E

Based on the published solution, the maximum value of the function for the given inputs should be in the range of 2.56 - 15.73

And you got a value of approx. 2000. That means that "maximize" did a good job, doesn't it?

 

Which version of Prime the file was created in? After recalculation in Prime 9 I get an error message because maximize was used the wrong way. K.p is a constant (6.02) and you used it as a function. Actually  I wonder why this worked in any version of Prime, but obviously it did.

Correct way is to define the function in front of the solve block and use the function there.

As you can see in the pic below we get an even larger result if the values from the solve block are used in their full stored precision:

Werner_E_0-1680093282810.png

 

I have not looked in your sheet in detail and have not checked if you retyped the function definition correctly - maybe it would be worth doing so ...

 

1 reply

25-Diamond I
March 22, 2023

As you describe it it look s to me that a solve block seem to be the way to go.

You have to be aware that sometimes, depending on the nature of the equations, a solve block can be very sensible with respect to the the initial guess values.

If you experience trouble feel free to ask again but don't forget to attach your worksheet as well

wbell8-GravelAuthor
8-Gravel
March 29, 2023

The attached worksheet (page 2) solves the equation from the initial post, but it does not appear to be for the maximum value of the function.  For example, using different guess values and solving with the maximize function yields different results.  Based on the published solution, the maximum value of the function for the given inputs should be in the range of 2.56 - 15.73 (8.00 for the example) ; however, the function value using the dependent variables in the worksheet is orders of magnitude greater than the solution.  I will try adding a Solve block constraint restricting the range of values for the dependent variables to see if the solution can be restricted to the specified range. 

 

I am also including the section from the text for information.

Werner_E25-Diamond IAnswer
25-Diamond I
March 29, 2023

Based on the published solution, the maximum value of the function for the given inputs should be in the range of 2.56 - 15.73

And you got a value of approx. 2000. That means that "maximize" did a good job, doesn't it?

 

Which version of Prime the file was created in? After recalculation in Prime 9 I get an error message because maximize was used the wrong way. K.p is a constant (6.02) and you used it as a function. Actually  I wonder why this worked in any version of Prime, but obviously it did.

Correct way is to define the function in front of the solve block and use the function there.

As you can see in the pic below we get an even larger result if the values from the solve block are used in their full stored precision:

Werner_E_0-1680093282810.png

 

I have not looked in your sheet in detail and have not checked if you retyped the function definition correctly - maybe it would be worth doing so ...