Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hello,
Attached is a short sheet with a Minimize function. I'm getting a "variable undefined" error.
Can anyone help?
TIA
Solved! Go to Solution.
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:
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:
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.
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.