Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Problem w/FindMinimum and Indexed Variables' topicStudent Support Forum > General > "Problem w/FindMinimum and Indexed Variables"

Next Comment >Help | Reply To Topic
Author Comment/Response
Cesar
09/05/99 4:26pm

Why is the following not a problem:
xs={d1,d2};
xs0={0.1,0.2};
ff=d1^4+3d1^2d2^2+5d2^2+d1+d2;
FindMinimum[ff,##]&@@Transpose[{xs,xs0}]

but when I use indexed variables (i.e. d[1], d[2]) I have to use:
FindMinimum[#1,##2]&@@Flatten[{ff,Transpose[{xs,xs0}]},1] ?

The following is a problem when ff uses indexed variables:

FindMinimum[ff, ##1]&@@Flatten[{Transpose[{xs,xs0}]},1]. I get the message:
Function::flpar : Parameter specification {d[1],d[2]} in Function[{d[1],d[2]},{ff}] should be a symbol or a list of symbols.

Also,

FindMinimum[lastxs=xs;#1,##2]&@@Flatten[{ff,Transpose[{xs,xs0}]},1]

gives:
Function::flpar : Parameter specification {d[1],d[2]} in Function[{d[1],d[2]},{lastxs=xs}] should be a symbol or a list of symbols.

Of course, if I use non-indexed variables I'm ok, but I have a function with many variables and I don't want to write each one separately.

What's the solution?

Thanks,

Cesar

URL: ,

Subject (listing for 'Problem w/FindMinimum and Indexed Variables')
Author Date Posted
Problem w/FindMinimum and Indexed Variables Cesar 09/05/99 4:26pm
Re: Problem w/FindMinimum and Indexed Variables Forum Modera... 09/06/99 08:24am
Next Comment >Help | Reply To Topic