I need to write an elasticity equations as:


where a,b,...,f are constants and u, v are two functions of x and y. In the other words, I would like to write D.U, where D is the differential operator matrix and U is the objective function.

Can you help me out on this, please?


The dot product (Dot) in Mathematica is defined as that (discrete) inner product for which the first operation is multiplication and the second, addition. So, you cannot use a dot product directly here, because it cannot incorporate concepts of differentiation or functional application. Instead, you should use a suitably constructed generalized inner product.

First we construct your differential operator matrix (we call it m, because D is already taken for Mathematica's own partial derivative function). Let's do this as

m = {{a, b}, {c, d}, {e, f}}.{∂/∂x, ∂/∂y}

just to make the point clearer. Note that we do not need to have the differential operator as a "column vector"--Mathematica lacks the concept of different "directions" of vector, because it operates in the domain of general tensors, rather than being based on matrix operations. In this sense a vector is truly a one-dimensional object, rather than a $1 \times n$ or $n \times 1$ matrix. You can leave out the extra levels of List.

In Mathematica the code will be:

m = Inner[
  Function[\[FormalF], #1 D[\[FormalF], #2]] &,
  {{a, b}, {c, d}, {e, f}}, {x, y}

It gives

differential operator

which is what you wrote above. Now we can apply this to your U, which is just:

Inner[#1[#2] &, m, {u, v}, Plus]

Let's take $u = \cos{x} + 3x^2$ and $v = e^{1 \over {1 + y}}$ as an example:

With[{u = Cos[x] + 3 x^2, v = Exp[1/(1 + y)]},
  Inner[#1[#2] &, m, {u, v}, Plus]

result of applying differential operator

I think this is along the lines of what you were after. Please note that, although they are shown as scalars here, u and v can also be vector-valued functions without any change in the code.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.