Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: How to Extract Conditional Expression?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127586] Re: How to Extract Conditional Expression?
  • From: "djmpark" <djmpark at comcast.net>
  • Date: Sun, 5 Aug 2012 14:57:33 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <29453407.16957.1344148629196.JavaMail.root@m06>

That can't have been the actual expression you obtained from Mathematica. If
it was like the following you could use:

x -> ConditionalExpression[#1^2 + 3 #1 + 2 C[1] &,   C[1] \[Element]
Integers]
% /. C[1] -> 3  
f[x_] = x[y] /. % /. y -> x  

The other problem here is that you are trying to use x as a function name
(like f) and also as the argument. You should have used f as the symbol in
the statement that produced the ConditionalExpression in the first place -
if that was indeed the expression you obtained.

You should be able to copy the expression into the posting using the context
menu Copy As, Input Text.


David Park
djmpark at comcast.net 
http://home.comcast.net/~djmpark/index.html 


From: ScottG [mailto:sbg at acw.com] 


I have ...

x -> ConditionalExpression[#1^2 + 3 #1 + 2 C[1],   C[1] in Integers]

and I want

f[x_] = x^2 + 3 x + 6

How do I get there other than cut-and-paste?

Thanks for any insight.

Cheers, Scott






  • Prev by Date: Fwd: Evaluation of a whole notebook from another one
  • Next by Date: Re: How to swap two elements of a list
  • Previous by thread: Re: How to Extract Conditional Expression?
  • Next by thread: Re: How to Extract Conditional Expression?