Вы находитесь на странице: 1из 7

CENTRAL FORCES

AIM To simulate the orbit of a particle moving under a central potential of the form V=-(k/r) THEORY Our ultimate goal is to solve the equations of motion for two masses m1 and m2 subject to a central force acting between them. When you considered this problem in introductory physics, you assumed that one of the masses was so large that it eectively remained at rest while all of the motion belonged to the other object. This assumption works fairly well for the Earth orbit in garound the Sun or for a satellite orbiting around the Earth, but in general we are going to have to solve for the motion of both objects. In the introduction, we dened a central force to satisfy two characteristics. We can now write turn these descriptions of the characteristics into equations: (a) a central force depends only on the separation between the two bodies f21 = f1 Since a central force is a conservative force, we can define a potential energy. If there are no other forces, then energy is conserved and we can write this in an equation: KE + PE = E = constant m r2 + m r2 2 + V(r) = E . If we use the angular momentum expression, = L/mr2, this becomes:

m r2 + m r2 (L/mr2)2 + V(r) = E = m r2 + L2 /mr2 + V(r) . If we treat the term L2 /mr2 as an additional potential energy (since it only depends on r), we can define an effective potential energy: V(r) = V(r) + L2 /2mr2 . We now have an equation that is essentially onedimensional: m r2 + V(r) = E = constant .

FLOW CHART
START

READ INPUTS

IF GRAPHICS ERROR STOP. OR

DO CALCULATIONS

OUTPUT

END

PROGRAM

#include<iostream.h> #include<graphics.h> #include<stdlib.h> #include<math.h> #include<complex.h> #include<conio.h> void main() { float theta,dtheta,h,f1,f2,f3,dr,r,rmax=1.8,rmin=0.7,y,x; float fn(float r); int xmid,ymid,n,i,j,errorcode; clrscr(); errorcode=graphresult(); if(errorcode!=grOk) { cout<<"graphics error:"<<grapherrormsg(errorcode); cout<<"press any key to halt"; getch(); exit(1); }

int gdriver=DETECT,gmode; initgraph(&gdriver,&gmode,""); xmid=getmaxx()/2; ymid=getmaxy()/2; line(xmid-(0.75*xmid),ymid,xmid+(0.75*xmid),ymid); line(xmid,ymid-(0.75*ymid),xmid,ymid+0.75*ymid); dr=(rmax-rmin)/200; h=dr/100; r=rmin; theta=0; dtheta=0; for(n=1;n<200;n++) { f1=fn(r)+fn(r+dr); for(i=1;i<=100-1;i+=2) f2=fn(r+i*h); for(j=2;j<=98;j+=2) f3=fn(r+j*h); dtheta=h/3*(f1+4*f2+2*f3); theta=theta+dtheta; r=r+dr; y=r*sin(theta);

x=r*cos(theta); putpixel(xmid+0.7*xmid*x/rmax,ymid-0.8*ymid*y/rmax,10); putpixel(xmid+0.7*xmid*x/rmax,ymid+0.8*ymid*y/rmax,10); } getch(); closegraph(); } float fn(float r) { float j=1,m=1,k=1,E=-0.4,a,b; a=2*m*E+2*m*k/r-(j*j)/(r*r); b=sqrt(a); return(j/(r*r*b)); }

CHART

Вам также может понравиться