Help with inverse logarithm

6 views (last 30 days)
Abel Corona
Abel Corona on 8 Nov 2019
Answered: Abel Corona on 8 Nov 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!

Accepted Answer

Abel Corona
Abel Corona on 8 Nov 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

More Answers (1)

KSSV
KSSV on 8 Nov 2019
Edited: KSSV on 8 Nov 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

Categories

Find more on Stress and Strain in Help Center and File Exchange

Tags

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!