Skip to main content
4-Participant
January 19, 2024
Solved

Liniar and Non-Liniar Programming

  • January 19, 2024
  • 1 reply
  • 1175 views

Hello, Again.
Im trying to optimize a couple systems,one liniar and two others non-liniar.
Right now i have a liniar programming problem with 7 decision variables and variables and 3 restraints, how ever i have no idea how to implement a simplex algorithm. Tried using the solve block but i failed

MN_10921447_0-1705690581371.png

 

Best answer by Werner_E

You forgot to provide the objective function. When you use "minimize" you sure have to tell Prime what you want to be minimized.

As an example I assumed that you want the expression you tried to evaluate at the top of the solve block to be minimized.

So define that expression as a function of the seven variables and use it as the first argument in minimize(f,...).

Werner_E_0-1705694773676.png

In case you want all values to be positive, you would have to add this as a constraint:

Werner_E_1-1705694891020.png

There still are some negative values in the solution but they are very close to zero. See it as numerical inaccuracies.

In case this is not acceptable, you can "weight" the condition by demanding that, lets say 1000 times the values must be greater than zero

Werner_E_2-1705695037493.png

 

Concerning the algorithm used there is not much documentation but Prime sure does not make use of the simplex method.

Only reference to the algorithms used is a small chapter in the help: https://support.ptc.com/help/mathcad/r9.0/en/#page/PTC_Mathcad_Help/solvers_from_KNITRO.html

 

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
January 19, 2024

You forgot to provide the objective function. When you use "minimize" you sure have to tell Prime what you want to be minimized.

As an example I assumed that you want the expression you tried to evaluate at the top of the solve block to be minimized.

So define that expression as a function of the seven variables and use it as the first argument in minimize(f,...).

Werner_E_0-1705694773676.png

In case you want all values to be positive, you would have to add this as a constraint:

Werner_E_1-1705694891020.png

There still are some negative values in the solution but they are very close to zero. See it as numerical inaccuracies.

In case this is not acceptable, you can "weight" the condition by demanding that, lets say 1000 times the values must be greater than zero

Werner_E_2-1705695037493.png

 

Concerning the algorithm used there is not much documentation but Prime sure does not make use of the simplex method.

Only reference to the algorithms used is a small chapter in the help: https://support.ptc.com/help/mathcad/r9.0/en/#page/PTC_Mathcad_Help/solvers_from_KNITRO.html

 

4-Participant
January 19, 2024

Thank you for the response, i will try it out tomorrow in the morning and get back to this forum with whatever hurdle i come across with the non-liniar problems