rickstaa / MBD-B

This repository contains the codes I wrote for the course MBDB during my master Biomechanical design It contains my solutions to the course assignments.
MIT License
1 stars 0 forks source link

Assignment 10 Energy calculations #4

Closed BitNide closed 6 years ago

BitNide commented 6 years ago

You are incorrectly calculating the E_e during the l_s calculations you already substract l_0 l_s2 = real(sqrt(sqrt(sum(l_s2.^2)) - l_0))^2;

During the E_e calculations you do this again:

E_e = 0.5parms.k(l_s1 - parms.l_0).^2 + 0.5parms.k(l_s2 - parms.l_0).^2;

simply remove the parms.l_0 from the second part.

Lastly I think it would be interesting to add the drag and damping kinetics to see if the total energy actually stays the same.

BitNide commented 6 years ago

incorporating the drag and the damping forces:

Fdrag = sqrt(sum(subs_F_drag(x(:,8)',x(:,9)',x(:,10)').^2)); dx = sqrt(sum(x(:,8:10).^2,2));

E_drag(1) = Fdrag(1)dx(1)(t(i)-t(i-1)); for i = 2:length(x.') E_drag(i,:) = E_drag(i-1,:)+Fdrag(i)dx(i)(t(i)-t(i-1)); end

% energy consumed by damping Fdamp = abs(subs_F_damp(parms.l_0,parms.b,x(:,1),x(:,2),x(:,3),x(:,4),x(:,5),x(:,6), ... x(:,7),x(:,8),x(:,9),x(:,10)));

E_damp(1) = Fdamp(1)dx(1)(t(i)-t(i-1)); for i = 2:length(x.') E_damp(i,:) = E_damp(i-1,:)+Fdamp(i)dx(i)(t(i)-t(i-1)); end

BitNide commented 6 years ago

when plotting all the energies together there is clearly a creep as well as some oscillation in the model :/ energy plot

I looked at it best I could but was unable to find an error in the system. Maybe my understanding of the Rotation mechanics is insufficient though :/

rickstaa commented 6 years ago

@BitNide Thanks for looking into assignment 10 I didn't have the time yet to check that one I will do that this afternoon. Thanks for pointing out my errors and for incorporating the drag energy. :) I will take a look at it tonight. I am first doing the example exam. :)