fsolve and fimplicit for a non-linear equation
0
$begingroup$
It's well known that from time to time nonlinear solver fsolve in Matlab gives controversial results but I'd like to ask and simultaneously share my experience of the exploitation of this command. I want to solve nonlinear equation and find a function $y=y(x)$ $-Psi(1/2) +{it Re} left( Psi left( 1/2+{ frac { left( 1+i right) tau,tanh left( left( 1+i right) x right) }{y}} right) right) +ln left( y right) =0$ where $Psi(z)$ is the digamma function of a complex argument and $tau$ is a real positive number. Here is my code in Matlab: function z=temperature dd=linspace(0,5,1000); for j=1:1000 if j==1 x0=1; else x0=temp(j-1); end z1=fsolve(@(y) self(y,dd(j)),x0,optimset('Display','off')); temp(j)=z1; end plot(dd,temp,'Color',...