Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9103 > unrolled thread

Solving multiple equations

Started byThemis Matsoukas <tmatsoukas@me.com>
First post2012-03-17 07:55 +0000
Last post2012-03-18 07:56 +0000
Articles 6 — 5 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Solving multiple equations Themis Matsoukas <tmatsoukas@me.com> - 2012-03-17 07:55 +0000
    Re: Solving multiple equations Norbert Marxer <marxer@mec.li> - 2012-03-18 07:42 +0000
    Re: Solving multiple equations Peter Pein <petsie@dordos.net> - 2012-03-18 07:43 +0000
    Re: Solving multiple equations Ray Koopman <koopman@sfu.ca> - 2012-03-18 07:47 +0000
    Re: Solving multiple equations Murta <rodrigomurtax@gmail.com> - 2012-03-18 07:52 +0000
    Re: Solving multiple equations Peter Pein <petsie@dordos.net> - 2012-03-18 07:56 +0000

#9103 — Solving multiple equations

FromThemis Matsoukas <tmatsoukas@me.com>
Date2012-03-17 07:55 +0000
SubjectSolving multiple equations
Message-ID<jk1g20$51v$1@smc.vnet.net>
I have two set of equations, one in the form,

eq1 = ({0.15, 0.85, X1} == {X3, X2 + X4, X5})

and the other in the form

eq2={1. X1 == 9/5, X4/(X3 + X4 + X5)==1/3}

Solve understands both Solve[eq1] and Solve[eq2] but if I want to solve the two sets simultaneously, what is the best way to combine eq1 and eq2 into a single list of equations, either of the form of eq1 or of eq2, that Solve can understand?

Themis

[toc] | [next] | [standalone]


#9104

FromNorbert Marxer <marxer@mec.li>
Date2012-03-18 07:42 +0000
Message-ID<jk43km$dqd$1@smc.vnet.net>
In reply to#9103
On 17 Mrz., 08:55, Themis Matsoukas <tmatsou...@me.com> wrote:
> I have two set of equations, one in the form,
>
> eq1 = ({0.15, 0.85, X1} == {X3, X2 + X4, X5})
>
> and the other in the form
>
> eq2={1. X1 == 9/5, X4/(X3 + X4 + X5)==1/3}
>
> Solve understands both Solve[eq1] and Solve[eq2] but if I want to solve the two sets simultaneously, what is the best way to combine eq1 and eq2 into a single list of equations, either of the form of eq1 or of eq2, that Solve can understand?
>
> Themis

Hello

Solve[{Thread[eq1], eq2} // Flatten]

Best Regards
Norbert Marxer

[toc] | [prev] | [next] | [standalone]


#9106

FromPeter Pein <petsie@dordos.net>
Date2012-03-18 07:43 +0000
Message-ID<jk43mj$drj$1@smc.vnet.net>
In reply to#9103
Am 17.03.2012 08:55, schrieb Themis Matsoukas:
> I have two set of equations, one in the form,
>
> eq1 = ({0.15, 0.85, X1} == {X3, X2 + X4, X5})
>
> and the other in the form
>
> eq2={1. X1 == 9/5, X4/(X3 + X4 + X5)==1/3}
>
> Solve understands both Solve[eq1] and Solve[eq2] but if I want to solve the two sets simultaneously, what is the best way to combine eq1 and eq2 into a single list of equations, either of the form of eq1 or of eq2, that Solve can understand?
>
> Themis
>

Well, my postings are faster than my thinking :(

Solve[{eq1, eq2} // Flatten] will do the task.

Peter

[toc] | [prev] | [next] | [standalone]


#9114

FromRay Koopman <koopman@sfu.ca>
Date2012-03-18 07:47 +0000
Message-ID<jk43ua$dvg$1@smc.vnet.net>
In reply to#9103
On Mar 17, 12:55 am, Themis Matsoukas <tmatsou...@me.com> wrote:
> I have two set of equations, one in the form,
>
> eq1 = ({0.15, 0.85, X1} == {X3, X2 + X4, X5})
>
> and the other in the form
>
> eq2={1. X1 == 9/5, X4/(X3 + X4 + X5)==1/3}
>
> Solve understands both Solve[eq1] and Solve[eq2] but if I want to
> solve the two sets simultaneously, what is the best way to combine
> eq1 and eq2 into a single list of equations, either of the form of
> eq1 or of eq2, that Solve can understand?
>
> Themis

Join @@ Thread /@ {eq1, eq2}

{0.15 == X3, 0.85 == X2 + X4, X1 == X5,
 1.*X1 == 9/5, X4/(X3 + X4 + X5) == 1/3}

[toc] | [prev] | [next] | [standalone]


#9124

FromMurta <rodrigomurtax@gmail.com>
Date2012-03-18 07:52 +0000
Message-ID<jk447t$e23$1@smc.vnet.net>
In reply to#9103
Hi!
In your example, equation 1 and 2 are in differente forms. I used this
to solve your case:

eq1 = {0.15, 0.85, X1} == {X3, X2 + X4, X5};
eq2 = {X1 == 9/5, X4/(X3 + X4 + X5) == 1/3};

eq1t = Thread[{0.15, 0.85, X1} == {X3, X2 + X4, X5}];
Solve[Join[eq1t, eq2]]

best regards
Murta

On Mar 17, 4:55 am, Themis Matsoukas <tmatsou...@me.com> wrote:
> I have two set of equations, one in the form,
>
> eq1 = ({0.15, 0.85, X1} == {X3, X2 + X4, X5})
>
> and the other in the form
>
> eq2={1. X1 == 9/5, X4/(X3 + X4 + X5)==1/3}
>
> Solve understands both Solve[eq1] and Solve[eq2] but if I want to solve the two sets simultaneously, what is the best way to combine eq1 and eq2 into a single list of equations, either of the form of eq1 or of eq2, that Solve can understand?
>
> Themis

[toc] | [prev] | [next] | [standalone]


#9131

FromPeter Pein <petsie@dordos.net>
Date2012-03-18 07:56 +0000
Message-ID<jk44ek$e3o$1@smc.vnet.net>
In reply to#9103
Am 17.03.2012 08:55, schrieb Themis Matsoukas:
> I have two set of equations, one in the form,
>
> eq1 = ({0.15, 0.85, X1} == {X3, X2 + X4, X5})
>
> and the other in the form
>
> eq2={1. X1 == 9/5, X4/(X3 + X4 + X5)==1/3}
>
> Solve understands both Solve[eq1] and Solve[eq2] but if I want to solve the two sets simultaneously, what is the best way to combine eq1 and eq2 into a single list of equations, either of the form of eq1 or of eq2, that Solve can understand?
>
> Themis
>

Hi Themis,

  to avoid the mixture of exact/inexact numbers and the equations with 
scalars/lists, try:

eq1 = {0.15, 0.85, X1} == {X3, X2 + X4, X5};
eq2 = {1.*X1 == 9/5, X4/(X3 + X4 + X5) == 1/3};
Solve[Rationalize @ Join[Thread[eq1], eq2]]]

Peter

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web