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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Help with Minimize optimization

JasonC
1-Visitor

Help with Minimize optimization

Hello,

Attached is a short sheet with a Minimize function. I'm getting a "variable undefined" error.

Can anyone help?

TIA

ACCEPTED SOLUTION

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

The problem is the inline evaluation after minimize() in combination with different units. This would force Mathcad to display a vector with two values of different dimensions and unfortunately thats something Mathcad is not capable of.

You have to assign the result of minimize a 2x1 vector of two variables ro make it work:

1.png

View solution in original post

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

The problem is the inline evaluation after minimize() in combination with different units. This would force Mathcad to display a vector with two values of different dimensions and unfortunately thats something Mathcad is not capable of.

You have to assign the result of minimize a 2x1 vector of two variables ro make it work:

1.png

JasonC
1-Visitor
(To:Werner_E)

Thanks!!

Now for the next step, I want to plot Vscc (which Minimize finds), vs. Vor.

Attached is my attempt to create a function that calls Minimize... it doesn't work.

Werner_E
25-Diamond I
(To:JasonC)

You can't use a solve block in a program. You'd rather turn the solve block into a function.

As this function would have to return a vector with two different dimensions (which is not possible im Mathcad) we have to get rid of the units here. Furthermore turning minimize and maximize into a function with a variable argument of the objective function can be quite tricky. The order of the arguments matters and in the objective function the parameter to be varied (V.or) must be the first argument - have no clue why.

Guess the attached does what you wanted.

1.png

Announcements

Top Tags