Message Boards Message Boards

0
|
5792 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Differences between u[x,y,t] vs. u[x,y][t] vs. u[x][y][t].

Is there any difference between defining a variable by u[x,y,t] or u[x,y][t] or u[x][y][t] ?

I understand that beeing used in NDSolve the appropriate way to define it is either u[x,y][t] or u[x][y][t] in order to declare the dependent variable as u[x,y] or u[x][y] and the derivative vs time with prime notation as u[x,y]'[t] or u[x][y]'[t].

For the first notation the derivative would be D[u[x,y,t] ,t ] and the dependent variable u ?

I would appreciate if anybody could comment on which is the reason to select any of the three forms ?

3 Replies

Thank you very much for your reply Prof. Craig.

Differences between u[x,y,t] vs. u[x,y][t] vs. u[x][y][t].

POSTED BY: W. Craig Carter

There is not much practical difference. There are many cases where the u[x][y][t] forms are particularly convenient, but not necessarily for the derivative application you show.

For derivatives, I prefer the operator-like forms:

Derivative[0, 1][ArcTan][x, y]
Derivative[0, 1][ArcTan]
Derivative[0, 1][ArcTan][5, y]
Derivative[0, 1][ArcTan][5, 12]

When I want to pass a function as an argument, the u[x][y][t] forms are particularly convenient, consider this little tool to plot tangent lines:

tangentLine[f_][x_][t_] := Module[{z, derivative},
  derivative = D[f[z], z] /. z -> x;
  Arrow[{{x, f[x]}, {x + t, f[x] + t  derivative}}]
  ] 

or

tangentLine[f_][x_][t_] := 
 Module[{derivative}, derivative = Derivative[1][f][x]; 
  Arrow[{{x, f[x]}, {x + t, f[x] + t derivative}}]]

Manipulate[
 Plot[f[z], {z, 0, 4}, 
  Epilog -> {PointSize[0.05], tangentLine[f][x][t]}],
 {x, 0, 4},
 {t, .3, 4},
 {f, {Sin, Cos, Function[{u}, u/(1 + u)]}}
 ]

Using the f[x][y][t] makes the code more tidy, I think.

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

Group Abstract Group Abstract