How to determine an y value at a specific x value?

조회 수: 1 (최근 30일)
Gloria
Gloria 2022년 8월 12일
편집: Gloria 2022년 8월 12일
How can I find what is e when sm1=8.1813e-13?

채택된 답변

Star Strider
Star Strider 2022년 8월 12일
편집: Star Strider 2022년 8월 12일
Since ‘sm1’ is a function of ‘W1’ this is not as straightforward as it might at first appear.
v1=0.034; %viskozite yağ için 0.034 Pas 50C
v2=0.000594; %viskozite tuzlu su için 0.000481 Pas 50C
N=525/60; %hız (rad(s)
DS=0.022; %stern tube çap
R=0.011; %stern tube yarı çap
D=0.02; %şaftın çapı
L1=R; L2=R*2; L3=R*3; %uzunluk (m)
C=1*10^-3; %
%sm=sommerfield number
e=0.1:0.1:0.9;
%%%%%%%%%%%%%%%%
%%%% short journal bearing %%%%
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% yağ için %%%%%%%%%%%%%%%%
W1 = v1.*N.*R.*L1.*(L1./C).^2.*(e./4).*((16.*e.^2+pi.^2.*(1-e.^2)).^0.5./(1-e.^2).^2);
sm1 = v1.*N.*L1.*R./(4.*W1.*(L1./C).^2);
sm1q = 8.1813e-13;
W1_fcn = @(e) v1.*N.*R.*L1.*(L1./C).^2.*(e./4).*((16.*e.^2+pi.^2.*(1-e.^2)).^0.5./(1-e.^2).^2);
sm1_fcn = @(e) v1.*N.*L1.*R./(4.*W1_fcn(e).*(L1./C).^2); % Create Function
[e_v,fval] = fsolve(@(x)norm(sm1_fcn(x)-sm1q), rand) % Using 'fsolve'
Equation solved at initial point. fsolve completed because the vector of function values at the initial point is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
e_v = 0.9969
fval = 6.4533e-10
% [e_v,fval] = fsolve(@(x)sm1_fcn(x)-sm1q, rand) % Using 'fsolve'
e_q = interp1(sm1, e, sm1q, 'linear','extrap') % Using 'interp1'
e_q = 0.9314
figure
plot(sm1, e)
xlabel('sm1')
ylabel('e')
Check1 = sm1_fcn(e_v) % 'fsolve'
Check1 = 6.4614e-10
Check2 = sm1_fcn(e_q) % 'interp1'
Check2 = 3.3070e-07
There are two different values depending on whether the function is solved numerically or extrapolated, neither of which provides the desired result.
EDIT — (12 Jul 2022 at 13:28)
Changed code to be functions of ‘e’ as stated in this Comment.
.

추가 답변 (2개)

KSSV
KSSV 2022년 8월 12일
Read about interp1

Torsten
Torsten 2022년 8월 12일
편집: Torsten 2022년 8월 12일
sm1 = v1.*N.*L1.*R./(4.*W1.*(L1./C).^2)
gives
W1 = v1.*N.*L1.*R./(4.*sm1.*(L1./C).^2)
  댓글 수: 4
Gloria
Gloria 2022년 8월 12일
I asked the question wrong.
I have graph for (sm1,e) and W1 and sm1 depend on e;
I want to know what is e value for sm1=8.1813e-13
Torsten
Torsten 2022년 8월 12일
편집: Torsten 2022년 8월 12일
v1=0.034; %viskozite yağ için 0.034 Pas 50C
v2=0.000594; %viskozite tuzlu su için 0.000481 Pas 50C
N=525/60; %hız (rad(s)
DS=0.022; %stern tube çap
R=0.011; %stern tube yarı çap
D=0.02; %şaftın çapı
L1=R; L2=R*2; L3=R*3; %uzunluk (m)
C=1*10^-3; %
sm1 = 8.1813e-13;
W1 = @(e) v1.*N.*R.*L1.*(L1./C).^2.*(e./4).*((16.*e.^2+pi.^2.*(1-e.^2)).^0.5./(1-e.^2).^2);
fun = @(e) sm1 - v1.*N.*L1.*R./(4.*W1(e).*(L1./C).^2);
options = optimset('Display','none','TolX',1e-16,'TolFun',1e-16);
format long
e0 = 0.9;
e1 = fsolve(fun,e0,options)
e1 =
0.993503468416158
fun(e1)
ans =
-2.889044323179053e-09
e0 = 1.1;
e2 = fsolve(fun,e0,options)
e2 =
1.006043289756047
fun(e2)
ans =
-2.487888648942313e-09

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Predictive Maintenance Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by