2
$\begingroup$

A simple example about what I need to do. For example, I have three functions:

t1[x,t]
t2[x,t]
t3[x,t]

and,

t3[x_,t_]:=t1[x,t]+t2[x,t] 

What is the best way to create a function t4[x,t] that is numerically "equal" to t3[x,t] but is not function of t1[x,t] and t2[x,t] in order to avoid a circular reference in a While loop program?

Regards!

$\endgroup$

1 Answer 1

3
$\begingroup$
t4[x_,t_]:=Evaluate[t1[x,t]+t2[x,t]]
$\endgroup$
2
  • 3
    $\begingroup$ Or equivalently just use Set ( = ) rather than SetDelayed ( := ) in the definition of t3. $\endgroup$
    – Bob Hanlon
    Aug 8, 2014 at 14:15
  • $\begingroup$ Thanks. Interesting... if for example t1[x,t] is a interpolation function (came from NDSolve), I have to declare t4[x_?NumericQ,t_?NumericQ]:=Evaluate[t1[x,t]+t2[x,t]]. Still testing... $\endgroup$ Aug 8, 2014 at 15:01

Your Answer

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

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