Q3. Write a python code to do the following operations. 1. Create a stress tensor and a strain tensor in form of NumPy arrays: 1.0 -0.2 0.5 a= -0.2 4.3 0.0 0.5 0.0 5.2, 2. The hydrostatic stress is ayd 0.02 -0.01 0.03 0.2 -0.05 = -0.01 0.03 - (100) 1. -0.05 0.4 and the deviatoric stress is dey-hyd 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 (e₁,e.es). If we rotate the material about an axis - (₁.2. My) (a unit vector) by the angle e, the representation of the stress tensor will become o-Ro, where R is the rotation matrix cos@+u(1-cos) R=(1-cos) + ay sin ₁₂(1-cos 9)-, sin cos@+(1-cos) uyu(1-cos)+u, sin 6 (1-cos@)-₂ sine cos+u(1-cos) 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 x/6. uu(1-cos) + ₂ sin ₂(1-cos)-₁ sin
Q3. Write a python code to do the following operations. 1. Create a stress tensor and a strain tensor in form of NumPy arrays: 1.0 -0.2 0.5 a= -0.2 4.3 0.0 0.5 0.0 5.2, 2. The hydrostatic stress is ayd 0.02 -0.01 0.03 0.2 -0.05 = -0.01 0.03 - (100) 1. -0.05 0.4 and the deviatoric stress is dey-hyd 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 (e₁,e.es). If we rotate the material about an axis - (₁.2. My) (a unit vector) by the angle e, the representation of the stress tensor will become o-Ro, where R is the rotation matrix cos@+u(1-cos) R=(1-cos) + ay sin ₁₂(1-cos 9)-, sin cos@+(1-cos) uyu(1-cos)+u, sin 6 (1-cos@)-₂ sine cos+u(1-cos) 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 x/6. uu(1-cos) + ₂ sin ₂(1-cos)-₁ sin
Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 5GZ
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage