Dibujar Bucle
Publicado por Mikel (2 intervenciones) el 23/12/2017 16:40:48
Teniendo esto,
close all;
clear;
clc;
%DATOS
%ESTRUCTURA
k = 0; %Rigidez (METER)
m = 1000; %Masa (METER)
uo = 0.020; %Desplazamiento inicial (METER)
vo = 0.000; %Velocidad inicial (METER)
psi = 0.00; %fraccion de amortiguamiento (METER)
%CARGA
Po = 0000; % Amplitud de la carga armonica (METER)
w = 0; % Frecuencia del motor, velocidad de giro del motor (METER) omega barra
%TIEMPO
Ttotal = 20; %Tiempo total para dibujar (METER)
n = 1;
for k = 1000 ; 20000 ; 200000;
%%%%FRECUENCIAS NATURALES
wn = sqrt(k/m);
wd = wn*sqrt(1-psi^2);
%%%%%%RESOLUCION DEL PROBLEMA
u0 = zeros(1,2);
u0(1) = uo;
u0(2) = vo;
f=@(t,u) [u(2);-2*psi*wn*u(2)-wn*wn*u(1)+Po*sin(w*t)];
tspan=[0 Ttotal];
[t,u]=ode45(f,tspan,u0);
maxu (n.1)=k;
maxu (n,2)=max (abs (u (:1)));
maxu (n,3)=max (abs (u (:2)));
n=n+1
end
figure(1)
plot(t,u(:,1),'b')
grid on
xlabel('t')
ylabel('Desplazamiento (m)');
title('Desplazamiento')
figure(2)
plot(t,u(:,2),'g')
grid on
xlabel('t')
ylabel('Velocidad (m/s)');
title('Velocidad')
figure(3)
plot(t,-2*psi*wn*u(:,2)-wn*wn*u(:,1)+Po*sin(w*t),'r')
grid on
xlabel('t')
ylabel('Aceleracion (m/s2)');
title('Aceleracion')
Quiero hacer un gráfico figure (4), rigidez k-desplazamiento máximo (la k tiene esos tres valores y saco sus desplazamientos maximos), y por eso hago un bucle para hacer más tarde la gráfica, pero no se como hacer ese gráfico rigidez k-desplazamiento máximo. Espero que alguien pueda ayudarme, gracias.
close all;
clear;
clc;
%DATOS
%ESTRUCTURA
k = 0; %Rigidez (METER)
m = 1000; %Masa (METER)
uo = 0.020; %Desplazamiento inicial (METER)
vo = 0.000; %Velocidad inicial (METER)
psi = 0.00; %fraccion de amortiguamiento (METER)
%CARGA
Po = 0000; % Amplitud de la carga armonica (METER)
w = 0; % Frecuencia del motor, velocidad de giro del motor (METER) omega barra
%TIEMPO
Ttotal = 20; %Tiempo total para dibujar (METER)
n = 1;
for k = 1000 ; 20000 ; 200000;
%%%%FRECUENCIAS NATURALES
wn = sqrt(k/m);
wd = wn*sqrt(1-psi^2);
%%%%%%RESOLUCION DEL PROBLEMA
u0 = zeros(1,2);
u0(1) = uo;
u0(2) = vo;
f=@(t,u) [u(2);-2*psi*wn*u(2)-wn*wn*u(1)+Po*sin(w*t)];
tspan=[0 Ttotal];
[t,u]=ode45(f,tspan,u0);
maxu (n.1)=k;
maxu (n,2)=max (abs (u (:1)));
maxu (n,3)=max (abs (u (:2)));
n=n+1
end
figure(1)
plot(t,u(:,1),'b')
grid on
xlabel('t')
ylabel('Desplazamiento (m)');
title('Desplazamiento')
figure(2)
plot(t,u(:,2),'g')
grid on
xlabel('t')
ylabel('Velocidad (m/s)');
title('Velocidad')
figure(3)
plot(t,-2*psi*wn*u(:,2)-wn*wn*u(:,1)+Po*sin(w*t),'r')
grid on
xlabel('t')
ylabel('Aceleracion (m/s2)');
title('Aceleracion')
Quiero hacer un gráfico figure (4), rigidez k-desplazamiento máximo (la k tiene esos tres valores y saco sus desplazamientos maximos), y por eso hago un bucle para hacer más tarde la gráfica, pero no se como hacer ese gráfico rigidez k-desplazamiento máximo. Espero que alguien pueda ayudarme, gracias.
Valora esta pregunta
0