Solving an implicit function using Matlab

362 Views Asked by At

In the article in here,, there is a function as (Appendix A, equation (1))
enter image description here.
In order to find k in this function it is mentioned in the article that following implicit function should be solved

enter image description here
The values of $l_0, l_p,r_e, r_h $ are known and the only unknown is k. So, I tried to find the value of k using both Matlab by,

l_0=100;
r_e=log(2)/6;
r_h=log(2)/(21*24);
l_p=10^7;

syms k
eqn = l_p-(k*l_0*((r_e-r_h)*(k-l_0))^(1-(r_h/r_e))/((r_h*l_0)^(-r_h/r_e)*(r_h*l_0*(k-l_0)+l_0*(r_e-r_h)*(k-l_0)))) == 0;
k2 = solve(eqn,k);    

But it doesn't come up with a solution for a long time.
Why is it and how can I fnd the value of k?

1

There are 1 best solutions below

4
On BEST ANSWER

I am not a Matlab user but I suspect that you need a solver to which you can pass an initial estimate.

Using your equation and numbers, we end with $$f(k)=10^7-\frac{\sqrt[42]{5} \,\,83^{83/84}\, k}{42\, 2^{41/42} \,\sqrt[84]{k-100}}$$ and the solution seems to be "around" $k=l_p$.

So, using $k_0=10^7$, Newton iterates are $$\left( \begin{array}{cc} n & k_n \\ 0 & 10^7 \\ 1 & 1.2260991288363371123\times 10^7 \\ 2 & 1.2263832281094110974\times 10^7 \\ 3 & 1.2263832285012184615\times 10^7 \end{array} \right)$$ which is the solution for twenty significant figures.

Changing $l_p$ fro $10^7$ to $10^{15}$, the iterations would be $$\left( \begin{array}{cc} n & k_n \\ 0 & 10^{15} \\ 1 & 1.5296893921874829806\times 10^{15} \\ 2 & 1.5311290105118601855\times 10^{15} \\ 3 & 1.5311290185739798373\times 10^{15} \\ 4 & 1.5311290185739798376\times 10^{15} \end{array} \right)$$

Looking at the online documentation for Matlab , it seems that

 S = vpasolve(eqn,var,init_guess)

would do the job.