// Numbas version: exam_results_page_options {"name": "Principal Stresses", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Principal Stresses", "tags": [], "metadata": {"description": "

Find principal stresses by finding the eigenvalues of the matrix

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Solve to find the principal stresses by finding the eigenvalues of the matrix.

", "advice": "

In Python, the solution should look something like this:

\n
import numpy as np\n
S = np.asarray([[{siground(sigma_3[0][0],5)},{siground(sigma_3[0][1],5)},{siground(sigma_3[0][2],5)}],[{siground(sigma_3[1][0],5)},{siground(sigma_3[1][1],5)},{siground(sigma_3[1][2],5)}],[{siground(sigma_3[2][0],5)},{siground(sigma_3[2][1],5)},{siground(sigma_3[2][2],5)}]])

values, vectors = np.linalg.eig(S)

# sort values from low to high
principals = np.sort(values)

print('Maximum principal stress = %.3g MPa.' % principals[2])
print('Middle  principal stress = %.3g MPa.' % principals[1])
print('Minimum principal stress = %.3g MPa.' % principals[0])
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"sigma_max": {"name": "sigma_max", "group": "Ungrouped variables", "definition": "random(4..10)", "description": "", "templateType": "anything", "can_override": false}, "sigma_min": {"name": "sigma_min", "group": "Ungrouped variables", "definition": "random(-10..-4)", "description": "", "templateType": "anything", "can_override": false}, "sigma_mid": {"name": "sigma_mid", "group": "Ungrouped variables", "definition": "random(-3..3)", "description": "", "templateType": "anything", "can_override": false}, "sigma": {"name": "sigma", "group": "Ungrouped variables", "definition": "matrix([sigma_max,0,0],[0,sigma_mid,0],[0,0,sigma_min])", "description": "", "templateType": "anything", "can_override": false}, "theta_xy": {"name": "theta_xy", "group": "Ungrouped variables", "definition": "random(1..17)*10*pi/180", "description": "", "templateType": "anything", "can_override": false}, "theta_yz": {"name": "theta_yz", "group": "Ungrouped variables", "definition": "random(1..17)*10*pi/180", "description": "", "templateType": "anything", "can_override": false}, "theta_zx": {"name": "theta_zx", "group": "Ungrouped variables", "definition": "random(1..17)*10*pi/180", "description": "", "templateType": "anything", "can_override": false}, "R_xy": {"name": "R_xy", "group": "Ungrouped variables", "definition": "matrix([cos(theta_xy),sin(theta_xy),0],[-sin(theta_xy),cos(theta_xy),0],[0,0,1])", "description": "", "templateType": "anything", "can_override": false}, "R_yz": {"name": "R_yz", "group": "Ungrouped variables", "definition": "matrix([1,0,0],[0,cos(theta_yz),sin(theta_yz)],[0,-sin(theta_yz),cos(theta_yz)])", "description": "", "templateType": "anything", "can_override": false}, "R_zx": {"name": "R_zx", "group": "Ungrouped variables", "definition": "matrix([cos(theta_zx),0,-sin(theta_zx)],[0,1,0],[sin(theta_zx),0,cos(theta_zx)])", "description": "", "templateType": "anything", "can_override": false}, "sigma_1": {"name": "sigma_1", "group": "Ungrouped variables", "definition": "transpose(R_xy)*sigma*R_xy", "description": "", "templateType": "anything", "can_override": false}, "sigma_2": {"name": "sigma_2", "group": "Ungrouped variables", "definition": "transpose(R_yz)*sigma_1*R_yz", "description": "", "templateType": "anything", "can_override": false}, "sigma_3": {"name": "sigma_3", "group": "Ungrouped variables", "definition": "transpose(R_zx)*sigma_2*R_zx", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["sigma_max", "sigma_min", "sigma_mid", "sigma", "theta_xy", "theta_yz", "theta_zx", "R_xy", "R_yz", "R_zx", "sigma_1", "sigma_2", "sigma_3"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the principal stresses for the following stress state:

\n

$\\sigma = \\var{siground(sigma_3,5)}$ [MPa]

\n
    \n
  1. Maximum principal stress: $\\sigma_\\text{max}=$ [[0]] [MPa]
  2. \n
  3. Middle principal stress: $\\sigma_\\text{middle}=$ [[1]] [MPa]
  4. \n
  5. Minimum principal stress: $\\sigma_\\text{min}=$ [[2]] [MPa]
  6. \n
", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "smax", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "sigma_max-0.01", "maxValue": "sigma_max+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "smid", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "sigma_mid-0.01", "maxValue": "sigma_mid+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "smin", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "sigma_min-0.01", "maxValue": "sigma_min+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Francis Franklin", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1887/"}]}]}], "contributors": [{"name": "Francis Franklin", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1887/"}]}