Unable to find explicit solution

Matlab says "Unable to find explicit solution" when trying to solve following non linear equation
-log(y) = psi(1/2+ x/y) - psi(1/2)
Here psi is digamma function
What is wrong with my code, below?
I am using matlab version R2021a
syms x y
eqn = psi(1/2 + x/y)- psi(1/2)+ log(y)==0;
soly = solve(eqn,y)
Warning:
Unable to find explicit solution. For options, see help.
> In sym/solve (line 317)
soly =
Empty sym: 0-by-1

2 Comments

It seems very plausible to me that an explicit solution does not exist. Do you have reason to think otherwise?
Thank you for the reply.
I see explicit solution doesn't exist.
That means in order to plot y vs x I should assigned the value of x and solve for y right?

Sign in to comment.

 Accepted Answer

Matt J
Matt J on 1 Apr 2021
You can use fimplicit.

9 Comments

Alright and thank you
You're welcome, but if fimplicit does what you need, please Accept-click this answer.
Actually I am interested in a plot of y versus x .
Like I said earlier, I took 6 x points and used them to find corresponding y solutions using vpasolve command but it turns out that plot didn't match with the one in the paper. The paper says they obtained plot from solving equation self consistently.
I used following code
syms x y nw;
nw=6;
x=[0.00 0.12 0.14 0.16 0.18 0.20];
gv=zeros(1,nw);
for i=1:nw
[gv(i)] = vpasolve(psi(1/2 + x(i)/y)- psi(1/2)+ log(y)==0,y);
end;
gv
plot(x,gv)
Could you please let me know where is my error?
If the idea is to generate a plot, I don't know why aren't using fimplicit like I suggested. It generates a reasonable looking plot for me quite readily:
f=@(x,y) psi(1/2+ x./y) - psi(1/2) + log(y);
fimplicit(f)
xlabel 'x', ylabel 'y'
axis([0,0.14,0, 1]);
Thank you for your constant help and now I used fimplicit like you suggested.
Running of following code gave me a plot which didn't match with the attached plot the one from the paper. I am trying to get first plot and interested in Ts and Tc for now.
f=@(x,y) psi(1/2+2.2*x./y) - psi(1/2) + log(y/3);
fimplicit(f)
figure(1);
%xlabel 'x', ylabel 'y'
axis([0,0.18,0, 3]);
hold on
g=@(x,y) psi(1/2+ x./y) - psi(1/2) + log(y);
fimplicit(g)
figure(2);
%xlabel 'x', ylabel 'y'
axis([0,0.14,0, 1]);
hold on
On varying x from 0 to 0.14 there should be only one phase then mixed phase for certain x and other phase after increasing x.So how can someone generate the plot like the first figure?
Here's what I get.
f=@(x,y) psi(1/2+2.2*x./y) - psi(1/2) + log(y/3);
g=@(x,y) psi(1/2+ x./y) - psi(1/2) + log(y);
fimplicit(f)
hold on
fimplicit(g)
hold on
axis([0.11,0.19,0, 2]);
Tiku
Tiku on 2 Apr 2021
Edited: Tiku on 2 Apr 2021
Thank you for your help but I am still wondering how to get like the plot in the paper?
My apology in the first equation 0.2 value was missing which makes full code now
f=@(x,y) psi(1/2+2.2*x./y) - psi(1/2) + log(y/3);
g=@(x,y) psi(1/2+0.2*x./y) - psi(1/2) + log(y);
fimplicit(f)
hold on
fimplicit(g)
hold on
axis([0.11,0.19,0, 2]);
The above code gave two intersecting curves but still both phases are apppearing in left-right and up-down of the plot which doesn't match with the paper.
We've no reason to trust the paper more than Matlab...
I totally agree Matlab calulation is right. Actually after the plot I have to use some physics to ignore certain parts of the plot so at this stage both Matlab and paper is right.
So I really apppreciate your help and thank you.

Sign in to comment.

More Answers (0)

Asked:

on 1 Apr 2021

Commented:

on 4 Apr 2021

Community Treasure Hunt

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

Start Hunting!