MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Setting up equations (Revision)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66019] Re: [mg65990] Setting up equations (Revision)
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 27 Apr 2006 02:26:08 -0400 (EDT)
  • References: <200604260837.EAA02689@smc.vnet.net> <E1D0F0B5-4CE6-4740-9A3D-C17A255794F8@cox.net>
  • Sender: owner-wri-mathgroup at wolfram.com

My first response had some unnecessary steps.

eqn=5 x+6 y+7 z==a x+b y+c z;

Solve[(Flatten[CoefficientList[#,{x,y,z}]]&/@
       eqn),{a,b,c}]

{{a -> 5, b -> 6, c -> 7}}


Bob Hanlon
hanlonr at cox.net



On Apr 26, 2006, at 7:35 AM, Bob Hanlon wrote:

> eqn=5 x+6 y+7 z==a x+b y+c z;
>
> Solve[Equal@@
>     (Flatten[CoefficientList[#,{x,y,z}]]&/@
>         List@@eqn),{a,b,c}]
>
> {{a -> 5, b -> 6, c -> 7}}
>
>
> Bob Hanlon
> hanlonr at cox.net
>
>
>
> On Apr 26, 2006, at 4:37 AM, Yaroslav Bulatov wrote:
>
>> I'm trying to do things of the form
>> Solve[5 x + 6 y + 7 z == a x + b y + c z, {a, b, c}]
>>
>> But since x,y,z are variables, what I really mean is
>> Solve[5==a && 6==b && 7==c], so I need to convert to this form
>>
>> If I only have one variable, the following does what I need
>>
>> LogicalExpand[a*x + b*x^2 + O[x]^3 == 2*x + 3*x^2 + O[x]^3]
>>
>> But what to do if I have several variables?
>>
>


  • Prev by Date: Calling .exe with Arguments - Run[] Issue
  • Next by Date: Re: Object-Oriented Paradigm in Mathematica?
  • Previous by thread: Re: Setting up equations
  • Next by thread: Re: Setting up equations