Help with inverse logarithm

6 ビュー (過去 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 Center および File ExchangeStress and Strain についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by