optimization for nonlinear equation using fminunc
4 ビュー (過去 30 日間)
古いコメントを表示
i have an equation
. i have to do optimization for this to get unknown parameters z a and b.
,
and
are matrixes of size 364x441.after getting z a and b i have to put those values in above equation to get estimated LHS. how to do this using fminunc funtion in matlab
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431043/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431048/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431053/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431058/image.png)
0 件のコメント
採用された回答
Torsten
2023 年 7 月 10 日
編集済み: Torsten
2023 年 7 月 10 日
x0 = [1 1 1];
fun = @(x) x(1)*dsdt + x(2)*s.^x(3);
f = @(x) sum(sum((fun(x) - p).^2));
x = fminsearch(f,x0)
lhs = fun(x)
5 件のコメント
Torsten
2023 年 7 月 10 日
編集済み: Torsten
2023 年 7 月 10 日
s = load("s.mat");
s = s.s;
s = s(:);
size(s)
idx = s > 0;
s = s(idx);
size(s)
dsdt = load("dsdt.mat");
dsdt = dsdt.dsdt;
dsdt = dsdt(:);
dsdt = dsdt(idx);
p = load("p.mat");
p = p.p;
p = p(:);
p = p(idx);
x0 = [1 1 1];
fun = @(x) x(1)*dsdt + x(2)*s.^x(3);
f = @(x) sum((fun(x) - p).^2);
x = fminsearch(f,x0,optimset('MaxFunEvals',10000,'MaxIter',10000,'Display','iter'))
f(x)
lhs = fun(x)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Nonlinear Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!