節拍
This presentation is the property of its rightful owner.
Sponsored Links
1 / 17

節拍 (beat) 振幅一樣 頻率相差差不多的兩波的干涉現象 PowerPoint PPT Presentation


  • 64 Views
  • Uploaded on
  • Presentation posted in: General

節拍 (beat) 振幅一樣 頻率相差差不多的兩波的干涉現象. x1=-125 y1=0 x2=-100 y2=0 lambda=25 w1=1 w2=0.9 k1 k2 v. 新增初始值 k1=2*3.14159/lambda; v=w1/k1; k2=w2/v;. 粒子間的間距 dx=300.0/(n-1); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { x[i][j]=-150+dx*i; y[i][j]=-150+dx*j; } }. for(int i=0;i<n;i++) {

Download Presentation

節拍 (beat) 振幅一樣 頻率相差差不多的兩波的干涉現象

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Beat

節拍(beat)

振幅一樣 頻率相差差不多的兩波的干涉現象


Beat

x1=-125

y1=0

x2=-100

y2=0

lambda=25

w1=1

w2=0.9

k1

k2

v


K1 2 3 14159 lambda v w1 k1 k2 w2 v

新增初始值k1=2*3.14159/lambda;v=w1/k1;k2=w2/v;


Beat

粒子間的間距

dx=300.0/(n-1);

for(int i=0;i<n;i++)

{

for(int j=0;j<n;j++)

{

x[i][j]=-150+dx*i;

y[i][j]=-150+dx*j;

}

}


Beat

for(int i=0;i<n;i++)

{

for(int j=0;j<n;j++)

{

dx=x[i][j]-x1;

dy=y[i][j]-y1;

r=Math.sqrt(dx*dx+dy*dy);

z[i][j]=Math.cos(k1*r-w1*t);

dx=x[i][j]-x2;

dy=y[i][j]-y2;

r=Math.sqrt(dx*dx+dy*dy);

z[i][j]=z[i][j]+Math.cos(k2*r-w2*t);

}

}

t=t+dt;


Beat

新增變數

nl 200

xl [nl]

yl [nl]

xsize [nl]

ysize [nl]

yl2


Dx 150 0 x2 nl 1 for int i 0 i nl 1 i xl i x2 dx i xsize i dx

新增初始值dx=(150.0-x2)/(nl-1);for(int i=0;i<nl-1;i++){xl[i]=x2+dx*i;xsize[i]=dx;}


Beat

新增參數間關係for(int i=0;i<nl-1;i++){yl[i]=25*(Math.cos(k1*(xl[i]-x1)-w1*t) +Math.cos(k2*(xx[i]-x2)-w2*t));yl2=25*(Math.cos(k1*(xl[i+1]-x1)-w1*t) +Math.cos(k2*(xl[i+1]-x2)-w2*t));ysize[i]=(yl2-yl[i]);}


S a math cos k x i w t

縱波s=A*Math.cos(k*x[i]-w*t);


Beat

粒子間的間距

dx=360.0/(n-1);

for(int i=0;i<n;i++)

{

x[i]=-180.0+dx*i;

y[i]=-10;

x0[i]=-180.0+dx*i;

}

K=2*3.14159/lambda;


Beat

k=2*3.14159/lambda;

for(int i=0;i<n;i++)

{

s=A*Math.cos(k*x0[i]-w*t);

x[i]=x0[i]+s;

}

t=t+dt;


Beat

線段

X長度:位置向量在x方向的投影

y長度:位置向量在y方向的投影

所以線段的大小和方向由X長度和y長度表示


X x vx dt y y vy dt t t dt

x=x+vx*dt;y=y+vy*dt;t=t+dt;


If x 150 vx vx if x 150 vx vx if y 150 vy vy if y 150 vy vy

if (x>=150) vx=-vx;if (x<=-150) vx=-vx;if (y>=150) vy=-vy;if (y<=-150) vy=-vy;


Beat

for(int i=0;i<n;i++){ x[i]=-150+Math.random()*300; y[i]=-150+Math.random()*300; vx[i]=-30+Math.random()*60; vy[i]=-30+Math.random()*60; }


For int i 0 i n i x i x i vx i dt y i y i vy i dt t t dt

for(int i=0;i<n;i++){x[i]=x[i]+vx[i]*dt;y[i]=y[i]+vy[i]*dt;}t=t+dt;


Beat

for(int i=0;i<n;i++){if (x[i]>=150) vx[i]=-vx[i];if (x[i]<=-150) vx[i]=-vx[i];if (y[i]>=150) vy[i]=-vy[i];if (y[i]<=-150) vy[i]=-vy[i];}


  • Login