Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4672
| From | Anshu <anshumanbgg@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Mathematica loop help |
| Date | 2011-08-31 10:12 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j3l1e5$bv9$1@smc.vnet.net> (permalink) |
Hi,
I'm new to mathematica and I'm running into trouble with loops.
I have some parameters, say {a,b,c} and some variables, say {x,y}. I want to solve two non linear equations in x and y using FindRoot for a range of parameter space, say {a,0,100} and {b,-20,20} and {c,55,95}, say, all integers and in increments of 1 and store the solutions in a matrix. varying one parameter at a time so I can keep track of things.
My FindRoot is spitting out solutions when I run it one by one, punching in different parameter values but I would like to loop it, store the solutions and then print it out in a table.
So I wanna do something like this:
While {a,0,100,1}
A[i,j]:= FindRoot[{ f(x,y)==0&& g(x,y)==0},{{x,40},{y,200}}]
end loop
Print A[i,j] in a table. (i indexes parameter 'a' while j=1,2 indexes the two solutions)
Can someone please tell me how to do this. Right now I am trying to run a Do Loop but my mathematica is freezing, while when I run FindRoot just once for a fixed parameter value, I am getting solutions instantaneously.
Thanks a lot
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Mathematica loop help Anshu <anshumanbgg@gmail.com> - 2011-08-31 10:12 +0000
csiph-web