Help with inverse logarithm

3 visualizaciones (últimos 30 días)
Abel Corona
Abel Corona el 8 de Nov. de 2019
Respondida: Abel Corona el 8 de Nov. de 2019
I am attempting to solve a problem, but I cannot run my code because of an error. The code below is what I'm trying to run.
% Solve for life using SWT equations for a, b, and c.
Sa = 220; % Stress amplitude in MPa given in problem
Sm = 100; % Given stress as a matlab vector (MPa)
Smax = Sm + Sa; % Calculate maximum stress
b = -0.102; % Correction factor for material
N = ((log(b)\log(10))*((sqrt(Smax*Sa))\Sm))\2; % Lifefor mean stresses using SWT equation
The formula I'm trying to use is down below:
Screen Shot 2019-11-07 at 7.46.35 PM.png
Also, I'm trying to figure out how to run the formula multiple times with different inputs of Sm. Such that Sm = 0, 100, and -100.
Any help will be greatly appreciated!

Respuesta aceptada

Abel Corona
Abel Corona el 8 de Nov. de 2019
Figured it out!
% Solve for life using SWT equations for a, b, and c.
Sa = 220; % Stress amplitude in MPa given in problem
Sm = [0 110 -110]; % Given stress as a matlab vector (MPa)
Sf = 900; % MPa
Smax = Sm + Sa; % Calculate maximum stress
b = -0.102; % Correction factor for material
N = (nthroot((sqrt(Smax*Sa)/Sf),b))/2; % Lifefor mean stresses using SWT equation

Más respuestas (1)

KSSV
KSSV el 8 de Nov. de 2019
Editada: KSSV el 8 de Nov. de 2019
Read about element by element operations in matlab.
% Solve for life using SWT equations for a, b, and c.
Sa = 220; % Stress amplitude in MPa given in problem
% Sm = 100; % Given stress as a matlab vector (MPa)
Sm = [0, 100, -100] ;
Smax = Sm + Sa; % Calculate maximum stress
b = -0.102; % Correction factor for material
N = ((log(b)\log(10))*((sqrt(Smax.*Sa)).\Sm))\2; % Lifefor mean stresses using SWT equation

Categorías

Más información sobre Stress and Strain en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by