:2004-09-10:(1964-),,,,.李海雁(, 650031):,,,、.:;;;:O321 :A :1008-7958(2004)04-0043-03TheComputerSimulationofCompoundVibrationLIHai-yan(DepartmentofComputer,KunmingTeachersCollege,YunnanKunming650031,China)Abstract:Thesimpleharmonicoscillatorandcompoundvibrationexperimentaresimulatedbycomputer,andthesimulatedsourceprogramsaregiven.Itprovidesbasisofcompilingprogramforphysicsexperimentteaching,demonstratedexperimentandclassroomfile.Keywords:simpleharmonicoscillator;compoundvibration;computersimulatedexperiment;sourceprogram ,,.U235,,,,[1].,、,.,,.,,[2].,,,、.1 1.1 [3,4],F=-κX,κ,d2xdt2+ω2x=0,(1)ω2=κ/m,m.x=Acos(ωt+φ),(2)Aφ,.A,ωφ,(2)xt.1昆明师范高等专科学校学报 2004,26(4):43~45 CN53-1131/G4 ISSN1008-7958JournalofKunmingTeachersCollege.1.,t=0,1,2,…,N,,,tN,.,、、.t()t(N).t-1,t,.1.2 x1=A1cos(ω1t+φ1),(3)x2=A2cos(ω2t+φ2),(4)x=x1+x2.(5),x=f(t).,ω1=ω2=ω,x=Acos(ωt+φ),(6)A=A21+A22+2A1A2cos(φ1-φ2),φ=arctanA1sinφ1+A2sinφ2A1cosφ1+A2cosφ2 .,A1=A2=Aφ1=φ2=φ, x=2Acos(ω1-ω22t)cos(ω1+ω22t+φ).(7)(3)(4),(6)(7).,(3),(4)(5),..2.x-t,.,,.2 [5]2.1 #includegraphics.h#includestdlib.h#includestdio.h#includemath.hmain(){intgraphdrv=VGA;intgraphmode=VGAHI;intt=0,x=200,u=20,N=1000,y,r=4,i;inta,w,q;scanf(“%d%f%f”,&a,&w,&q);initgraph(&graphdrv,&graphmode,”tc44 200412bgi”);for(t=0;t=N;t++){for(i=0;i=100;i++)line(x,u,x,100);y=a*cos(w*t+q)+250;cleardevice();line(x-50,u,x+50,u);for(i=0;i=4;i++){line(x+10*i,u,x+10*i+10,u-10);line(x-10*i-10,u,x-10*i,u-10);}line(x,u,x,y);line(x+1,u,x+1,y);line(x-1,u,x-1,y);circle(x,y,r-1);circle(x,y,r-2);circle(x,y,r);}while(!kbhit());closegraph();}2.2 #includegraphics.h#includestdlib.h#includestdio.h#includemath.hmain(){intgraphdrv=VGA;intgraphmode=VGAHI;intt=0,N=1500;inty0,y10,y20,y1,y2,y,i;inta1,a2,w1,w2,q;scanf(“%d%d%f%f%f”,&a1,&a2,&w1,&w2,&q);initgraph(&graphdrv,&graphmode,“tcbgi”);y10=a1+60;y20=a2*cos(q)+160;y0=y10+y20+100;line(0,60,639,60);line(0,160,639,160);line(0,320,639,320);for(t=0;t=N;t++){for(i=0;i=6;i++)line(i*100,0,i*100,479);y1=a1*cos(w1*q)+60;y2=a2*cos(w2*t+q)+160;y=y1+y2+100;line(0.5*t,y10,0.5+0.5*t,y1);line(0.5*t,y20,0.5+0.5*t,y2);line(0.5*t,y0,0.5+0.5*t,y);y10=y1;y20=y2;y0=y;}while(!kbhit());closegraph();}3 、,,,、,.,.[ ][1] EHRICHR.[M]..:,1986.[2] FORSYTHEGE,MALCOLMMA,etal..[M]..:,1987.[3] .[M].:,1985.[4] .()[M].:,2002.[5] .C[M].:,2000.454 :