Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

What to do when solver gets stupid

Status
Not open for further replies.

electricpete

Electrical
May 4, 2001
16,774
Usually solver does what you expect it to do.

Recently I worked a problem with a lot of input variables where solver got really stupid. It would leave one input variable exactly where I put the initial guess, no matter what. Manually changing that one variable by a small amount(with no other changes) was all that was required to improve the minimization problem, but solver wouldn't do it.

Then I looked at the solver options:
Estimates:Tangent
Derivatives:Forward
Search: Conjugate.

I changed search from Conjugate to Newton and then immediately it solved the problem very accurately.

Strange experience. The help doesn't give you any clue that conjugate is stupid, but that is my conclusion. At any rate if solver doesn't work, try playing with those options.



=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
A more germane question might be why your solver was set to conjugate in the first place, since Newton is supposed to be the default.

TTFN

FAQ731-376
 
Different numerical solving method behave differently. Some converge and find solution and some don't. It depends on the type of differential equations, initial conditions, first guesses value, etc., that are involved in the type of problem. To efficiently and intelligently use built in solver tools the users should have at least the basic knowledge of numerical analysis theory.
 
That assumes that the problem being solved is well formed.

Since an excel system of equation could easily include formulae like

=if(c5>8, 9,c5/2)

or worse, then a scattergun approach to the solver algorithm might be appropriate. It's a shame they didn't include a Monte Carlo solver, that is my usual approach to uncooperative problems.

Actually even legitimate engineering problems like solving 4 bar links seems to be beyond the solver, normally. (That is given these fixed hardpoints and these that can be changed, find a linkage that satisfies these criteria...)





Cheers

Greg Locock

SIG:please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Here's what solver help says:
Newton Uses a quasi-Newton method that typically requires more memory but fewer iterations than the Conjugate gradient method.

Conjugate Requires less memory than the Newton method but typically needs more iterations to reach a particular level of accuracy. Use this option when you have a large problem and memory usage is a concern, or when stepping through iterations reveals slow progress.
The problem was solved by Newton but not by Conjugate. It didn't time out on iterations (I let it continue). There is no reason I see in the help description to suggest that one method will fail where the other method works. And in this case I'm telling you the failure of Conjugate was dismal (only one variable needed to be changed to improve the solution... solver never changede that variable). I would humbly suggest Greg if you have a problem that you think is beyond solver - try changing those options around. That was the point of my post. The results were quite surprising to me in this case.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Oh I aways flip them around if the thing won't solve, but a 4 bar linkage is a well known problem, and I know that solver doesn't handle it well.



Cheers

Greg Locock

SIG:please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
OK, you were ahead of me. I had never played with those options before. I don't know whether the setting got changed recently or a long time ago but it caused me a lot of grief. Now I know.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor