Re: Mathematica in conjunction with outside program; NMinimize fails.
- To: mathgroup at smc.vnet.net
- Subject: [mg98923] Re: Mathematica in conjunction with outside program; NMinimize fails.
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Wed, 22 Apr 2009 05:09:11 -0400 (EDT)
- References: <gsivfv$9dj$1@smc.vnet.net>
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