Exercises
Please complete each exercise or answer the question before reviewing the posted solution comments.
-
Define a function that computes the positive distance between two points given the coordinates of the points as:
x1, y1, x2, y2
.The formula for distance is shown here:
function dist = distanceBetweenPoints(x1,y1,x2,y2) % Returns the positive distance between two points dist = sqrt( (x2-x1)^2 + (y2-y1)^2 );
This function as written will not work correctly for arrays of point coordinates. What would you have to change to make it work for arrays or vectors of x and y coordinates?
-
Alpha decay is the process by which a nucleus ejects an alpha particle (i.e. a helium nucleus) through Coulomb repulsion. Many heavy nuclei, especially those of the naturally occurring radioactive series, decay through alpha particle emission.
If the final kinetic energy of an alpha particle (Talpha [MeV]) is significantly less than its rest mass (mc2), then we may use nonrelativistic kinematics to determine Talpha. We can express the final kinetic energy as: where Q [MeV] is the Q-value (or net energy released in the decay), malpha [amu] is the mass of the alpha particle, and mx [amu] is the final mass of the nucleus after it has ejected the alpha particle.
Define a Matlab function that takes Q, malpha, and mx, in that order, as parameters and returns Talpha.
Plutonium-242 decays to uranium-238 via alpha decay.
The atomic mass of Pu-242 is 242.058737 amu,
the atomic mass of U-238 is 238.050785 amu,
the mass of an alpha particle is 4.00150618 amu,
and the Q-value of the reaction is 6.004294.Calculate Talpha for this reaction.
>> TAlpha(6.004294, 4.00150618, 238.050785) ans = 5.9050 >> 5.9050 MeV
Compare your function to this version: Talpha.m
-
Dose equivalent
Ionizing radiation (e.g. x-rays, gamma rays, alpha particles) deposits energy as it passes through material. The absorbed dose (D) of a given material measures the energy deposited by ionizing radiation per unit mass of material. Absorbed dose is measured in rads, short for radiation absorbed dose. Different types of ionizing radiation deposit energy in different ways. For example, alpha particles deposit nearly all of their energy over a short distance while gamma rays deliver their energy over a long distance. The quality factor (QF) is calculated for a given type (and energy) of radiation according to the energy deposited per unit path length. So, the total effect of a certain radiation on a biological system then depends on the absorbed dose (D) and the quality factor (QF) of the radiation. The total effect, also called the dose equivalent (DE), is obtained by multiplying these quantities together: DE = D*QF.
(Adapted from Introductory Nuclear Physics, Krane).Define a Matlab function that calculates the dose equivalent given a vector of absorbed doses and a vector of quality factors as parameters. Make sure that your function can handle vector inputs.
Use your function, as shown below, to calculate the dose equivalent of gamma rays (QF = 1) that deliver 3.85 mrads to a given material and to calculate the dose equivalent of alpha particles (QF = 20) that deliver 2.33 mrads to a given material?
>> doseEquivalent( [3.85,2.33] , [1,20] )
>> doseEquivalent([3.85,2.33],[1,20]) ans = 3.8500 46.6000
3.8500 mrems; 46.6000 mrems
Compare your function to this version: doseEquivalent.m