4
$\begingroup$

I have a system of 4 equations which is the following :

CL1 = A2 + A4 == 0

CL2 = A1 + A3 == 0

CL3 = A2 Cos[L/lambda] + A1 Sin[L/lambda] ==  A4 Cosh[L/lambda] + A3 Sinh[L/lambda]

CL4 = A1 Cos[L/lambda] == A3 Cosh[L/lambda] + A2 Sin[L/lambda] + A4 Sinh[L/lambda]

I would like to transform into a system in the form A*X = 0

with X a vector (or list) like

X = {A1,A2,A3,A4}

May you help me to do this transformation that is to say to transform linear equation in a linear matrix form?

$\endgroup$
6
$\begingroup$

You can use CoefficientArrays

cArray = CoefficientArrays[{CL1, CL2, CL3, CL4}, {A1, A2, A3, A4}] // Normal;
cArray[[2]] // MatrixForm

$\begin{pmatrix} 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ \sin \left(\frac{L}{\text{lambda}}\right) & \cos \left(\frac{L}{\text{lambda}}\right) & -\sinh \left(\frac{L}{\text{lambda}}\right) & -\cosh \left(\frac{L}{\text{lambda}}\right) \\ \cos \left(\frac{L}{\text{lambda}}\right) & -\sin \left(\frac{L}{\text{lambda}}\right) & -\cosh \left(\frac{L}{\text{lambda}}\right) & -\sinh \left(\frac{L}{\text{lambda}}\right) \\ \end{pmatrix}$

$\endgroup$

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.