Need help to interpret unusual Maxima notation for a derivative i.e. (d^{y+1}/dx^{y+1}) rho
Subject: Need help to interpret unusual Maxima notation for a derivative i.e. (d^{y+1}/dx^{y+1}) rho
From: Martin Schönecker
Date: Mon, 08 Jun 2009 18:21:35 +0200
Your notation of the mixed derivative is incorrect. For example, in
calculating %sigma[12,2] you should say
(diff(%rho, x, 1, y, 1)
(instead of (diff(%rho, x, y))
-- Martin
(%i22) ? diff;
-- Function: diff (<expr>, <x_1>, <n_1>, ..., <x_m>, <n_m>)
-- Function: diff (<expr>, <x>, <n>)
-- Function: diff (<expr>, <x>)
-- Function: diff (<expr>)
Returns the derivative or differential of <expr> with respect to
some or all variables in <expr>.
`diff (<expr>, <x>, <n>)' returns the <n>'th derivative of <expr>
with respect to <x>.
`diff (<expr>, <x_1>, <n_1>, ..., <x_m>, <n_m>)' returns the mixed
partial derivative of <expr> with respect to <x_1>, ..., <x_m>.
It is equivalent to `diff (... (diff (<expr>, <x_m>, <n_m>) ...),
<x_1>, <n_1>)'.
`diff (<expr>, <x>)' returns the first derivative of <expr> with
respect to the variable <x>.
`diff (<expr>)' returns the total differential of <expr>, that is,
the sum of the derivatives of <expr> with respect to each its
variables times the differential `del' of each variable. No
further simplification of `del' is offered.
The noun form of `diff' is required in some contexts, such as
stating a differential equation. In these cases, `diff' may be
quoted (as `'diff') to yield the noun form instead of carrying out
the differentiation.
When `derivabbrev' is `true', derivatives are displayed as
subscripts. Otherwise, derivatives are displayed in the Leibniz
notation, `dy/dx'.
Examples:
(%i1) diff (exp (f(x)), x, 2);
2
f(x) d f(x) d 2
(%o1) %e (--- (f(x))) + %e (-- (f(x)))
2 dx
dx
(%i2) derivabbrev: true$
(%i3) 'integrate (f(x, y), y, g(x), h(x));
h(x)
/
[
(%o3) I f(x, y) dy
]
/
g(x)
(%i4) diff (%, x);
h(x)
/
[
(%o4) I f(x, y) dy + f(x, h(x)) h(x) - f(x, g(x)) g(x)
] x x x
/
g(x)
For the tensor package, the following modifications have been
incorporated:
(1) The derivatives of any indexed objects in <expr> will have the
variables <x_i> appended as additional arguments. Then all the
derivative indices will be sorted.
(2) The <x_i> may be integers from 1 up to the value of the
variable `dimension' [default value: 4]. This will cause the
differentiation to be carried out with respect to the <x_i>'th
member of the list `coordinates' which should be set to a list of
the names of the coordinates, e.g., `[x, y, z, t]'. If
`coordinates' is bound to an atomic variable, then that variable
subscripted by <x_i> will be used for the variable of
differentiation. This permits an array of coordinate names or
subscripted names like `X[1]', `X[2]', ... to be used. If
`coordinates' has not been assigned a value, then the variables
will be treated as in (1) above.
There are also some inexact matches for `diff'.
Try `?? diff' to see them.
(%o22) true
Vishal Ramnath schrieb:
> Hello,
>
> I need some help in understanding what this term in a PDE that I set up
> in wxMaxima 0.8.2 Windows XP actually is viz.
>
> y+1
> d
> -------- rho
> y+1
> dx
>
> (LaTeX code is $\frac{d^{y+1}}{dx^{y+1}} \rho$)
>
> It doesn't quite make sense if interpreted as
>
> (d/dy) (d/dy) (d/dx) rho
>
> i.e. (y+1)-th derivative of the (d/dx) derivative of rho, for example in
> Maxima (d/dy)(d/dx rho) would be written as (d^y rho)/(dx^y) which is
> straightforward and understandable.
>
> I attach the code below.
>
> Thank you for any assistance.
>
> Regards,
>
> Vishal
>
> ps. I use the Greek font symbols
>
> "Burnett Equations - 8 June 2009"$
> "This program sets up the Burnett equations (mass, momentum, energy) as
> explicit PDEs"$
>
> "set \rho(x,y) u(x,y) v(x,y)"$
> depends([%rho, u, v], [x, y])$
>
> "first order components for stress tensor"$
> %sigma[11, 1]: -%mu*((4/3)*diff(u, x) - (2/3)*diff(v, y));
> %sigma[22, 1]: -%mu*((4/3)*diff(v, y) - (2/3)*diff(u, x));
>
> %sigma[12, 1]: -%mu*(diff(u, y) + diff(v, x));
> %sigma[21, 1]: -%mu*(diff(u, y) + diff(v, x));
>
> "heat transfer components to first order"$
> q[1, 1]: -%kappa*diff(T, x);
> q[2, 1]: -%kappa*diff(T, y);
>
> "set up Navier-Stokes equations i.e. Burnett equation truncated to first
> order"$
> eq[1, 1]: diff(%rho*u, x) + diff(%rho*v, y);
> eq[2, 1]: diff(%rho*u^2 + %sigma[11, 1], x) + diff(%rho*u*v + %sigma[21,
> 1], y);
> eq[3, 1]: diff(%rho*u*v + %sigma[12, 1], x) + diff(%rho*v^2 + %sigma[22,
> 1], y);
>
> "ideal gas equation of state"$
> "Comment: I want to solve for u(x,y,t), v(x,y,t), \rho(x,y,t)"$
> p: %rho*R*T;
>
> %sigma[11, 2]: %sigma[11, 1]
> + (%mu^2/p)*(%alpha[1]*(diff(u, x))^2
> + %alpha[2]*(diff(u, y))^2
> + %alpha[3]*(diff(v, x))^2
> + %alpha[4]*(diff(v, y))^2
> + %alpha[5]*(diff(u, x))*(diff(v, y))
> + %alpha[6]*(diff(u, y))*(diff(v, x))
> + %alpha[7]*R*(diff(T, x, 2))
> + %alpha[8]*R*(diff(T, y, 2))
> + %alpha[9]*(R*T/%rho)*(diff(%rho, x, 2))
> + %alpha[10]*(R*T/%rho)*(diff(%rho, y, 2))
> + %alpha[11]*(R*T/%rho^2)*((diff(%rho, x))^2)
> + %alpha[12]*(R*T/%rho^2)*((diff(%rho, y))^2)
> + %alpha[13]*(R/T)*((diff(T, x))^2)
> + %alpha[14]*(R/T)*((diff(T, y))^2)
> + %alpha[15]*(R/%rho)*(diff(T, x))*(diff(%rho, x))
> + %alpha[16]*(R/%rho)*(diff(T, y))*(diff(%rho, y))
> );
>
> %sigma[22, 2]: %sigma[22, 1]
> + (%mu^2/p)*(%alpha[1]*(diff(v, y))^2
> + %alpha[2]*(diff(v, x))^2
> + %alpha[3]*(diff(u, y))^2
> + %alpha[4]*(diff(u, x))^2
> + %alpha[5]*(diff(u, x))*(diff(v, y))
> + %alpha[6]*(diff(u, y))*(diff(v, x))
> + %alpha[7]*R*(diff(T, y, 2))
> + %alpha[8]*R*(diff(T, x, 2))
> + %alpha[9]*(R*T/%rho)*(diff(%rho, y, 2))
> + %alpha[10]*(R*T/%rho)*(diff(%rho, x, 2))
> + %alpha[11]*(R*T/%rho^2)*((diff(%rho, y))^2)
> + %alpha[12]*(R*T/%rho^2)*((diff(%rho, x))^2)
> + %alpha[13]*(R/T)*((diff(T, y))^2)
> + %alpha[14]*(R/T)*((diff(T, x))^2)
> + %alpha[15]*(R/%rho)*(diff(T, y))*(diff(%rho, y))
> + %alpha[16]*(R/%rho)*(diff(T, x))*(diff(%rho, x))
> );
>
> %sigma[12, 2]: %sigma[12, 1] + (%mu^2/p)*(??ta[1]*(diff(u, x))*(diff(u, y))
> + ??ta[2]*(diff(v, x))*(diff(v, y))
> + ??ta[3]*(diff(u, x))*(diff(v, x))
> + ??ta[4]*(diff(u, y))*(diff(v, y))
> + ??ta[5]*R*(diff(T,x,y))
> + ??ta[6]*(R*T/%rho)*(diff(%rho, x, y))
> + ??ta[7]*(R/T)*(diff(T, x))*(diff(T, y))
> + ??ta[8]*(R*T/%rho^2)*(diff(%rho, x))*(diff(%rho, y))
> + ??ta[9]*(R/%rho)*(diff(%rho, x))*(diff(T, y))
> + ??ta[10]*(R/%rho)*(diff(T, x))*(diff(%rho, y))
> );
> q[1, 2]: q[1, 1] + (%mu^2/%rho)*(%gamma[1]*(1/T)*(diff(T, x))*(diff(u, x))
> + %gamma[2]*(1/T)*(diff(T, x))*(diff(v, y))
> + %gamma[3]*(1/T)*(diff(T, y))*(diff(v, x))
> + %gamma[4]*(1/T)*(diff(T, y))*(diff(u, y))
> + %gamma[5]*(diff(u, x, 2))
> + %gamma[6]*(diff(u, y, 2))
> + %gamma[7]*(diff(v, x, y))
> + %gamma[8]*(1/%rho)*(diff(%rho, x))*(diff(u, x))
> + %gamma[9]*(1/%rho)*(diff(%rho, x))*(diff(v, y))
> + %gamma[10]*(1/%rho)*(diff(%rho, y))*(diff(v, x))
> + %gamma[11]*(1/%rho)*(diff(%rho, y))*(diff(u, y))
> );
>
>
> eq[1, 2]: diff(%rho*u, x) + diff(%rho*v, y);
> eq[2, 2]: diff(%rho*u^2 + %sigma[11, 2], x) + diff(%rho*u*v + %sigma[21,
> 2], y);
> eq[3, 2]: diff(%rho*u*v + %sigma[12, 2], x) + diff(%rho*v^2 + %sigma[22,
> 2], y);
>
> "Equations are built up now!"$
>
> "Discretize first order equations using finite differences..."$
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima