Re: FindMinimum during NMimimize
- To: mathgroup at smc.vnet.net
- Subject: [mg65576] Re: FindMinimum during NMimimize
- From: bghiggins at ucdavis.edu
- Date: Sun, 9 Apr 2006 04:32:03 -0400 (EDT)
- References: <e15el3$2ri$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Mario, Redefine your function DistanceOverX to take numerical values as its arguments: distanceOverX[ma1_?NumericQ, ma2_?NumericQ, slopex_?NumericQ, intx_?NumericQ] := FindMinimum[Sqrt[(ma1 - x)^2 + (ma2 - discra[x, slopex, intx])^2], {x, \ 10, 20}][[1]] discra[x_, slopex_, intx_] := x*slopex + intx NMinimize[{(distanceOverX[1, 1, 0, intx] - 100)^2, 0 < intx < 10}, {{intx, 2, 3}}, Method -> {"NelderMead", RandomSeed -> 101}, MaxIterations -> 100] {8281., {intx -> 10.}} Cheers, Brian