Better Set or Set Delayed ?
- To: mathgroup at smc.vnet.net
- Subject: [mg45138] Better Set or Set Delayed ?
- From: "Jean.Pellegri" <Jean.Pellegri at wanadoo.fr>
- Date: Thu, 18 Dec 2003 06:55:14 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
phi is the function : phi[u_,v_]=u^4+v^3 For calculating the Laplacian at u=3 and v=4 , is better : this ?? Laplacien2[f_][x_,y_]:= Module[{expr,p,q,Dpp,Dqq,subs}, expr = f[p,q]; (* Set *) Dpp=D[expr,{p,2}]; Dqq=D[expr,{q,2}]; subs={p->x,q->y}; Dpp+Dqq/.subs] Laplacien2[phi][3,4] or this ??? Laplacien3[f_][x_,y_]:= Module[{g,p,q,Dpp,Dqq,subs}, g[p_,q_] = f[p,q]; (* Set *) Dpp=D[g[p,q],{p,2}]; Dqq=D[g[p,q],{q,2}]; subs={p->x,q->y}; Dpp+Dqq/.subs] Laplacien3[phi][3,4] or this ???? Laplacien4[f_][x_,y_]:= Module[{g,p,q,Dpp,Dqq,subs}, g[p_,q_] := f[p,q]; (* Set Delayed *) Dpp=D[g[p,q],{p,2}]; Dqq=D[g[p,q],{q,2}]; subs={p->x,q->y}; Dpp+Dqq/.subs] Laplacien4[phi][3,4] Thanks and Ciao -- < Jean Pellegri > "fortitudo mea in rota" 93100 Montreuil