Problem with fmincon in case of using variables have various order
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have 3 parmeters (a, b,c )to be regressed for each n,m pair of components
the problem is that, the solver stay very close to intial guesses of a and b but in case of c it makes a good move.
my qustion is , is it posible that the solver focused on the c, becouse it ismakes the segnificat change on the equation? and why is that happend with fmincon ? and how can I solve this problem?
0 commentaires
Réponses (1)
Peter O
le 7 Juil 2021
Modifié(e) : Peter O
le 7 Juil 2021
Ghost,
Good observations. Yes, c has the greatest sensitivity. Sometimes it's possible to get a better fit by massaging the inputs to the fit mathematically. In this case, you could take the natural logarithm of the output data if you're very sure in your measurement accuracy of ψ. Then you're fitting:
which could be much better behaved because its inputs are an inverse term, a slope, and an intercept. Depending on the range of the data and how linear it appears, a could still be negligible, or it could be substantial. In this form you've got one term proportional to T, one that is inversely proportional to T, and a third one that sets the offset of the whole function, which might work pretty nice!
Again to hammer back on the measurement accuracy, by taking the logarithm, you're de-emphazing some of the variation across the output points to tease out some clearer behavior of the inputs. It's possible that the constants you obtain will be less effective against new data for the fitted curve -- it's always helpful to have a few extra points that don't contribute to the fit to test out its validity.
(Edit: Sign error)
2 commentaires
Peter O
le 7 Juil 2021
Do you have the constraint requirements that fmincon is designed to handle? From what you've posted, your coefficients appear free to vary. Try fsolve. You'll need to reformulate the expression to a function that outputs zero when perfectly converged, which for the equation above is:
You'll just need to look at your data to decide on a good initial guess for a, b, and c.
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!