{"action":"created","issue":{"url":"https://api.github.com/repos/lmfit/lmfit-py/issues/280","labels_url":"https://api.github.com/repos/lmfit/lmfit-py/issues/280/labels{/name}","comments_url":"https://api.github.com/repos/lmfit/lmfit-py/issues/280/comments","events_url":"https://api.github.com/repos/lmfit/lmfit-py/issues/280/events","html_url":"https://github.com/lmfit/lmfit-py/issues/280","id":119313908,"number":280,"title":"Fit failures when min/max are used","user":{"login":"CarpeCimex","id":15959379,"avatar_url":"https://avatars.githubusercontent.com/u/15959379?v=3","gravatar_id":"","url":"https://api.github.com/users/CarpeCimex","html_url":"https://github.com/CarpeCimex","followers_url":"https://api.github.com/users/CarpeCimex/followers","following_url":"https://api.github.com/users/CarpeCimex/following{/other_user}","gists_url":"https://api.github.com/users/CarpeCimex/gists{/gist_id}","starred_url":"https://api.github.com/users/CarpeCimex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarpeCimex/subscriptions","organizations_url":"https://api.github.com/users/CarpeCimex/orgs","repos_url":"https://api.github.com/users/CarpeCimex/repos","events_url":"https://api.github.com/users/CarpeCimex/events{/privacy}","received_events_url":"https://api.github.com/users/CarpeCimex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-28T19:22:54Z","updated_at":"2015-12-01T02:29:34Z","closed_at":null,"body":"I'm still experiencing fit failures when I use min/max bounds.  My [original issue](https://github.com/lmfit/lmfit-py/issues/278#issuecomment-158919780) arose because some of my input values are very small (like 1e-11) and the lmfit conversion\r\n\r\n    internal_value =  sqrt( (user_value +1 - min)**2 -1)\r\n\r\nand back was making the fitter think that no progress was being made.\r\n\r\nMy problem consists of fitting electronic circuit component values to measured impedance data.  I can normalize the component values, frequency, and impedance to reduce this bounds problem in some cases, but it's still there.  My normalization options are constrained, to keep the relationship between components, frequency, and impedance correct, so component value differences even after normalization can still be large (sometimes several orders of magnitude).  In other words, I can't always get all normalized component values near 1.\r\n\r\nThe result is that sometimes specifying min/max bounds causes fitting to fail or work poorly, and sometimes not.\r\n\r\nIs it possible to do the `internal_value` calculation differently for each bounded input value, perhaps by using the nominal (guess) value of the bounded variable instead of 1?  I'm not sure that would do it, but something like that might smoothly limit each variable independently and still allow the variables to differ from one another (and from 1) by large amounts."},"comment":{"url":"https://api.github.com/repos/lmfit/lmfit-py/issues/comments/160828058","html_url":"https://github.com/lmfit/lmfit-py/issues/280#issuecomment-160828058","issue_url":"https://api.github.com/repos/lmfit/lmfit-py/issues/280","id":160828058,"user":{"login":"newville","id":304251,"avatar_url":"https://avatars.githubusercontent.com/u/304251?v=3","gravatar_id":"","url":"https://api.github.com/users/newville","html_url":"https://github.com/newville","followers_url":"https://api.github.com/users/newville/followers","following_url":"https://api.github.com/users/newville/following{/other_user}","gists_url":"https://api.github.com/users/newville/gists{/gist_id}","starred_url":"https://api.github.com/users/newville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newville/subscriptions","organizations_url":"https://api.github.com/users/newville/orgs","repos_url":"https://api.github.com/users/newville/repos","events_url":"https://api.github.com/users/newville/events{/privacy}","received_events_url":"https://api.github.com/users/newville/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T02:29:34Z","updated_at":"2015-12-01T02:29:34Z","body":"@CarpeCimex   I'm not sure what the problem here actually is.  You opened and closed #278, and this issue seems like a similar problem, except that (for some reason) none of the obvious options of scaling the variable, giving a larger initial value, or explicitly setting `epsfcn` will solve the issue you're now having, and you cannot (or will not) tell us what that problem is....   But if you tried those earlier suggestions and they don't help, I'm not optimistic that playing with the internals of the bounds implementation is going to help.   Sorry I can't be more helpful, but you've given us very little to go on.\r\n\r\n\r\n\r\n"}}