Help with inverse logarithm

조회 수: 3 (최근 30일)
Abel Corona
Abel Corona 2019년 11월 8일
답변: Abel Corona 2019년 11월 8일
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!

채택된 답변

Abel Corona
Abel Corona 2019년 11월 8일
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

추가 답변 (1개)

KSSV
KSSV 2019년 11월 8일
편집: KSSV 2019년 11월 8일
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

카테고리

Help CenterFile Exchange에서 Stress and Strain에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by