FindMinimum during NMimimize
- To: mathgroup at smc.vnet.net
- Subject: [mg65552] FindMinimum during NMimimize
- From: "mfific at gmail.com" <mfific at gmail.com>
- Date: Fri, 7 Apr 2006 06:14:30 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Dear all, Math ver 5.0 Here is my problem: discra[x_,slopex_,intx_]:=x*slopex+intx distanceOverX[ma1_,ma2_,slopex_,intx_]:= FindMinimum[Sqrt[(ma1-x)^2+(ma2-discra[x,slopex,intx])^2],{x,10,20}][[1]] NMinimize[{(distanceOverX[1,1,0,intx]-100)^2,0<intx<10}, {{intx,2,3}},Methodï?®{"NelderMead","RandomSeed"ï?®15},MaxIterationsï?®100] I defined a function distanceOverX above that includes FindMinimum for x variable. And that function works fine by itslef: as an otput I take the minimized value. But when I used distanceOverXfunction for finding global Min using NMinimize, I got the error which indicates that FindMinimum could not do the job: for example: The function value ....is not a number at {x}={10}.... I would appreciate for a suggestion how to unlock that problem. (Note that for NMinmize I let only one variable (intx) from the function distanceOverX to be free parameter while other values are provided) thank you very much, Mario Fific Cognitive Psychology and Cognitive Science Indiana University