1 / 17

節拍 (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;. 粒子間的間距 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++) {

Télécharger la présentation

節拍 (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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. x1=-125 y1=0 x2=-100 y2=0 lambda=25 w1=1 w2=0.9 k1 k2 v

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

  4. 粒子間的間距 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; } }

  5. 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;

  6. 新增變數 nl 200 xl [nl] yl [nl] xsize [nl] ysize [nl] yl2

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

  8. 新增參數間關係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]);}

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

  10. 粒子間的間距 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;

  11. 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;

  12. 線段 X長度:位置向量在x方向的投影 y長度:位置向量在y方向的投影 所以線段的大小和方向由X長度和y長度表示

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

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

  15. 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; }

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

  17. 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];}

More Related