From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 2732/CH2/EX2.7/Ex2_7.sce | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 2732/CH2/EX2.7/Ex2_7.sce (limited to '2732/CH2/EX2.7/Ex2_7.sce') diff --git a/2732/CH2/EX2.7/Ex2_7.sce b/2732/CH2/EX2.7/Ex2_7.sce new file mode 100755 index 000000000..9bece8d3a --- /dev/null +++ b/2732/CH2/EX2.7/Ex2_7.sce @@ -0,0 +1,31 @@ +clc +// initialization of variables +clear +tau=[200 100 0 + 100 0 0 + 0 0 500] // some units +theta=60 // degrees +//calculations +theta=theta*%pi/180 +a=[cos(theta) sin(theta) 0 + -sin(theta) cos(theta) 0 + 0 0 1] +b=a.' +tau_new=a*tau*b + +// stress invariants :old +I1=tau(1,1)+tau(2,2)+tau(3,3) +I2=tau(1,1)*tau(2,2)+tau(2,2)*tau(3,3)+tau(3,3)*tau(1,1)-(tau(1,2)^2+tau(2,3)^2+tau(3,1)^2) +I3=tau(1,1)*tau(2,2)*tau(3,3)+2*tau(1,2)*tau(2,3)*tau(3,1)-(tau(1,1)*tau(2,3)^2+tau(2,2)*tau(3,1)^2+tau(3,3)*tau(1,2)^2) + +// stress invariants :new +I11=tau_new(1,1)+tau_new(2,2)+tau_new(3,3) +I22=tau_new(1,1)*tau_new(2,2)+tau_new(2,2)*tau_new(3,3)+tau_new(3,3)*tau_new(1,1)-(tau_new(1,2)^2+tau_new(2,3)^2+tau_new(3,1)^2) +I33=tau_new(1,1)*tau_new(2,2)*tau_new(3,3)+2*tau_new(1,2)*tau_new(2,3)*tau_new(3,1)-(tau_new(1,1)*tau_new(2,3)^2+tau_new(2,2)*tau_new(3,1)^2+tau_new(3,3)*tau_new(1,2)^2) + +// Results +printf('The invariants of old stress tensor are I1=%0.2f I2=%.e I3=%.e \n and that of the new stress tensor are I1=%0.2f I2=%.e I3=%.e',I1,I2,I3,I11,I22,I33) +printf('\n Hence the same stress tensor invariants') + + + -- cgit