views:

66

answers:

1
Uu[z_,x_,t_] := A1[z]*F[t*a*x]
Wu[z_,x_,t_] := B1[z]*F[t*a*x]
Pu[z_,x_,t_] := C1[z]*F[t*a*x]
eq1 = D[Uu[z,x,t],t]==-R*D[Pu[z,x,t],x];
C1z = DSolve[eq1,C1[z],z];
eq2 = D[Wu[z,x,t],t]==-R*D[Pu[z,x,t],z]/.C1z[[1]]

The assignment /.C1z[[1]] does not behave the way I expect it to. I am unsure of even what this pheonomena is called, (which makes googling it quite difficult).

C1z does hold the correct value for C1[z] in terms of constants and A1[z], but when I try to 'plug it into' eq2, it does not seem to work.

Thank you for your help.

+4  A: 

This doesn't work because nothing matches your substitution rule.

If you look at the value of eq2 before the rule substitution, you'll notice there is no sub-expression that matches C1[z], because the derivative D[Pu[z,x,t],z] evaluates before the substitution occurs:

In[13]:= eq2a = D[Wu[z,x,t],t]==-R*D[Pu[z,x,t],z]
Out[13]= a x B1[z] F'[a t x]==-R F[a t x] C1'[z]

C1'[z] doesn't have, perhaps, the full expression form you'd expect, so substituting for C1[z] after taking the derivative doesn't do what you want:

In[14]:= FullForm[C1'[z]]
Out[14]//FullForm= Derivative[1][C1][z]

Maybe you meant something like this instead:

In[15]:= eq2=D[Wu[z,x,t],t]==-R*D[Pu[z,x,t]/.C1z[[1]],z]
Out[15]= a x B1[z] F'[a t x]==(x F[a t x] A1'[z])/t

HTH!

Michael Pilat
great answer. that totally helps. thank you!
tiki12revolt