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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

"Variable not Defined" error when minimizing a function

IanCrehan
1-Newbie

"Variable not Defined" error when minimizing a function

Hi

Im a new user to mathcad, I have created a mathcad sheet to find an the minimum value of a function by optimizing two parameters(Attached).I believe i have it set up alright but i am getting an error that a vaiable is not defined even though it is.

Can anyone help me to solve this.This problem has been annoying me for the last 2 days.

Thank You

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:IanCrehan)

Here. I'm not sure you are going to like the answer though.

View solution in original post

6 REPLIES 6

Ian Crehan wrote:

Hi

... by optimizing two parameters ...

Your Minimize statement contains nine parameters not two!

Also note (from Minimize help file): "If you are solving for n variables, the solve block must have n equations." Your solve block contains four equations.

Alan

I Taught that might be the problem and changed it (attached) But im still getting the same problem. For H two parameters (L0,ξ) need to be changed to optimize the solution while three parameters are user inputted constants (Z,Li,ψ) and the other four parameters are changed by the parameters (Fls,Fas,Mb,Vb).

I am trying another approach of defining the function H as a multiline function including all the previous functions which define H. Im not too sure how to do this but I will give it a go.

Ian

MikeArmstrong
5-Regular Member
(To:IanCrehan)

It doesn't look right at all.

three parameters are user inputted constants (Z,Li,ψ) and the other four parameters are changed by the parameters (Fls,Fas,Mb,Vb).

If these are inputted by the user you don't need them to be a function of H.

It's still not clear exactly what your after. Are you trying to find H???

Mike

I am trying to find a minimum value for H by changing the Parameters L0 and ξ.These parameters are both directly applied to the equation for H and a number of other equations which are also applied to H.

Ian

RichardJ
19-Tanzanite
(To:IanCrehan)

Here. I'm not sure you are going to like the answer though.

Thank You Richard,

That is working fine now. I completely misunderstood the Minimize function and layout. All I need to do now is add a few conditions to the minimize and debug the equations so that I get the right answer.

Thank You Again

Ian

Top Tags