Quantcast
Viewing all articles
Browse latest Browse all 11560

Re: Optimisation of a variable

Dan Rose wrote:

 

Here's another attempt:

 

Given

r:=10

stress:=1000

stress=r^2  (boolean equals this time)

5<r<20

stress<1

Minerr(stress,r)=(1.962 over 1.71)

 

If I right click Minerr and change to one of the other non-linear methods it gives (8.16 over 3.5) which is a bit closer to the correct answer of (25 over 5)

 

Why does it give these answers?

You have three constarints now and Mathcad tries to minimize the overal errors in all three. You may weight a constraint by multiplying it with a factor higher than 1. Using (1-stress)*1000>0 will multiply the error made in this constraint by thousend, so the answer will consider this constraint more than the others.

 

Results in numeric approximations may highly depend on the guess values used and also may change significantly if the algorithm used is changed. This seems to be what you experience.

 

Usually Levenberg-Marquardt is a good choice, but in case of your solve block Conjugate Gradients seem to be more appropriate. Try it, use stress<30 and you get the (5; 25) answer you expected.

Use stress<50 and you get a different, but still valid solution.


Viewing all articles
Browse latest Browse all 11560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>