Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Mathematica loop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125796] Mathematica loop
  • From: Amatya <asinha at rhsmith.umd.edu>
  • Date: Tue, 3 Apr 2012 04:45:28 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hi,

I have a vector of n=5 variables x, that are the solution of "n=5" non-linear equations. I have i= 1 to 100 vectors of coefficient data "ci" of the non linear equations, and for each of those vectors "ci", I want to solve the system of non-linear equations and return a solution vector x. So in the end I want 100x5 matrix where each row represents different coefficients and each column represents one of the variables of x.

Also, all of the non-linear equations are very sensitive to starting points in the FindRoot. I need some flexibility so I can specify a different starting point and domain in which FindRoot looks for the solution, for each of the 100 values of the input parameters. Is there a clean way to do this?

My algorithm should basically do this:

Initial search point: a1=something,...,a5=something
For i = 1 to 100
 x/.FindRoot[{f1(x;ci)==0,..,f5(x;ci)==0},{{x1,a1}...{x5,a5}}] 
 Store results in a Matrix
a1=new start value according to formula based on i
.. a5= new value according to formula based on i
i=i+1

 Is it possible to do this using Table or something? Solve a 100 FindRoots in one shot giving all the initial search points and coefficient values as vector or matrix input?

Thanks



  • Prev by Date: Re: Integers that are the sum of 2 nonzero squares in
  • Next by Date: Re: recursively solve equation and save the values only
  • Previous by thread: Re: Defining a value-specific ColorFunction for use in ListDensityPlot
  • Next by thread: Pattern Syntax for Alternate Heads with Default Value