Message Boards Message Boards

0
|
8460 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

ReleaseHold not effective

Posted 11 years ago
Hi !

I cannot get rid of HoldForm from my expression despite ReleaseHold invokation.

Here is the code :
 x3 = (1/(2*r*((-tau)*tau1 + Q*(tau^2 + tau1^2))))*(a*Q*tau1*
     HeavisideTheta[
      t - t1]*(-2*p0*r*
        tau1 + (-2*Q*Sqrt[r]*tau + tau1 - 4*Q^2*tau1 + Sqrt[r]*tau1)*
        HoldForm[
         HoldForm[
           E^((Sqrt[r]*t)/(2*Q*tau))*
            HoldForm[
             E^(t1/(2*Q*tau))*
             HoldForm[1/(E^((Sqrt[r]*t1)/(2*Q*tau))*E^(t1/tau1))]]]/
         E^(t/(2*Q*tau))] + (2*Q*Sqrt[r]*tau +
         tau1 - (4*Q^2 + Sqrt[r])*tau1)*
       HoldForm[
        HoldForm[
          HoldForm[
            E^(t1/(2*Q*tau))*
             HoldForm[E^((Sqrt[r]*t1)/(2*Q*tau))/E^(t1/tau1)]]/
           E^((Sqrt[r]*t)/(2*Q*tau))]/E^(t/(2*Q*tau))]))

FullForm[x3]
x3 = ReleaseHold[x3]
FullForm[x3]
May I ask you some hints ?

Regards
POSTED BY: Sylvain Rousseau
3 Replies
Posted 11 years ago
You can find the answer at the documentation of ReleaseHold:

"ReleaseHold removes only the outermost layer of Hold"

So you would have to apply ReleaseHold several times (= number of layers) to get rid of all Holds.
POSTED BY: Mario Weitzer
If you really want to just rid of all the ReleaseHold's in your x3, you can run:
x3 /. HoldForm -> Identity
POSTED BY: Sean Clarke
Thanks Mario.
I indeed read the doc, then searched on google for a more straightforward way of removing HoldForm without any success, hence my thread on your nice forum.

Thanks Sean for your hint.

Cheers !
POSTED BY: Sylvain Rousseau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract