summaryrefslogtreecommitdiff
path: root/3845/CH18/EX18.1/Ex18_1.sce
blob: eaee3c8139bd3a4f48f8092026e35b6123302953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//Example 18.1
r=0.530*10^-10;//Separation (m)
k=8.99*10^9;//Coulomb's constant (N.m^2/C^2)
q1=-1.60*10^-19;//Charge of electron (C)
q2=1.60*10^-19;//Charge of proton (C)
F=k*abs(q1*q2)/r^2;//Coulomb force (N)
printf('Electrostatic force = %0.2e N',F)
G=6.67*10^-11;//Gravitational constant (N.m^2/kg^2)
m=9.11*10^-31;//Electron mass (kg)
M=1.67*10^-27;//Proton mass (kg)
F_G=G*m*M/r^2;//Gravitational force (N)
printf('\nGravitational force = %0.2e N',F_G)
printf('\nRatio of electrostatic force to gravitational force = %0.2e',F/F_G)
//Openstax - College Physics
//Download for free at http://cnx.org/content/col11406/latest