0
$\begingroup$

I am looking for the right way to replace $\delta \, \, \text{by} \, \, 0.05 \, \, \, \beta \, \, \, \text{by} \, \, \, 1.77 \, \, \, \text{and} \, \, \, n \, \, \, \text{by} \, \, \, 12$ in this expression

(2 δ E^(-δ τ))/(2 E^(-δ τ) - 1)
b[τ_] := (2 δ β E^(-δ τ) - δ ((2 \
E^(-δ τ) - 
          1) β - δ) n)/((2 E^(-δ τ) - 
      1) β)
f[τ_] := 
 ArcCos[a[τ]/b[τ]]/Sqrt[b[τ]^2 - a[τ]^2]
z[τ_] := τ - f[τ]

I tried something like this

 Replace[τ - 
      ArcCos[a[τ]/b[τ]]/
       Sqrt[b[τ]^2 - a[τ]^2], {δ -> 0.05, β -> 
       1.77, n -> 12}]   

in the final outcome, I had

τ - ArcCos[(2 E^(-δ τ) β δ)/(2 E^(-\
δ τ) β δ - 
      n ((-1 + 2 E^(-δ τ)) β - δ) δ)]/
  Sqrt[-((4 E^(-2 δ τ) δ^2)/(-1 + 
          2 E^(-δ τ))^2) + (2 E^(-δ τ) \
β δ - 
        n ((-1 + 
              2 E^(-δ τ)) β - δ) \
δ)^2/((-1 + 2 E^(-δ τ))^2 β^2)]

which seems extremely uncomfortable.

Any help would be much appreciated!

$\endgroup$
1
  • $\begingroup$ Please consider not using fancy typesetting in the future - usually standard characters are much better for readability. $\endgroup$
    – Yves Klett
    Commented Nov 21, 2015 at 10:13

1 Answer 1

3
$\begingroup$

Try rather using the following syntax for your replacement:

( <expr> ) /. { x -> 3.14 }

In your case, probably something like:

FullSimplify[  (\[Tau] - ArcCos[a[\[Tau]]/b[\[Tau]]]/ 
  Sqrt[b[\[Tau]]^2 - a[\[Tau]]^2])
  /. {\[Delta] -> 0.05, \[Beta] -> 1.77, n -> 12} ]

See the explanation on Applying Transformation Rules:

On the other hand, Replace[expr,rules] tries the rules only on the whole of expr, and not on any of its subparts.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.