Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7684
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail |
|---|---|
| From | Chris Young <cy56@comcast.net> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Mantaining the same form |
| Date | Mon, 9 Jan 2012 08:21:52 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <jee830$cvo$1@smc.vnet.net> (permalink) |
| References | <je9624$iqs$1@smc.vnet.net> |
| Lines | 67 |
| NNTP-Posting-Date | 09 Jan 2012 08:22:05 GMT |
| NNTP-Posting-Host | ac7042a4.news.twtelecom.net |
| X-Trace | DXC=;79>=:6dCFFIN?cPSk`9;@C_A=>8kQj6MhHXa^^g6TZDW:VW[ND8jXIEFiONJ7[GoF:Sk3Wm\@gkE |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:7684 |
Show key headers only | View raw
On 2012-01-07 10:16:36 +0000, Miguel Gil said: > At a function in which one parameter is an expression "expr", > Mathematica 8.0 evaluates or simplifies the value of "expr" when it is > introduced. > How is that Mathematica keep the same form of the "expr" introduced?. > > Example: > > In []: MyFunction [expr_]: = expr; > MyFunction [(Sin [2x], Tan [y]) / (x * Sec [y]^2)] > > Out []: (Cos [y]^2 (Sin [2x], Tan [y]) / x > > I want to get the same expression (Sin [2x], Tan [y]) / (x * Sec [y]^2) > > Clearly, the input expression and modified expression are equivalent, > but are not equal. > For example, if we were to apply the rule of L'Hopital or the theorem > Schwarz the results would be erroneous. I tried everything I could think of, but couldn't write any function that would just pass on the expression unchanged: In[264]:= exprHeld[e_] := Hold[e] In[265]:= exprHeld[(Sin[2 x] * Tan[y])/(x * Sec[y]^2)] Out[265]= Hold[(Cos[y] Sin[2 x] Sin[y])/x] In[266]:= holdAll[e_] := HoldAll[e] holdAll[(Sin[2 x] * Tan[y])/(x * Sec[y]^2)] Out[267]= HoldAll[(Cos[y] Sin[2 x] Sin[y])/x] In[268]:= holdComplete[e_] := HoldComplete[e] In[269]:= holdComplete[(Sin[2 x] * Tan[y])/(x * Sec[y]^2)] Out[269]= HoldComplete[(Cos[y] Sin[2 x] Sin[y])/x] In[270]:= uneval[e_] := Unevaluated[e]; In[271]:= uneval[(Sin[2 x] * Tan[y])/(x * Sec[y]^2)] Out[271]= (Cos[y] Sin[2 x] Sin[y])/x In[272]:= Hold[Unevaluated[(Sin[2 x] * Tan[y])/(x * Sec[y]^2)]] Out[272]= Hold[Unevaluated[(Sin[2 x] Tan[y])/(x Sec[y]^2)]] In[273]:= holdUneval[e_] := Hold[Unevaluated[e]] In[274]:= holdUneval[(Sin[2 x] * Tan[y])/(x * Sec[y]^2)] Out[274]= Hold[Unevaluated[(Cos[y] Sin[2 x] Sin[y])/x]] In[278]:= ToString[HoldComplete @ ((Sin[2 x] * Tan[y])/(x * Sec[y]^2)), InputForm] Out[278]= "HoldComplete[(Sin[2*x]*Tan[y])/(x*Sec[y]^2)]" In[279]:= heldString[e_] := ToExpression[ ToString[HoldComplete @ e, InputForm], InputForm]; In[280]:= heldString[(Sin[2 x] * Tan[y])/(x * Sec[y]^2)] Out[280]= HoldComplete[(Cos[y] Sin[2 x] Sin[y])/x]
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Mantaining the same form Miguel Gil <misvrne@gmail.com> - 2012-01-07 10:16 +0000
Re: Mantaining the same form Chris Young <cy56@comcast.net> - 2012-01-09 08:21 +0000
Re: Mantaining the same form "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2012-01-10 11:04 +0000
Re: Mantaining the same form Peter Breitfeld <phbrf@t-online.de> - 2012-01-10 11:05 +0000
Re: Mantaining the same form Bob Hanlon <hanlonr357@gmail.com> - 2012-01-10 11:05 +0000
Re: Mantaining the same form Christopher Young <cy56@comcast.net> - 2012-01-11 09:23 +0000
csiph-web