Re: How can I solve these simultaneous quadratic equations in Mathemetica?
- To: mathgroup at smc.vnet.net
- Subject: [mg65902] Re: How can I solve these simultaneous quadratic equations in Mathemetica?
- From: "Chris Chiasson" <chris.chiasson at gmail.com>
- Date: Sat, 22 Apr 2006 04:54:22 -0400 (EDT)
- References: <200604160748.DAA11097@smc.vnet.net><e22hah$e5h$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Here is a way to get a function/plot of the variables vs c by combining Lichtblau's NSolve with Woll's homotopic continuation: initc is the point where NSolve will be called to give an initial condition halfinterval is the range of c to the right and left of initc eqns[4] is keyed to find a Real solution for the initial condition eqns[1]={1+3c/2+x(1+c+y+z-x)+c*y+(y+z+x)/2-w(2y+2x-3w+3+2c)\[Equal]0, c/2+w(y+z-w+3/2+c)-x(2w+2z-3x+2)\[Equal]0, 1+2c+w(1+c)+z(w+x-z+3/2+c)-y(2w+2z-3y+4+2c)\[Equal]0, y(x+w-y+1+c)-c(1+w)+(y+w-x)/2-z(2y+2x-3z)\[Equal]0}; reps[1]=Cases[Variables[eqns[1]/.Equal\[Rule]List], blah_Symbol\[RuleDelayed]Rule[blah,blah[c]]/;blah=!=c]; eqns[2]=eqns[1]/.reps[1]; eqns[3]=D[#,c]&/@eqns[2]; solvars[1]=Last/@reps[1]; initc=1/2; halfinterval=3/8; crangespec={c,initc-halfinterval,initc+halfinterval}; eqns[4]=Equal@@@ First[Cases[Apply[NSolve,{eqns[2],solvars[1]}/.c\[Rule]initc], Map[Rule[#,_Real]&,solvars[1]/.c->initc]]] solns[1]=NDSolve[eqns/@Range[3,4]/.List\[Rule]And,Head/@solvars[1], Evaluate[crangespec]]; Plot[Evaluate[solvars[1]/.solns[1][[1]]],Evaluate[crangespec], PlotRange\[Rule]{0,50}, PlotStyle\[Rule](Hue[N@#/Length[solvars[1]]]&/@Range[4]), ImageSize\[Rule]400];
- References:
- How can I solve these simultaneous quadratic equations in Mathemetica?
- From: Heisnam Singh <thoihen@yahoo.com>
- How can I solve these simultaneous quadratic equations in Mathemetica?