Conversation
Schlevidon
left a comment
There was a problem hiding this comment.
Looks good! There are a few things that could be improved.
There was a problem hiding this comment.
What has changed in this file? Was the change intentional?
There was a problem hiding this comment.
restored old version
There was a problem hiding this comment.
What has changed in this file? Was the change intentional?
There was a problem hiding this comment.
restored old version
There was a problem hiding this comment.
What has changed in this file? Was the change intentional?
There was a problem hiding this comment.
restored old version
| function res = F_fric_no_fil(x, mu_rel, epsilon, F_s, k, delta) | ||
| if mu_rel <= -epsilon | ||
| res = F_s / (1 - delta * mu_rel); | ||
| %res = -F_s * mu_rel; |
There was a problem hiding this comment.
Is this commented out code necessary? If not, remove it.
| else | ||
| if mu_rel >= epsilon | ||
| res = (-F_s) / (1 + delta * mu_rel); | ||
| %res = -F_s * mu_rel; |
There was a problem hiding this comment.
Is this commented out code necessary? If not, remove it.
|
|
||
| figure(500); box on; | ||
| subplot(2, 2, 1); | ||
| scatter(T, Gy11, 'LineWidth', 0.5, 'Color', [0, 0.5, 0], Marker='.'); hold on; |
There was a problem hiding this comment.
Why is a scatter plot used here? Why not a regular plot (with markers if necessary)?
There was a problem hiding this comment.
It was used because of the jumps in the sensitivities
| fildiff1 = abs(Y_filippov(1,:) - Y_no_fil(1,:)); | ||
| fildiff2 = abs(Y_filippov(2,:) - Y_no_fil(2,:)); |
There was a problem hiding this comment.
Why split up the rows into two separate variables? Could just compute abs on the whole matrix, then select the rows when plotting.
| grid on; | ||
| set(gca, 'FontSize', 12, 'LineWidth', 1.2); | ||
|
|
||
| warning('on', 'IFDIFF:chattering'); No newline at end of file |
There was a problem hiding this comment.
If any preceding code throws, this will not be executed and the warning state will not be restored. Also, we should restore the same warning state as before (don't assume that the warning was set to 'on' before).
There was a problem hiding this comment.
Added try catch blocks to prevent this and script now remembers initial warning status
There was a problem hiding this comment.
Add the paper this model was taken from as a source in a comment at the beginning (see pprhs.m for an example).
There was a problem hiding this comment.
Add the paper this model was taken from as a source in a comment at the beginning (see pprhs.m for an example).
There was a problem hiding this comment.
Added to the main script as both variants are found in this same source.
new file: toolbox/examples/friction_model/friction_model_RHS.m new file: toolbox/examples/friction_model/friction_model_test.m modified: toolbox/examples/liveExamples/canonicalExRHS_test_live.mlx
new file: toolbox/examples/friction_model/F_fric_mod.m new file: toolbox/examples/friction_model/F_fric_mod2.m new file: toolbox/examples/friction_model/friction_model_RHSmod.m new file: toolbox/examples/friction_model/friction_model_RHSmod2.m new file: toolbox/examples/friction_model/friction_model_mod_test.m modified: toolbox/examples/liveExamples/CanonicalSensitivities.mlx
deleted: toolbox/examples/friction_model/F_fric.m renamed: toolbox/examples/friction_model/friction_model_RHSmod.m -> toolbox/examples/friction_model/friction_RHS_filippov.m renamed: toolbox/examples/friction_model/friction_model_RHSmod2.m -> toolbox/examples/friction_model/friction_RHS_no_filippov.m deleted: toolbox/examples/friction_model/friction_model_RHS.m renamed: toolbox/examples/friction_model/friction_model_mod_test.m -> toolbox/examples/friction_model/friction_model_comparison.m deleted: toolbox/examples/friction_model/friction_model_test.m renamed: toolbox/examples/friction_model/F_fric_mod2.m -> toolbox/examples/friction_model/helpers/F_fric_fil.m renamed: toolbox/examples/friction_model/F_fric_mod.m -> toolbox/examples/friction_model/helpers/F_fric_no_fil.m
modified: toolbox/examples/friction_model/friction_model_comparison.m modified: toolbox/examples/friction_model/helpers/F_fric_no_fil.m
Adds a frction model example to the examples library with two different formulations (filippov and non-filippov). Compares both versions in accuracy and is suited for comparison of sensitivities (needs to be implemented)