Re: how to plot a 2-parametric output from Solve with Plot3D
- To: mathgroup at smc.vnet.net
- Subject: [mg72529] Re: [mg72518] how to plot a 2-parametric output from Solve with Plot3D
- From: "Josef Otta" <josef.otta at gmail.com>
- Date: Fri, 5 Jan 2007 01:50:06 -0500 (EST)
Hi Ted,
Try this approach:
eqns = {b x == 2 y^2 + x , y == 2 x /a};
sol = {x, y} /. Solve[eqns, {x, y}];
now you have solution in list "sol" as functions.
You can plot for example second solution for x as:
(Plot3D[#, {a, -1, 1}, {b, -1, 1}] &)@sol[[2, 1]];
If you want to define output of Solve as new function of variables a,b you
can use this:
solfce[c_, d_] := (sol /. {a -> c, b -> d})
In[69]=
solfce[1, 2]
Out[69]=
{{0, 0}, {1/8, 1/4}}
I hope, that it would help you.
Best regard,
Josef Otta
http://home.zcu.cz/~jotta
2007/1/4, T.Sariyski <tsariysk at verizon.net>:
>
> Hi,
> I have an output from a Solve that returns a solution as a list of
> rules. Each branch of the solution is a two-parametric function e.g.
>
> {{ x -> Something(a,b), y->Something(a,b)},...
>
> I want to plot a specific branch of the solution with Plot3D as a
> function of {a,b}. I tried to assign a solution branch to a function
> sol11[a,b]
>
> sol11[a_,b_]=%[[1,1]]
>
> and to plot sol11 but it doesn't work. How can I access a parametric
> solution as returned from Solve as a function of it's parameters?
>
> Thanks, Ted
>
>
>
>
>
>