Bill Allombert on Tue, 26 May 2015 20:24:54 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Solving two-dimensional systems |
On Tue, May 26, 2015 at 11:16:12AM -0400, Charles Greathouse wrote: > In computing https://oeis.org/A258042 I found myself solving this > two-dimensional system: > > solve(a=1.7, 1.8, my(x=solve(y=1.8, 2, > y*(a+y)*log(a+y)-(a+y^2)*log(a+y^2))); log(a+x^2)/log(a+x)^2-1) > > Is there any better way to do this than nested solve() calls? First, you can simplify to solve(a=1.7,1.8,my(x=solve(y=1.8,2, y*(a+y)-(a+y^2)*log(a+y)));log(a+x^2)-log(a+x)^2) Secondly, you could use a two dimensional Newton iteration: Set: F(a,x)=(x*(a+x)-(a+x^2)*log(a+x),log(a+x^2)-log(a+x)^2) Compute the differential dF so that F(a+h1,x+h2)=F(a,x)+dF(a,x)*[h1,h2]~+O(||(h1,h2)||^2) Solve 0=F(a,x)+dF(a,x)*[h1,h2]~ for h1, h2 and Iterate. If that does not converge, replace the system by an equivalent one so that it does. Cheers, Bill.