필터 지우기
필터 지우기

How I draw shape of traveling wave at various times?

조회 수: 4 (최근 30일)
Dilan Kilic
Dilan Kilic 2020년 3월 23일
댓글: Dilan Kilic 2020년 4월 9일
Hi everyone, I have a problem with drawing of traveling wave shape. I create a code like this below. But I cannot draw traveling shape. I also attached formulas with this problem.
clear, clc
syms l;
syms x;
syms h;
syms wi;
syms t;
syms i;
func = (4/3)*h*(x/l)*sin(i*pi*x/l);
result=int(func,x,0,3*l/4);
func2 = 4*h*(1-(x/l))*sin(i*pi*x/l);
result2=int(func2,x,3*l/4,l);
sonuc=(2/l)*(result+result2); % This is the Fi function
%pretty(simplify(sonuc)); % Fi function
v_x_t=sonuc*sin((i*pi*x)/l)*cos(wi*t);
pretty(simplify(v_x_t));
%% Plotting Initial Shape------------------------------------------------
x1=0:.01:6;
y1=2*x1/3;
x2=6:.01:8;
y2=-2*x2+16;
x=[x1 x2];
y=[y1 y2];
x_line=0:.01:8;
y_line=0*x_line;
% h is assumed to be 4 and l is assumed to be 8.
figure(1)
plot(x,y,'r',x_line,y_line,'--k','linewidth',2)
axis([0 8 -2 6])
title('Initial Shape of f(x)')
xlabel('length')
ylabel('h')
THE RESULTS:
Thanks a lot:)
  댓글 수: 4
Anudeep Kumar
Anudeep Kumar 2020년 3월 31일
Hey to draw and animate plots you can refer to the following link and modify your code accordingly
I hope that will help solve your issue .
Dilan Kilic
Dilan Kilic 2020년 4월 9일
Thanks Kumar. The problem have been solved :)

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

답변 (0개)

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by