You are on page 1of 3

name@var_D := Hstatements; Return@outputDL

H*EXERCISE 1:Write a program to calculate potiential


energy between the charges q1=a,q=2,r=0.5 using function *L

pe@q1_, q2_, r_D := HHk q1 q2L  r L

H*calling the function with numerical values *L

pe@a, b, 0.5D
2. a b k

H*EXERCISE 2:
Write a program to calculate potiential energy between the charges q1=-3c ,
q2=2c,3c,......12c and separation r=0.5 m using function*L

k = 9 ´ 10 ^ 9; q1 = - 3; r = 0.5;

For@q2 = 2, q2 £ 12, q2 ++, Print@


"The value of potiential energy for q2=", q2, " is equal to", pe@q1, q2, rDDD
The value of potiential energy for q2=2 is equal to- 1.08 ´ 10 11

The value of potiential energy for q2=3 is equal to- 1.62 ´ 10 11

The value of potiential energy for q2=4 is equal to- 2.16 ´ 10 11

The value of potiential energy for q2=5 is equal to- 2.7 ´ 10 11

The value of potiential energy for q2=6 is equal to- 3.24 ´ 10 11

The value of potiential energy for q2=7 is equal to- 3.78 ´ 10 11

The value of potiential energy for q2=8 is equal to- 4.32 ´ 10 11

The value of potiential energy for q2=9 is equal to- 4.86 ´ 10 11

The value of potiential energy for q2=10 is equal to- 5.4 ´ 10 11

The value of potiential energy for q2=11 is equal to- 5.94 ´ 10 11

The value of potiential energy for q2=12 is equal to- 6.48 ´ 10 11

H*Exercise 3:The time period of simple pendulum is given by T =

L
2Π where g=9.8 ms^2.Write a program to compute the time
g

period for L varying between 0.8 to 1.6 m in steps 0.05m*L

tp@l_D := 2 Pi Sqrt@l  gD

g = 9.8;

For@l = 0.8, l £ 1.6, l = l + 0.05,


Print@"The time period for length ", l, "m is ", tp@lD, "s"DD
2 1-Functions.nb

The time period for length 0.8m is 1.7952 s

The time period for length 0.85m is 1.85045 s

The time period for length 0.9m is 1.90409 s

The time period for length 0.95m is 1.95627 s

The time period for length 1.m is 2.00709 s

The time period for length 1.05m is 2.05666 s

The time period for length 1.1m is 2.10505 s

The time period for length 1.15m is 2.15236 s

The time period for length 1.2m is 2.19866 s

The time period for length 1.25m is 2.24399 s

The time period for length 1.3m is 2.28843 s

The time period for length 1.35m is 2.33203 s

The time period for length 1.4m is 2.37482 s

The time period for length 1.45m is 2.41686 s

The time period for length 1.5m is 2.45817 s

The time period for length 1.55m is 2.49881 s

The time period for length 1.6m is 2.53879 s

H*Exercise 4: Radioactve decay is governed by the equation


N=No e^-......*L

n@t_D := HN0 = 1000; th = 15; lem = 0.693  th; N0 * E ^ H- lem * tLL

For@t = 0, t £ 60, t = t + 5,
Print@"Nuclei that are left after ", t, " seconds are ", n@tDDD
1-Functions.nb 3

Nuclei that are left after 0 seconds are 1000.

Nuclei that are left after 5 seconds are 793.739

Nuclei that are left after 10 seconds are 630.022

Nuclei that are left after 15 seconds are 500.074

Nuclei that are left after 20 seconds are 396.928

Nuclei that are left after 25 seconds are 315.058

Nuclei that are left after 30 seconds are 250.074

Nuclei that are left after 35 seconds are 198.493

Nuclei that are left after 40 seconds are 157.552

Nuclei that are left after 45 seconds are 125.055

Nuclei that are left after 50 seconds are 99.2613

Nuclei that are left after 55 seconds are 78.7876

Nuclei that are left after 60 seconds are 62.5368

You might also like