MATLAB Answers

problems with norm()

4 views (last 30 days)
Barbara Schläpfer
Barbara Schläpfer on 8 Dec 2020
Answered: Manvi Goel on 14 Dec 2020
Hi
I am trying to calculate the cost for my optimization of two graphs.
For have implied a cost funciton, but even if my values are pretty small, the value of my cost function is very big. Any tips or suggestions why that happens?
cost = norm(experimental_force_interp - abaqus_force) / lenght(abaqus_force);
  2 Comments
David Goodmanson
David Goodmanson on 8 Dec 2020
Barbara,
there is no substitute for actually seeing the data:
n = length(abaqus_force);
plot(1:n, experimental_force_interp, 'o-', 1:n, abaqus_force, 'o-')
grid on
Here the 'o-' options are so that no point in an unobvious place gets missed. If the o markers are too dense the options can be dropped.

Sign in to comment.

Answers (1)

Manvi Goel
Manvi Goel on 14 Dec 2020
The reason for a bigger value of cost function could be wither a higher difference in experimental_force and abaqus_force or very small denominator, i.e., length of abaqus_force.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by