How can I obtain two unknown with one equation through optimization?
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
John D'Errico
2016년 7월 7일
편집: John D'Errico
2016년 7월 7일
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!