A matrix containing differential operators acting on a matrix containing functions

asked 2021-03-22 13:33:31 +0100

Apoorv gravatar image

updated 2021-03-24 07:17:05 +0100

Suppose I have a 2x2 operator matrix, D. Some of its elements are of the form (d/dx), and (d2/dx2). Now when this matrix is multiplied with another matrix, f, whose elements are functions of x, I will get the final matrix whose corresponding elements are differentiated.

for example: D = matrix([[d/dx, d3/dx3], [d2/dx2, d2/dx2]]) is an operator matrix which operates on a function matrix, f(x) = matrix([[x, x^2], [x^3, x]]) as D(f(x)) = D*f(x), (simple matrix multiplication).

Writing D = matrix([[diff( , x), diff( , x, 3)], [diff( , x, 2), diff( , x, 2)]]) does not work as diff() function needs an input function.

So how can I write the D() operator matrix?

PS: I could use f.apply_map(lambda e: diff(e, x)), but then it applies d/dx to all elements in f(x). Whereas, I have 'diff()' operators of different orders in the D matrix.

edit retag flag offensive close merge delete


To improve the question, make it simpler and more concrete:

  • use a 2 x 2 matrix of differential operators
  • use a 2 x 2 matrix of functions, and provide it explicitly

Once answered, it should be easy for you to adapt to your 6 x 3 and 3 x 12 setting.

slelievre gravatar imageslelievre ( 2021-03-22 18:14:12 +0100 )edit

Hey @slelievre, I have updated the question. This would be a simpler form of what I am trying to do. Thank you

Apoorv gravatar imageApoorv ( 2021-03-24 06:12:04 +0100 )edit
FrédéricC gravatar imageFrédéricC ( 2021-03-24 08:28:44 +0100 )edit