Re: FindMinimum with list arguments
- To: mathgroup at smc.vnet.net
- Subject: [mg63538] Re: FindMinimum with list arguments
- From: "Ray Koopman" <koopman at sfu.ca>
- Date: Wed, 4 Jan 2006 03:17:15 -0500 (EST)
- References: <dojf84$fqs$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Ken Turkowski wrote: > I've having a hard time using FindMinimum with arguments that are lists > / arrays / matrices. I hope that I don't have to flatten them out. Could > you help me? > > I've got 11 images, each with their own {pan,tilt,roll} > plus a {center, focalLength} which is shared amongst them, > and I'd like to optimize an objective function by varying these > parameters. Here's what I put together: > > FindMinimum[ > AlignmentError[orientation, intrinsics], > { {orientation, initOrientation}, > {intrinsics, initIntrinsics} > } > ] > > where the initializers are something like > initOrientation = { > {-1.5, 0, 0}, > {-1.4, 0, 0}, > ... > } > initIntrinsics = { 0, 0, 0.64 } > > but I get error messages. However, when I call > > AlignmentError[initOrientation,initIntrinsics] > > I get a nice scalar, 0.34908. > > How can I formulate things so I can get an optimum? I have 36 variables > in the above description (my real problem has a few more); do I need to > generate variable names for each one, or is there some way I can use the > above vectors and matrices as arguments? > > Thanks! > > -- > Ken Turkowski > http://www.worldserver.com/turk/ In situations like this I have used ToString and ToExpression to construct calls to FindMinimum, NMinimize, et al. It's awkward, but it works. See the thread "lists of variables" that ran Jun 20-24, 2005.