Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.7K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Issue with definition in symbolic manipulation

Posted 11 years ago
POSTED BY: Matt T
5 Replies
Posted 11 years ago

Yes, that's what I had discover. Thank you very much for your help. :)

POSTED BY: Matt T

This may get you closer to what you want.

dzphi[x_, z_, t_] :=  Module[{zz}, D[CapitalPhi[x, zz, t], zz] /. zz -> z]

Now we get this.

In[376]:= dzphis[x, t]

Out[376]= E^(-(1/2) x^2 K[1][t]) Cos[x] Phi[1][t]
POSTED BY: Daniel Lichtblau
Posted 11 years ago

Oh, I'm sorry, I wasn't aware of those possibilities.

So once again. Here is a sample code :

    ClearAll[Eta, CapitalPhi, Phi, Delta, OrderDev, x, z, t, i, n, K, dxphi, dzphi, dxphis, dzphis];

    OrderDev = 1;
    i = 0;

    Eta[x_, t_] := Sum [K[n][t] x^(2 n)/(2 n)!, {n, 0, OrderDev}];
    Delta[ z_, t_] := z - K[0][t];
    CapitalPhi[x_, z_,  t_] := -Sum [Phi[n][t] Cos[n x - i Pi] Exp[-n Delta[z, t]], {n, 1, OrderDev}];
    dxphi[x_, z_, t_] := D[CapitalPhi[x, z, t], x];
    dzphi[x_, z_, t_] := D[CapitalPhi[x, z, t], z];

    dxphis[x_, t_] := dxphi[x, Eta[x, t], t];
    dzphis[x_, t_] := dzphi[x, Eta[x, t], t];

Mathematica doesn't understand what I say, which shows that I'm saying it wrong. When I ask

dxphi[x, z, t]

It answers

E^(-z + K[0][t]) Sin[x] Phi[1][t]

Which is OK with me, but then,

dxphis[x, t]

Produces

E^(-(1/2) x^2 K[1][t]) Sin[x] Phi[1][t] + E^(-(1/2) x^2 K[1][t]) x Cos[x] K[1][t] Phi[1][t]

When I expect

E^(-(1/2) x^2 K[1][t]) Sin[x] Phi[1][t]

Worse, in the case of

dzphis[x, t]

It says

General::ivar: K[0][t]+1/2 x^2 K[1][t] is not a valid variable. >>

So I assume that when I say something like $g(x)= {\partial f \over \partial x}$ and then $h(x) = g(u(x))$, it keeps the memory of the definition of $g$ and gives ${\partial f \over \partial x} (u(x)) \times u'(x)$, while I was looking for ${\partial f \over \partial x}| _ {\ u(x)}$.

Could you help me to define dxphis and dzphis in a proper way ?

Thank you in advance for your attention.

POSTED BY: Matt T
POSTED BY: Bruce Miller

Could you edit your post to make use of the formatting tools (in particular the code sample tool) so that your code is more readable and so that some special characters are not dropped? That will make it so that folks can play with it by copying and pasting into Mathematica and advise you.

--David

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard