English 中文(简体)
Simple? Message Passing in Mathematica 7
原标题:
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.

问题回答

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!





相关问题
Why are string::append operations behaving strangely?

look at the following simple code: #include <iostream> #include <string> using namespace std; int main() { string s("1234567890"); string::iterator i1 = s.begin(); string::...

Order of execution of parameters guarantees in Java?

Given the following function call in C: fooFunc( barFunc(), bazFunc() ); The order of execution of barFunc and BazFunc is not specified, so barFunc() may be called before bazFunc() or bazFunc() ...

How *exactly* does the RHS of PowerShell s -f operator work?

Last time I got confused by the way PowerShell eagerly unrolls collections, Keith summarized its heuristic like so: Putting the results (an array) within a grouping expression (or subexpression e.g....

热门标签