how to find value of variable in natural logarithmic

조회 수: 2 (최근 30일)
ibrahim alzoubi
ibrahim alzoubi 2021년 4월 30일
댓글: ibrahim alzoubi 2021년 4월 30일
How to find value of X:
ln(X/0.466)*66.66+X*4.4805*10^(-4)+X=5.66
  댓글 수: 4
Star Strider
Star Strider 2021년 4월 30일
I would use fsolve, since it would appear to have at most only one root.
Remember to use log, not ln in your code.
Scott MacKenzie
Scott MacKenzie 2021년 4월 30일
hint #1: e^(ln(x)) = x
hint #2: e^(ln(y) + ln(z)) = y * z

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

답변 (1개)

DGM
DGM 2021년 4월 30일
편집: DGM 2021년 4월 30일
This can be done a number of ways. It's a log plus a positive linear function of x. There will be only one solution. That makes everything easier.
% solving symbolically
syms X
eqn = log(X/0.466)*66.66+X*4.4805*10^(-4)+X==5.66;
aaa = double(solve(eqn,X))
% or using fsolve
f = @(x) log(x/0.466)*66.66 + x*4.4805*10^(-4) + x - 5.66;
bbb = fsolve(f,1)
% or using fzero
ccc = fzero(f,1)
% do the answers make sense? check it graphically
x = linspace(0.2,1,100);
y = log(x/0.466)*66.66 + x*4.4805*10^(-4) + x;
plot(x,y); hold on
plot([0.2 1],[1 1]*5.66)
plot(aaa,5.66,'bo')
plot(bbb,5.66,'ko','markersize',10)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by