Fotran program to find half-life of a radioactive material

In summary, the conversation discusses the task of writing a program to calculate the time taken for half of a sample of material to decay, given the decay constant. The equations and code used are also mentioned, as well as the suggestion to use a PRINT statement and a counter variable for testing and debugging. The conversation ends with the user successfully completing the program.
  • #1
Daniel1992
22
0

Homework Statement


I need to write a program that, given the decay constant of a radioactive material, will calculate numerically (to withing one second) the time taken for half of the orginal sample of material to decay.

Homework Equations


λ = decay constant C0 = start amount of material

After one second C0 will have decayed leaving C = (1-λ)C0 of undecayed material left.

The Attempt at a Solution


I only have very basic experince at programming so I am finding this quite difficult. Below is the code that I have created so far.

IMPlICIT NONE
REAL :: y,C,t !y = decay constant C = starting amount of material t = time
PRINT*,"Enter decay constant"
READ*,y
PRINT*,"Enter starting amount of material"
READ*,C

DO WHILE (C.GT.C/2)
C=(1-y)*C
END DO

PRINT*,"C=",C

I don't really have any idea how I would work out hiw many interations the DO WHILE loop has done which i need to kno in order to work out the half life.

Any help/advice would be much appreciated.
 
Physics news on Phys.org
  • #2
It's helpful during the testing and debugging stage of writing a program to temporarily add a PRINT statement inside loops so that you can verify operation is exactly as you hope it will be.

Suppose you were to add a PRINT statement inside your DO loop, what useful variables would you like it to print out?

Imagine your program simulates the decay of 100 grams of material having a decay constant of 2.77 milliseconds. What are the first 6 of the output lines that your loop's added PRINT statement would print out?
 
Last edited:
  • #3
You'll need a variable to act as a counter that you can increment inside the do.while loop.

Why not walk thru your algorithm step by step solving it on paper as if you were a computer?

That should make it easier to design your loop and get your answer.

What does each iteration of the do.while loop represent?
 
  • #4
Thanks for the replies :)

I have managed to get the program to find the amount of undecayed substance left after the half life has been reached.

Here is the new code:
PROGRAM assignment1
IMPlICIT NONE
REAL :: y,C,t,v !y = decay constant C = starting amount of material t = time


PRINT*,"Enter decay constant"
READ*,y
PRINT*,"Enter starting amount of material"
READ*,C
v=c


DO WHILE (C.GT.v/2)
C=(1.0-y)*C
PRINT*,C
END DO

PRINT*,"C =",C
END PROGRAM assignment1


I am not sure how I can get a varibale to act as counter inside the loop.
Any help would be appreciated.
 
  • #6
Got it sorted now. Thanks for the help :smile:
 

1. What is the purpose of using a Fotran program to find the half-life of a radioactive material?

The purpose of using a Fotran program to find the half-life of a radioactive material is to accurately determine the amount of time it takes for half of the material to decay. This information is important in various scientific fields, such as nuclear physics and medicine, as it can help in understanding the properties and behavior of radioactive substances.

2. How does the Fotran program calculate the half-life of a radioactive material?

The Fotran program uses a mathematical formula known as the radioactive decay law to calculate the half-life of a radioactive material. This formula takes into account parameters such as the initial amount of the material, the decay constant, and the time elapsed.

3. Is the Fotran program accurate in determining the half-life of a radioactive material?

Yes, the Fotran program is highly accurate in determining the half-life of a radioactive material. It uses precise mathematical calculations and can handle large amounts of data, resulting in accurate and reliable results.

4. Can the Fotran program be used for all types of radioactive materials?

Yes, the Fotran program can be used for all types of radioactive materials as long as the necessary parameters are provided. It is designed to handle different types of radioactive decay, including alpha, beta, and gamma decay.

5. How can the Fotran program benefit scientific research and industries?

The Fotran program can benefit scientific research and industries by providing a quick and accurate way to determine the half-life of a radioactive material. This information is crucial in various applications, such as nuclear power plants, medical treatments, and environmental studies.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
901
  • High Energy, Nuclear, Particle Physics
Replies
20
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
153
  • High Energy, Nuclear, Particle Physics
Replies
3
Views
1K
  • High Energy, Nuclear, Particle Physics
Replies
6
Views
1K
  • Other Physics Topics
Replies
6
Views
2K
  • Precalculus Mathematics Homework Help
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • High Energy, Nuclear, Particle Physics
Replies
7
Views
2K
Back
Top