Question: Q3. Write a python code to do the following operations. 0.02 -0.01 0.03 1. Create a stress tensor and a strain tensor in form of

Q3. Write a python code to do the following operations. 0.02 -0.01 0.03 1. Create a stress tensor and a strain tensor in form of NumPy arrays: 1.0 -0.2 0.5 -0.2 4.3 0.0 0.5 5.2 2. The hydrostatic stress is o = -0.01 0.2 -0.05 -0.05 0.4 0.0 0.03 hyd = (quoi and the deviatoric stress is Odev =O- Ohyd. Define a function stress_hyd_dev () which takes in a stress tensor and returns the hydrostatic stress and the deviatoric stress. Then, apply this function to calculate the hydrostatic stress and the deviatoric stress of the stress defined in Question 1. 3. If we rotate the material, the representation of the stress tensor will change. Suppose that the coordinate system is (e1,e2, ez). If we rotate the material about an axis u = (U1, U2, uz) (a unit vector) by the angle 0, the representation of the stress tensor will become d' = Ro, where R is the rotation matrix: cos 0 + u(1 cos ) U1 U2 (1 cos 6) uz sin uju3(1 cos 6) + u2 sin R= U2u1(1 - cos 0) + uz sin cos 0 + u(1 cose) U2u3(1 cos) Uzui(1 cos ) uz sin 0 Uzu2(1 - cos 6) + uj sin 0 cos 0 + u(1 cos 0) Define a function stress_rot() which takes in a stress tensor, rotation axis and rotation angle and returns the stress tensor after rotation. Then, apply this function to calculate the stress tensor after rotating the material about u = (1,1,1) by the angle 1/6. - Uy sin Q3. Write a python code to do the following operations. 0.02 -0.01 0.03 1. Create a stress tensor and a strain tensor in form of NumPy arrays: 1.0 -0.2 0.5 -0.2 4.3 0.0 0.5 5.2 2. The hydrostatic stress is o = -0.01 0.2 -0.05 -0.05 0.4 0.0 0.03 hyd = (quoi and the deviatoric stress is Odev =O- Ohyd. Define a function stress_hyd_dev () which takes in a stress tensor and returns the hydrostatic stress and the deviatoric stress. Then, apply this function to calculate the hydrostatic stress and the deviatoric stress of the stress defined in Question 1. 3. If we rotate the material, the representation of the stress tensor will change. Suppose that the coordinate system is (e1,e2, ez). If we rotate the material about an axis u = (U1, U2, uz) (a unit vector) by the angle 0, the representation of the stress tensor will become d' = Ro, where R is the rotation matrix: cos 0 + u(1 cos ) U1 U2 (1 cos 6) uz sin uju3(1 cos 6) + u2 sin R= U2u1(1 - cos 0) + uz sin cos 0 + u(1 cose) U2u3(1 cos) Uzui(1 cos ) uz sin 0 Uzu2(1 - cos 6) + uj sin 0 cos 0 + u(1 cos 0) Define a function stress_rot() which takes in a stress tensor, rotation axis and rotation angle and returns the stress tensor after rotation. Then, apply this function to calculate the stress tensor after rotating the material about u = (1,1,1) by the angle 1/6. - Uy sin
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
