How to implement numerical solvers
显示 更早的评论
Sorry! It turned out I just needed to focus on it more myself, a little too niche! Thank you all for the help.
7 个评论
John D'Errico
2022-1-29
Confusing. I assume from the notation, this probably lives in some engineering context, but that is not clear.
Regardless, you don't say what the equation has to do with the plot, which is seemingly unrelated, as that equation is not directly going to generate that plot or anything like it. You do not indicate what you want to optimize, or what form of data you are trying to fit.
If you want help, then you need to make it possible to get help. And that means asking a clear question.
Kevin Hanekom
2022-1-29
Star Strider
2022-1-29
What are the σ values (
to
)?
Are they constants or do they change between (or within) the function calls? If they change, how are they calculated? Are they matrix elements?
Kevin Hanekom
2022-1-29
Kevin Hanekom
2022-1-29
Kevin Hanekom
2022-1-29
Image Analyst
2022-4-19
@Kevin Hanekom, so did Star's answer below solve it???
回答(1 个)
The function needs to be changed so that it accepts one vector of parameters (‘b’ here) and produces a scalar value for ‘S’. Just now, it does not, and returns ‘S’ as a matrix:
b = rand(3,1)
[S] = YieldCriteriaOptimization(b)
function [S] = YieldCriteriaOptimization(b)
ZZ = b(1);
psi = b(2);
max = b(3);
Ry = [ cosd(ZZ) 0 sind(ZZ) ; 0 1 0; -sind(ZZ) 0 cosd(ZZ)];
Rz = [cosd(psi) -sind(psi) 0 ; sind(psi) cosd(psi) 0; 0 0 1];
R = Ry*Rz;
SigmaPrime = [[max 0 0];[0 0 0];[0 0 0];]; %unidirectional test applied in x'
S = R\SigmaPrime*R;
end
I have no idea what ‘S’ represents, so I have no idea how to transform it into a scalar. One option might be the calculate its determinant with the det function or its norm with norm, however I have no idea if either of those are even close to being appropriate.
It just somehow magickally needs to be come a scalar.
.
类别
在 帮助中心 和 File Exchange 中查找有关 Surrogate Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!