%
%  matlab routine to invert the stress versus strain matrix
%
%  elastic constants
%
clear;
la=sym('la');
mu=sym('mu');
E=mu*(3*la+2*mu)/(la+mu);
nu=la/(2*(la+mu));
%
%  forward strain to stress
%
A=[la+2*mu,    la,            la;
   la,         la+2*mu,       la;
   la,	       la,            la+2*mu];
%
%  invert the tensor
%
B=inv(A);
%
%  multiply by Young's modulus and look at the terms. 
%
EB = E*B
%
% divide by nu to be sure the terms are Poisson's ratio
%
simplify(EB/nu)
%
%  multiply to get the identity matrix
%
C=B*A;
simplify(C)
