Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulating differential equations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18617] Re: [mg18552] Manipulating differential equations
  • From: "Wolf, Hartmut" <hwolf at debis.com>
  • Date: Tue, 13 Jul 1999 01:01:37 -0400
  • Organization: debis Systemhaus
  • References: <199907100618.CAA02980@smc.vnet.net.>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Martin,

Martin Heimann schrieb:
> 
> Dear colleagues,
> 
> I would like to insert test functions into an expression that contains
> differentials:
> 
> dg1 = c''[x] + g c'[x]
> 
> I would like e.g. to replace c[x] by Exp[-a x]:
> 
> dg1/.c[x]->Exp[-a x]
> 
> but this doesn't work; one has to put substitution rules for each of the
> derivatives explicitly. Is there a more elegant way to achieve this?
> 
you have to substitute the _function_ :

In[16]:= dg1 = c''[x] + g c'[x]//FullForm
Out[16]//FullForm=
Plus[Times[g,Derivative[1][c][x]],Derivative[2][c][x]]

In[17]:= dg1/. c->(Exp[-a #]&) 
Out[17]//FullForm=
Plus[Times[Power[a,2],Power[E,Times[-1,a,x]]],
  Times[-1,a,Power[E,Times[-1,a,x]],g]]

(of course you normally don't define dg1 wrapped in FullForm)

Alternatively you could also localize the function c[x] to Exp[-a x]:

In[18]:= Block[{c},c[x_]:=Exp[-a x];dg1]
Out[18]//FullForm=
Plus[Times[Power[a,2],Power[E,Times[-1,a,x]]],
  Times[-1,a,Power[E,Times[-1,a,x]],g]]

---your's hw



  • Prev by Date: Re: Not Plotting Vertical Assymptotes
  • Next by Date: Re: Manipulating differential equations
  • Previous by thread: Re: Manipulating differential equations
  • Next by thread: Re: Manipulating differential equations