Re: Problem with ->
- To: mathgroup@smc.vnet.net
- Subject: [mg11424] Re: [mg11379] Problem with ->
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Thu, 12 Mar 1998 01:33:01 -0500
- References: <199803090112.UAA06406@smc.vnet.net.>
Hans Steffani wrote: > > I want to substitute R[s] by k s. > I tried: > R[s] / R'[s] /. R[s] -> k s > and got > k s / R'[s] > instead of the expected > s > > What am I doing wrong? > > Hans Friedrich Steffani > -- > Hans Friedrich Steffani > Institut fuer Elektrische Maschinen und Antriebe, TU Chemnitz > mailto:hans.steffani@e-technik.tu-chemnitz.de > http://www.tu-chemnitz.de/~hfst/ Transformation rules ( /.x->y ) do not carry over to functional evaluations. In other words, the substitution R[s]->k s is just pattern matching like in a word processor search routine. R'[s] is not in the pattern. A transformation rule does not make any sort of a global definition, it just searches your expression for a pattern and makes the substitution. If you want to DEFINE R[s] as k s,which is very different from a transformation rule, then you need to make the assignment as in: R[s]:=k s; R[s]/D[R[s],s] which does return s. By the way, the notation R'[s] for derivative is only used in DSolve and NDSolve etc. It does not instruct mathematica to evaluate a symbolic or numerical derivative in general. See page 78 of the 3.0 Mathematica book for proper notation on total, partial and regular derivatives. -- Remove the _nospam_ in the return address to respond.
- References:
- Problem with ->
- From: hans.steffani@e-technik.tu-chemnitz.de (Hans Steffani)
- Problem with ->