Effacer les filtres
Effacer les filtres

How can I obtain two unknown with one equation through optimization?

1 vue (au cours des 30 derniers jours)
Parham Babakhani Dehkordi
Parham Babakhani Dehkordi le 7 Juil 2016
Modifié(e) : John D'Errico le 7 Juil 2016
Hi, I have one equation with two unknowns(A and y) as follows;
ls/D=A [Jg+(y^2/Jg)] input parameters are: D=0.04; Jg and ls are vectors as;
Jg=[0.574 0.765 0.957 1.148 1.340 1.531 1.722 1.914 2.10]; ls=[0.298 0.304 0.341 0.434 0.473 0.504 0.542 0.559 0.594];
any help would be appreciated.

Réponses (1)

John D'Errico
John D'Errico le 7 Juil 2016
Modifié(e) : John D'Errico le 7 Juil 2016
You do not have ONE equation. You have a set of points, and an equation that relates them, for some unknown set of parameters, A and y. So you can think of this as many equations, with two unknowns.
The technique that is used to solve for those unknown parameters is called curve fitting. In fact, you can (logically) use the curve fitting toolbox. Or you can use tools like lsqnonlin or lsqcurvefit, from the optimization toolbox. Or nlinfit from the stats toolbox.
mdl = fittype('A*(Jg+(Y^2/Jg))','coeff',{'A','Y'},'indep','Jg');
>> res = fit(Jg',ls'/D,mdl)
Warning: Start point not provided, choosing random start point.
> In curvefit.attention.Warning/throw (line 30)
In fit>iFit (line 299)
In fit (line 108)
res =
General model:
res(Jg) = A*(Jg+(Y^2/Jg))
Coefficients (with 95% confidence bounds):
A = 7.003 (6.436, 7.571)
Y = 0.5455 (0.419, 0.672)
>> res.A
ans =
7.0034
>> res.Y
ans =
0.54553

Catégories

En savoir plus sur Nonlinear Optimization dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by