Replace in operators once again
- To: mathgroup at smc.vnet.net
- Subject: [mg103341] Replace in operators once again
- From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
- Date: Wed, 16 Sep 2009 05:47:27 -0400 (EDT)
Dear Community members, I would like to put a question closely related to "[mg102869] Replace in operators", the one recently discussed here. See http://forums.wolfram.com/mathgroup/archive/2009/Sep/msg00006.html and the thread. It concerns analytical transformations in differential equations. I need to make a replacement, not just f[x]->g[x] as discussed in [mg102869], but a simple rescaling of both the function and the coordinate. To be more concrete, consider a PDE over two variables time (t) and coordinate (x): df/dt=d^2f/dx^2 + k df/dx + F(f) Here f is a function f=f(t,x), F=F(f) is another function for instance, a polynomial in terms of f, and depending upon some parameters. Finally, k is a constant. In order to reduce the number of parameters in this equation to the minimum one may wish to rescale both the function and the both coordinates as follows: f[t, x]->a*g[u,v]; t->b*u; x->c*v where a, b and c are some constants. What one finds after the rescaling looks like the following: (a/b)dg/du=(a/c^2)d^2g/dv^2 + k(a/c) dg/dv + F'(g) where F' is the transformed polynomial. Then this should be manipulated further, and it is important to be able to hold all these manipulations on-screen, rather than to go to the paper for intermediate steps. It is not difficult to make the first substitution f[t, x]->a*g[u,v]. One does not even need to use Replace: In[40]:= SetAttributes[{a, b, c}, Constant]; f[t_, x_] := a*g[t, x] D[f[t, x], x] D[f[t, x], {x, 2}] Out[42]= a \!\(\*SuperscriptBox["g", TagBox[ RowBox[{"(", RowBox[{"0", ",", "1"}], ")"}], Derivative], MultilineFunction->None]\)[t, x] Out[43]= a \!\(\*SuperscriptBox["g", TagBox[ RowBox[{"(", RowBox[{"0", ",", "2"}], ")"}], Derivative], MultilineFunction->None]\)[t, x] However, I cannot see how to cope with the second and the third substitutions. Evidently, the simple In[45]:= \!\( \*SubscriptBox[\(\[PartialD]\), \(x\)]\ \(f[t, x]\)\) /. x -> c*v Out[45]= a \!\(\*SuperscriptBox["g", TagBox[ RowBox[{"(", RowBox[{"0", ",", "1"}], ")"}], Derivative], MultilineFunction->None]\)[t, c v] does not make the job. A closely related question: assume we need to make a substitution of the type x->g[v] into derivative. Say, x->Log[v]. I would like to have the result in a form v D[g[v],v]. Instead I get of coarse, In[48]:= D[q[x], x] /. x -> Log[v] Out[48]= \!\(\*SuperscriptBox["q", "\[Prime]", MultilineFunction->None]\)[Log[v]] rather than what I need. Could you think of simple solutions for these cases? Thank you, Alexei -- Alexei Boulbitch, Dr., habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.
- Follow-Ups:
- Re: Replace in operators once again
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Replace in operators once again
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Replace in operators once again