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


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

Re: extract from Reduce

From debguy <johnandsara2@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: extract from Reduce
Date 2013-04-05 02:29 +0000
Message-ID <kjlcv3$b69$1@smc.vnet.net> (permalink)
References <kjkc5k$7n0$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


this will get a num list if ==, !=, ||, && are involved

Begin["a`"]
Reduce[p*x == 1 && x^2 == y, {p, x}];
% /. x_ == y_ -> {x, y} /. x_ != y_ -> {x, y}; (* 1 *)
% //. x_ && y_ -> {x, y} //. x_ || y_ -> {x, y};
Partition[Flatten[%], 2]; (* 2 *)
answer=%[[All,2]] (* just the numbers so to speak *)
End[];
Scan[Remove, Names["a`*"]]

(* note!  without !=, &&, || values are "wrong" unless used in context
*)

(* (1)
%//InputForm
{p, -(1/Sqrt[y])} && {x, -Sqrt[y]} && {y, 0} ||
 {p, 1/Sqrt[y]} && {x, Sqrt[y]} && {y, 0}
*)

(* 2
% // InputForm
{{p, -(1/Sqrt[y])}, {x, -Sqrt[y]}, {y, 0}, {p, 1/Sqrt[y]}, {x,
Sqrt[y]},
 {y, 0}}
*)

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


Thread

extract from Reduce hamiltoncycle@gmail.com - 2013-04-04 17:10 +0000
  Re: extract from Reduce awnl <awnl@gmx-topmail.de> - 2013-04-05 02:29 +0000
  Re: extract from Reduce debguy <johnandsara2@cox.net> - 2013-04-05 02:29 +0000
  Re: extract from Reduce Peter Pein <petsie@dordos.net> - 2013-04-05 02:30 +0000

csiph-web