Re: Manipulating Solutions
- To: mathgroup at smc.vnet.net
- Subject: [mg16624] Re: Manipulating Solutions
- From: "Peltio" <pelt.ioNOS at PAMiol.it>
- Date: Fri, 19 Mar 1999 12:53:50 -0500
- Organization: Peltio Inc.
- References: <7clgd7$9rd@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
JOE wrote in message
>I have a problem that I hope someone here can solve.
>
>I have a two solution list. That is an output something like this..
> {Dt[y]->Dt[G] * Lr / something, Dt[y]->Dt[m] * Ir / something}
>
>How do I extract the solutions to 'Dt[y] / Dt[G] = Lr / something' and
>'Dt[y] / Dt[m] = Ir / something'?
JOE,
First of all I give names to my objects
sol={Dt[y]->Dt[G] * Lr / something, Dt[y]->Dt[m] * Ir / something};
lhs={Dt[y]/Dt[G],Dt[y]/Dt[m]};
I use Outer to get all the combinations of replacements, and then I take the
right ones by picking only the diagonal elements of the matrix
rhs=Transpose[ Outer[ReplaceAll,lhs,sol] ,{1,1}]
{Lr/something, Ir/something}
This done, all I have to do is to thread the Equal (or the assignment =, if
that is what you want) over the two lists
lhs==rhs//Thread
{lhs == Lr/something, lhs == Ir/something}
Hope that helps.
Peltio
peltioNOS at PAMusa.net