필터 지우기
필터 지우기

how can i plot this equation ??? please

조회 수: 2 (최근 30일)
sihem chaib
sihem chaib 2014년 2월 15일
댓글: sihem chaib 2014년 2월 15일
clear all
clc
%le 29/10/2013 à 23h00
%les géométries de la poutre
M=30; % masse de la poutre KG/ML??
EI=200*10^7;% Rigidité flexionnelle de la poutre N/m^2
%l=22;%m
%les caractéristiques du sol
c=0;% constante d'amortissement
k=0.2*10^8;% rigidité du sol N/m^2
v=5;%vitesse m/s de chargement
n1=5;%nombre des modes
%longueur de la poutre en m
l=(3*pi/2)*(4*EI/k)^0.25; %m;
%les conditions initiales
v_0=0;%m/s;vitesse initiale
T_0=0.01*10^-4;%m déplacement initial
t1=l/v;
for m=1:n1;
x=1:0.01:l+1;
phi(x,m)=sin((x-1)*pi*m/l);
t=1:0.01/v:t1;
beta=c/(2*M);
B=T_0;
w_d(m)=((((m^4)*(pi^4)*EI)/(M*(l^4)))+(k/M))^0.5; %pulsation propre
w_n(m)=((w_d(m)^2)-(beta^2))^0.5;% pseudo pulsation
A(m)=((v_0)+(B*beta))/w_n(m);
T(t,m)=(exp(-beta*(t-1)*(A(m)*sin((w_n(m))*(t-1))+B*cos((w_n(m))*(t-1)))));
ww(x,t,m)=phi(x,m)*T(t,m);%(sin(m*pi*(xx1(i)-1)/l))* T(j,m);%((exp(-beta*(tt1(j)-1)))*(A(m)*sin((w_n(m))*(tt1(j)-1))+B*cos((w_n(m))*(tt1(j)-1))));
end
x=1:0.01:l+1;
t=1:0.01/v:t1;
ww1(x,t)=0;
for m=1:n1;
ww1(x,t)=ww1(x,t)+ww(x,t,m);
end
plot (ww1(:,1),'B');
hold on
%remarque : se sont des ondes stationaires changent d'emplitudes mais ne
%changent pas de position.
  댓글 수: 2
Walter Roberson
Walter Roberson 2014년 2월 15일
편집: Walter Roberson 2014년 2월 15일
Side note: you can replace
ww1(x,t)=0;
for m=1:n1;
ww1(x,t)=ww1(x,t)+ww(x,t,m);
end
with
ww1(x,t) = sum(ww(x,t,:));
sihem chaib
sihem chaib 2014년 2월 15일
ok think you i try your proposition

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2014년 2월 15일
Your code has
t=1:0.01/v:t1;
ww1(x,t)=0;
so you are trying to use t as an index into an array. But t has values like 1.80 and floating point numbers cannot be used as indices.
Try
t=1:0.01/v:t1;
ww1(x, 1:length(t)) = 0;
Except, that is, that as I noted above you do not need to initialize ww1(x,t). So you can take the statement I gave
ww1(x,t) = sum(ww(x,t,:));
and replace it with
ww1(x,1:length(t)) = sum(ww(x,1:length(t),:),3);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by