forum.alglib.net http://forum.alglib.net/ |
|
Problem with sparse solver http://forum.alglib.net/viewtopic.php?f=2&t=656 |
Page 1 of 1 |
Author: | Doug Jenkins [ Fri Nov 16, 2012 3:47 am ] | ||
Post subject: | Problem with sparse solver | ||
I have been experimenting with using the sparse solver to analyse structural frames. Results have been generally good, with the solution of a 750x750 matrix coming down from about 2 minutes using a VBA Gaussian Elimination routine to about 0.05 seconds with the C# version of the sparse solver (2500 times faster!). I'm having trouble with a very simple problem used to find the buckling load of straight columns. The column is subdivided into a number of segmemts, and given very small lateral deflections at each node, and adjusted iteratively until the deflected shape matches the bending moment diagram. With 8 segments the sparse solver gives results that are about 60% too small, and returns termination type 7. With 50 segments it takes several seconds to solve, and the results are also wrong, and with 100 segments it fails to converge after several minutes. I have several questions: 1) Is this behaviour expected with the sparse solver with some problems? 2) If so, is there a way to monitor the solution and switch to a different solver if it is not converging? 3) Or is there something wrong with the way I have set the problem up (although the RMatrixSolve routine solves it with no problem)? 4) Any other suggestions? For the buckling problem I will use one of the "dense" solvers, but I am concerned that this sort of behaviour may arise with other problems. I have attached a spreadsheet with an example, including sparse solver solution and the RMatrixSolve results (starting line 32 on the "Solve" sheet).
|
Author: | Sergey.Bochkanov [ Fri Nov 16, 2012 7:42 am ] |
Post subject: | Re: Problem with sparse solver |
Hello! You have very badly conditioned problem - your 8-segment task has condition number about 10^9. CG solver stops either after discovering that problem is ill-conditioned (or after performing a lot of useless iterations). Good news are that most of the ill-conditioning comes from bad scaling of your system. Simple diagonal scaling reduces condition number down to 1000 (or less). Modification of CG seems to be very easy (less than hour of development, several hours of testing). I will prepare fix and send it to you for evaluation today or maybe at Monday. It would be good to hear results on all problems: 8-segment, 50-segment, 100-segment. P.S. thanks for your report of spam attack - I was out of office for several days, and noticed it only today. |
Author: | Doug Jenkins [ Fri Nov 16, 2012 8:35 am ] |
Post subject: | Re: Problem with sparse solver |
I'm impressed with the service! :) I was also impressed with speed increase with the sparse solver. I got about a 50X improvement going from the VBA to the C# dense solver, and about another 50x with the sparse solver. That's with a 1170x1170 matrix. |
Author: | Sergey.Bochkanov [ Mon Nov 19, 2012 11:10 am ] |
Post subject: | Re: Problem with sparse solver |
here are the results :) Archive includes source code of modified ALGLIB (development version, but these modifications will be included in the next release) and precompiled DLL (NET assembly). Can you replace your alglibnet2.dll with precompiled version from archive and report results on your problems? |
Author: | Sergey.Bochkanov [ Tue Nov 20, 2012 5:37 am ] | ||
Post subject: | Re: Problem with sparse solver | ||
Ooops :) I've forgot to attach files....
|
Author: | Doug Jenkins [ Tue Nov 20, 2012 5:47 am ] |
Post subject: | Re: Problem with sparse solver |
Thanks - I won't have much time over the next few days, but I will report back as soon as I can. |
Author: | Doug Jenkins [ Sat Nov 24, 2012 12:35 am ] | |||
Post subject: | Re: Problem with sparse solver | |||
I have now completed a reveiw of the new sparse solver and detailed results, comments and background information are in the attached file (Buckling analysis summary.xlsx). The main findings were: Sparse solver results Results with the new alglibnet2.dll file are much better than the previous version; however: With Load factor = 100: accuracy compared with the dense solver reduces significantly for 8 segments, and is much worse for 16 segments or more. Results with load factor = 10000 and 1E6 are better, but solution time is very slow for 50 segments Results with load factor = 1E8 are very inaccurate, although convergence is reported; presumably the accuracy of the sparse solver is of the same order as the relative deflection between nodes. Solution times where convergence is not achieved is very variable, with a maximum of almost 3 minutes. For this application it seems that the dense solvers are more appropriate, since the analysis is sensitive to very small differences in calculated deflection, and the matrix sizes are not very big anyway, but it does seem to be a good problem to test the limits of the sparse solver. My main concern with the results at the moment is that the solution time is sometimes so long before it reports back non-convergence. I have also attached the Excel file i am using to perform the analysis, and associated .dll and .tlb files. Please let me know if you would like me to look at any other options for the comparative analyses.
|
Author: | Doug Jenkins [ Wed Jan 23, 2013 10:55 am ] |
Post subject: | Re: Problem with sparse solver |
Preliminary tests with the new release (3.7) show much better performance with the sparse solver. With the buckling analysis reported in the previous post it is now successfully converging with up to 200 segments without loss of accuracy. |
Author: | Sergey.Bochkanov [ Mon Jan 28, 2013 8:57 am ] |
Post subject: | Re: Problem with sparse solver |
It is good to hear. Thanks again for your previous report, it led to very important improvements in the CG solver. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |