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


Groups > comp.soft-sys.math.mathematica > #12231

Re: simple equation substitutions

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: simple equation substitutions
Date 2012-11-02 05:12 +0000
Message-ID <k6vkn6$6j1$1@smc.vnet.net> (permalink)
References <20121101071928.99D326857@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


eqns = {y == x + 2, x == 7};

Solve[eqns, {x, y}]

{{x -> 7, y -> 9}}

Solve[eqns, Variables[eqns]]

{{x -> 7, y -> 9}}

Simplify[Solve[eqns[[1]], y], eqns[[2]]]

{{y -> 9}}

Simplify[Solve[#[[1]], y], #[[2]]] &@eqns

{{y -> 9}}

Solve[eqns, y, Integers]

{{y -> ConditionalExpression[9, x == 7]}}

Reduce[eqns, {x, y}] // ToRules

{x -> 7, y -> 9}

Reduce[eqns, y] // ToRules

{x -> 7, y -> 9}

Reduce[eqns, x] // ToRules

{y -> 9, x -> 7}

Eliminate[eqns, x] // ToRules

{y -> 9}


Bob Hanlon


On Thu, Nov 1, 2012 at 3:19 AM, Neal Becker <ndbecker2@gmail.com> wrote:
> {y == x + 2, x == 7}
>
> Solve[%, y]
>
> -> {}
>
> What I expected to happen is have x->7 applied to y == x+2.
>
> My real plan is to develop a list of (a lot more complicated) expressions that will have repeated substitutions applied.
>
> Why didn't the above work and/or what should I do instead?
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: simple equation substitutions Bob Hanlon <hanlonr357@gmail.com> - 2012-11-02 05:12 +0000

csiph-web