Im trying to solve an equation that have variable on left and right side

조회 수: 7 (최근 30일)
How do I solve this equation? I'm giving the important information also.
depth= 1385.33
por=0.153
Qv=0.980
B=3200
Rw=0.265
m=1.86
n=2.2
Rt=4.05
Sw=(Rw/((por^m)*Rt*(1+(B*Qv*Rw)/Sw)))^(1/n)

채택된 답변

John D'Errico
John D'Errico 2020년 5월 23일
편집: John D'Errico 2020년 5월 23일
How is depth relevant to anything here? It does not appear in the expression. Maybe I'm just not thinking very "deeply" today.
If Sw appears on both sides of the equality, surely you can subtract Sw? Just move everything to the same side. WTP?
por=0.153;
Qv=0.980;
B=3200;
Rw=0.265;
m=1.86;
n=2.2;
Rt=4.05;
fun = @(Sw) Sw - (Rw./((por^m)*Rt*(1+(B*Qv*Rw)./Sw))).^(1/n);
Note that for Sw <= 0, you either have a divide by zero at Sw == 0, or a complex result. So If any real solution exists, it must be for positive Sw.
Also note the use of ./ and .^ where necessary in fun. Does a solution exist? PLOT IT!
fplot(fun,[0,0.01])
yline(0);
It looks like a positive solution exists near 0.007.
[Swsol,fval] = fzero(fun,0.007)
Swsol =
0.00698017018548943
fval =
8.67361737988404e-19
We could also do this using symbolic tools. No analytical solution will exist because of the non-integer power.
syms Sw
vpasolve(fun(Sw))
ans =
0.006980170185489425081287353
No other positive root will exist. That should be not too difficult to prove.
  댓글 수: 2
Hamid Hamdi
Hamid Hamdi 2020년 5월 28일
편집: Hamid Hamdi 2020년 5월 28일
Yes the depth is no use it is just in my assignment. Actually the Rt has table. It has a lot of values.btw how do you determine the value of 0.01 at the fun? Thank you for you solution!
Walter Roberson
Walter Roberson 2020년 5월 28일
If this is a fitting process to determine the optimal Sw, then you would use different code.
You indicate that you have multiple Rt values; for a fitting you would also need multiple values of some other variable -- you need one more more independent variables and one or more dependent variables.

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

추가 답변 (3개)

Ameer Hamza
Ameer Hamza 2020년 5월 23일
편집: Ameer Hamza 2020년 5월 23일
This is one of the methods
syms Sw
depth= 1385.33;
por=0.153;
Qv=0.980;
B=3200;
Rw=0.265;
m=1.86;
n=2.2;
Rt=4.05;
eq = Sw==(Rw/((por^m)*Rt*(1+(B*Qv*Rw)/Sw)))^(1/n);
sol = vpasolve(eq, Sw)
  댓글 수: 1
Hamid Hamdi
Hamid Hamdi 2020년 5월 28일
Hi Ameer. Thanks for the answer. This is the simple way to understand it. The Rt actually have a lot of values and I'll try to adjust the equation. And I'll try to understand the function u show. Thank you again!

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


Walter Roberson
Walter Roberson 2020년 5월 23일
depth= 1385.33
por=0.153
Qv=0.980
B=3200
Rw=0.265
m=1.86
n=2.2
Rt=4.05
F = @(Sw) (Sw) - ((Rw/((por^m)*Rt*(1+(B*Qv*Rw)/Sw)))^(1/n));
Sw = fsolve(F, 1.234)
  댓글 수: 2
Hamid Hamdi
Hamid Hamdi 2020년 5월 28일
I tried this before but it doesn't work.is it because I used the syms fucntion and then used the F. Then I fixed by removing the syms after saw your solution and it gives NaN as answer. Btw how you determine the value of 1.234? Is it random or there is a way to determine it?
Walter Roberson
Walter Roberson 2020년 5월 29일
1.234 was an arbitrary starting point.

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


N Sudharshan
N Sudharshan 2023년 8월 22일
편집: Torsten 2023년 8월 22일
clear all %% solve for SN %%
Z=-1.282;
S=0.5;
PSI=1.9;
M=1000;
W=1000000;
syms SN
eqn = log10(W)==Z*S+9.36*log10(SN+1)-0.20+((log10(PSI/(4.2-1.5)))/(0.40+(1094/(SN+1)^5.19)))+2.32*log10(M)-8.07
eqn = 
solve(eqn)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
ans = 
6.7204987373948491848493261537531

카테고리

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