Minimize difference in vectors by varying scalar

2 ビュー (過去 30 日間)
Emily Fratin
Emily Fratin 2018 年 4 月 1 日
編集済み: Matt J 2018 年 4 月 1 日
I am trying to use fmincon to minimize an equation of the form Smallest_difference(n) = Normal(n) - Altered(n). The Altered(n) vector is meant to be varied by changing one variable, say x, using fmincon. I am using fmincon because x has bounds of 0 < x < 0.25. Also, the minimum value of Smallest_difference(n) will be found at a single x value.
I'm trying to use this optimization to find a spot on the foot where a person's natural gait is least impacted if weight is added. Smallest_difference would be the difference between the normal gait and the altered gait, and would be found for a single value of x. X represents the length from the ankle to the added weight.
I tried to run the optimization and realized that fmincon only minimizes objective functions that return a scalar. Is there any way to get around this problem, like another constrained optimization function, or a loop?
Thanks!

採用された回答

Matt J
Matt J 2018 年 4 月 1 日
編集済み: Matt J 2018 年 4 月 1 日
If your only constraints are bounds, you can use lsqnonlin() or lsqcurvefit() instead.
Or you could still use fmincon, but scalarize the objective function yourself
TOTAL_difference = norm( Normal - Altered ).^2

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNonlinear Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by