Re: Re: Eliminate Complex Roots
- To: mathgroup at smc.vnet.net
- Subject: [mg64447] Re: [mg64407] Re: Eliminate Complex Roots
- From: Pratik Desai <pdesai1 at umbc.edu>
- Date: Fri, 17 Feb 2006 04:12:06 -0500 (EST)
- References: <200602130815.DAA12562@smc.vnet.net><dsru2d$5bv$1@smc.vnet.net> <200602160805.DAA29830@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
bghiggins at ucdavis.edu wrote: >Pratik and Bob > >Thanks much for the suggestion of using FindInstance and Reduce. > >Pratik, your code only finds 1 root but a simple modification allows >one to plot(usingListPlot) all three real roots: > >data = ListPlot[Partition[Flatten[N[Table[Flatten[{ > b, a /. FindInstance[a^3 + 10*a^2 - 15*a + b == >0, a, Reals,3]}], {b, -20, 30, .5}]] /. {x_, y1_, y2_, y3_} -> {{x, >y1}, {x, y2}, {x, y3}}], 2]] > >Downside with the above approach is that you cannot use >PlotJoined->True. Of course, a work around is to separate out the >individual roots and use MultipleListPlot or Show with multiple >ListPlot > > Perhaps something like this using DisplayTogether << Graphics`Graphics` plot1=ListPlot[Partition[Flatten[N[Table[Flatten[{b, a /. FindInstance[a^3 + 10*a^2 - 15*a + b ==0, a, Reals,3]}], {b, -20, 30, .5}]] /. {x_, y1_, y2_, y3_} -> {x,y1}],2],PlotJoined->True,PlotStyle->Hue[0]] plot2=ListPlot[Partition[Flatten[N[Table[Flatten[{b, a /. FindInstance[a^3 + 10*a^2 - 15*a + b ==0, a, Reals,3]}], {b, -20, 30, .5}]] /. {x_, y1_, y2_, y3_} -> {x,y2}],2],PlotJoined->True,PlotStyle->Hue[0.4]] plot3=ListPlot[Partition[Flatten[N[Table[Flatten[{b, a /. FindInstance[a^3 + 10*a^2 - 15*a + b ==0, a, Reals,3]}], {b, -20, 30, .5}]] /. {x_, y1_, y2_, y3_} -> {x,y3}],2],PlotJoined->True,PlotStyle->Hue[0.2]] DisplayTogether[plot1,plot2,plot3] >Still would like to be able to do this using Plot, and thereby make use >of Plots automatic gridding capabilities... > >Looking at Bob's suggestion, it seems I am still stuck with knowing >which root to extract out for Plotting. I can in a pinch manipulate the >solution from Reduce and use ListPlot as done above. > >Another approach that seems to work well is to use ImplicitPlot making >use of its built in ContourPlot routine. For systems of equations, I >also need to use Eliminate to get a single implicit equation with two >unknowns and it seems to work well, but may not be general enough for >the kinds of problems I am interested in, viz, plotting multiple steady >states of dynamical systems as a function of a parameter. > >Brian > > > > >>Perhaps using FindInstance? Here is my attempt anyway >> >>Clear[a,b] >>ListPlot[Flatten[a/.Table[FindInstance[a^3 + 10*a^2 - 15*a + b == >>0,a,Reals],{b,-10,30}]//N],PlotJoined->True,PlotRange->All] >> >> > > >
- References:
- Eliminate Complex Roots
- From: bghiggins@ucdavis.edu
- Re: Eliminate Complex Roots
- From: bghiggins@ucdavis.edu
- Eliminate Complex Roots