Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I have a bunch of closed differential equations that I want to solve. The variables of the DEs are 2x2 matrices. So, I want to enter some 2x2 matrices of variables and then use NDSolve to get the solution.

How should I define a 2x2 matrix with four variables inside it? I tried

matrix[a_, b_, c_, d_] := {{a, b}, {c,d}} but this doesn't work. Rather embarassingly, I can't find the solution after quite a bit of googling.

Thank you for your help!

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Defining matrix of variables in mathematica and solving matrix differential equation

**Physics Forums | Science Articles, Homework Help, Discussion**