Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agrego ploteo en código de VM dinámico #19

Merged
merged 3 commits into from
Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions src/VonMisesNL_DifCent.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%%% Dinamica No-Lineal: Cercha Von Mises (Barra de Green) %%%
clc, clear all
clc, clear all, close all

%%% Parametros Estructura
rho = 7850; % kg/m3 (acero)
Expand All @@ -12,7 +12,7 @@
E = 200000e6 %Pa (acero)
kc = 3*E*Ic/Lc^3; %N/m
mb = l0*Ac*rho; %kg
m = 1.4; %kg Pandeo incipiente en 1.4
m = 3; %kg Pandeo incipiente en 1.4
c = 2; %kg/s (amortiguamiento por friccion juntas y arrastre pesa)
g = 9.81; %m/s2

Expand Down Expand Up @@ -50,13 +50,14 @@

epsg(k) = (u(1,k)^2+2*Lz*u(2,k)-2*Lx*u(1,k)+u(2,k)^2)/2/l0^2;

while t<tf
while t(end) < tf
feff = ft(t(k)) -Fint(u(:,k)) +a2*M*u(:,k) - M2*u(:,k-1);
u(:,k+1) = Meff\feff;
acc(:,k) = a0*(u(:,k+1)-2*u(:,k)+u(:,k-1));
vel(:,k) = a1*(u(:,k+1)-u(:,k-1));
epsg(k+1) = (u(1,k+1)^2+2*Lz*u(2,k+1)-2*Lx*u(1,k+1)+u(2,k+1)^2)/2/l0^2;
k=k+1; t(k)=t(k-1)+dt;
t(end)
end

subplot(3,1,1)
Expand All @@ -71,3 +72,18 @@
plot(t(1:10:end),E*Ac*epsg(1:10:end))
xlabel('t [s]'); ylabel('Directa [N]')
axis([0 2 E*Ac*min(epsg)*1.1 E*Ac*max(epsg)*1.1]);

%system('rm out/*')
figure
grid on
for i=1:500:size(u,2)
fprintf('ploting time %12.3e \n',t(i) )
u(:,i)
plot( [u(1,i) Lx 2*Lx-u(1,i) ] , [ 0 Lz+u(2,i) 0],'r-o')
%plot( [u(1,i) Lx ] , [ 0 Lz+u(2,i)],'r-o')
title( [ 'time: ' sprintf('%12.3e', t(i)) ' s'] )
axis( [ min(u(1,:)) -min(u(1,:))+2*Lx min( [Lz+(min(u(2,:))) 0]) Lz+(max(u(2,:))) ] )
%axis( [ min(u(1,:)) -min(u(1,:))+2*Lx 0 Lz+(max(u(2,:))) ] )
print( [ 'out/vonmises_' sprintf('%05i',i) '.png'],'-dpng' )
%stop
end