[Date Index] [Thread Index] [Author Index]
Re: Mathematica in conjunction with outside program; NMinimize fails.
Andreas Pape wrote: > Hello mathgroup. I am using Mathematica in conjunction with an > outside program (Netlogo is the program.) In a nutshell, my error is > the following: I can call the outside program with a numeric value > successfully, and Plot can call the outside program as one would > expect. However, NMinimize calls the outside program with the > variable name, not a value, so it fails. In short, I need to force > NMinimize to pass a numeric value to the objective function, not a > variable name. > > More details: > > I have the following functions defined in Mathematica: > > SingleModelRun[ parametervalue_ ] := ....(definition irrelevant) Hello, Use singleModelRun[parametervalue_?NumericQ] := (definition) This will do exactly what you asked for. Make sure you Clear[singleModelRun] before you use this definition. Szabolcs