Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: Wade Ward <zaxfuuq@xxxxxxxxx>
- Date: 22 May 2007 16:18:40 -0700
On May 21, 7:49 pm, glen herrmannsfeldt <g...@xxxxxxxxxxxxxxxx> wrote:
John Harper wrote:
(snip)
I have another problem with Wade's terminology. c is a velocity, which
happens to be a rational (for that matter an integer) number of metres
per second, which Paul gave. c is NOT a rational number. Rational
numbers are dimensionless. Remember the spacecraft that crashed on Mars
because someone was careless with units...
I would agree with you, except that this is the Fortran newsgroup
where variables do not have units. The quantity stored in the
variable is the desired quantity divided by the appropriate units.
It seems to me that physicists and related scientists tend to
consider variables as holding a quantity with units, while
engineers tend to consider the units as part of the equation.
For the latter case, you might see in a book:
F(Newtons) = m (kilograms) * a (meters/second**2).
program elliot7
implicit none
integer, parameter :: dp = kind(1.0d0)
real(kind=dp):: x,U0,E0,PIE, c, e0_calc
PIE = 4* atan(1.0)
U0=(1E-7_dp)*4.0 * PIE
E0= 8.854187E-12_dp
c = 2.99792458E8_dp
x = (E0*U0)**(-.5)
write (*,'(f30.20)') x, E0, U0, PIE
write (*, *) "going the other way"
e0_calc = 1/ (U0 * c**2.0)
write (*,'(f35.25)') c, U0, PIE, e0_calc
write (*,*) "12345678.0000000000012345678911234"
write (*,*) "12345678.1234567891123456789212345"
! end source begin output
end program elliot7
299792467.67059397698000000000
0.00000000000885418700
0.00000125663709640503
3.14159274101257324230
going the other way
299792458.0000000000000000000000000
0.0000012566370964050291944
3.1415927410125732423000000
0.0000000000088541875712302
12345678.0000000000012345678911234
12345678.1234567891123456789212345
This is the latest version of this program. I tried to get as much
width as I could for e0_calc. When I took E0 from a website that gave
it to 7 figures it gives the speed of light off by 9 m/s, which is
faster than Ben Johnson. I'd be curious to know how much accuracy I
got.
One question: If I have a variable declared as dp and assign it a
value like (1E-7)*4.0 , am I well-advised to append _dp on the things
on the RHS?
--
Wade Ward
.
- Follow-Ups:
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: Jan Vorbrüggen
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: John Harper
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- References:
- c = inverse(sqrt(epsilon nought *mu nought))
- From: Wade Ward
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: John Harper
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: Wade Ward
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: Paul van Delst
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: John Harper
- Re: c = inverse(sqrt(epsilon nought *mu nought))
- From: glen herrmannsfeldt
- c = inverse(sqrt(epsilon nought *mu nought))
- Prev by Date: Re: trailing double underscores
- Next by Date: Re: c = inverse(sqrt(epsilon nought *mu nought))
- Previous by thread: Re: c = inverse(sqrt(epsilon nought *mu nought))
- Next by thread: Re: c = inverse(sqrt(epsilon nought *mu nought))
- Index(es):
Relevant Pages
|