Question

In: Computer Science

Implement the working of a mohr circle in matlab. ask user to enter the stresses in...

Implement the working of a mohr circle in matlab. ask user to enter the stresses in x and y direction. take the inputs to a stress tensor. then use formulations to find the eigen value and vectors.

MATLAB

Solutions

Expert Solution

% Center of Mohr Circle

sigma_x =input('Enter value of stress in x direction in N/mm2: ');

sigma_y = input('Enter value of stress in y direction in N/mm2: ');

sigma_c = (sigma_x+sigma_y)/2;

% Center = (sigma_c,0)

shear_t = input('Enter value of shear stress in N/mm2: ');

% Radius of Mohr Circle

r = sqrt(((sigma_x-sigma_y)/2)^2+shear_t^2);

twotheta = atan(shear_t/((sigma_x-sigma_y)/2));

theta = twotheta/2;

theta_2 = 0:1:360;

theta_2 = theta_2.*pi/180;

x = r*cos(theta_2)+sigma_c;

y = r*sin(theta_2);

sigma_1 = max(x);

sigma_2 = min(x);

Sx = [sigma_x shear_t];

Sy = [sigma_y -shear_t];

% all points together

allpoints = [sigma_c 0; sigma_1 0; sigma_2 0; sigma_x shear_t; sigma_y -shear_t];

plot(sigma_1,0,'o','LineWidth',2,'color','k')

hold on

plot(sigma_2,0,'o','LineWidth',2,'color','k')

plot(sigma_c,0,'o','LineWidth',2,'color','k')

plot([Sx(:,1) Sy(:,1)],[Sx(:,2) Sy(:,2)],'LineWidth',2,'color','k')

plot(x,y)

labels = {'C','P Str','P Str','B','A'};

labelpoints(allpoints(:,1), allpoints(:,2),labels,'SE',0.5,1)

grid on

axis equal

Note: Plzzz don' t give dislike.....Plzzz comment if u have any problem i will try to resolve it.......


Related Solutions

Python3 Write a program to implement the Pokemon game should ask the user to enter their...
Python3 Write a program to implement the Pokemon game should ask the user to enter their type and compare it with a randomly chosen computer type and correctly display who wins/ties.
In MatLab 1. Ask the user to enter a 1 x 5 vector of numbers. Determine...
In MatLab 1. Ask the user to enter a 1 x 5 vector of numbers. Determine the size of the user entry. 2. Ask the user to enter a 1 x 5 vector of numbers. Determine the size of the user entry. If the user enters a 5 x 1 vector, use a warning statement to inform the user of their error, and set the new input value to be the transpose of the user input value. If the user...
PYTHON Ask the user to enter the number of students in the class. Thereafter ask the...
PYTHON Ask the user to enter the number of students in the class. Thereafter ask the user to enter the student names and scores as shown. Output the name and score of the student with the 2nd lowest score. NOTE: You may assume all students have distinct scores between 0 and 100 inclusive and there are at least 2 students NOTE: You may only use what has been taught in class so far for this assignment. You are not allowed...
USE MATLAB Write a program in Matlab that would continuously ask the user for an input...
USE MATLAB Write a program in Matlab that would continuously ask the user for an input between 1 and 6, which would represent the result of rolling a die. The program would then generate a random integer between 1 and 6 and compare its value to the value entered by user. If the user’s die is larger, it should display, “Mahahanap mo na ang forever mo. Sana all!” If the user’s die is smaller, it should display, “Gising na friend,...
Write a program that will ask the user to enter the amount of a purchase. The...
Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the...
// This program ask the user to enter a character. It then performs a // linear...
// This program ask the user to enter a character. It then performs a // linear search on a character array and display the number of times // that the character appears on the array. If the character is not in the // array, then it will display a message saying that is was not found. // Add the necessary code for the program to work. // NOTE: // You don't have to edit anything in the main(), just in...
MATLAB The user is supposed to enter either a ‘yes’ or ‘no’ in response to a...
MATLAB The user is supposed to enter either a ‘yes’ or ‘no’ in response to a prompt. The script will print “OK, continuing” if the user enters either a ‘y’, ‘Y’,'Yes', or 'yes' or it will print “OK, halting” if the user enters a ‘n’, ‘N’, 'No', or 'no' or will print “Error” if the user enters anything else. Code this twice once with if and once with switch: Then recode the example above to keep prompting until an an...
I need to ask a user what numbers they want to enter. They can enter as...
I need to ask a user what numbers they want to enter. They can enter as many as they like. Then inside I need to use conditionals to determine if the numbers are <=20, <=323 && > 30, >200. I can't figure out how to let the user enter as many inputs as they want. I know I need to use a loop to check each number entered and determine if it is small middle or greater but I can't...
In C# When the user enters an invalid value, ask the user to repeatedly enter the...
In C# When the user enters an invalid value, ask the user to repeatedly enter the value until a valid value has been entered. Gender must be ‘M’ or ‘F’. Residency must be ‘I’ or ‘O’. Existing Code: using System; public class Student {   public int credit;   public String firstname, lastname, gender, residency, edate;   public void input()   {     Console.WriteLine("\nWelcome to the Continental University Registration System!"); Console.WriteLine("\nEnter data about a student"); Console.Write("First Name: "); firstname = Console.ReadLine(); Console.Write("Last Name: "); lastname...
Your Application should ask the user to enter their name and their salary.
Create a C# Console Application, name the solution Homework 6 and the project TaxRate.Your Application should ask the user to enter their name and their salary. Your application should calculate how much they have to pay in taxes each year and output each amount as well as their net salary (the amount they bring home after taxes are paid!). The only taxes that we will consider for this Application are Federal and FICA. Your Application needs to validate all numeric...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT