L output.txt binding energy binding energy per Nucleon -448.996 -226.623 -82.990 -3.778 47.111 64.228 70.245 55.009 35.952 1.794 -32.682 -78.825 -123.453 -177.641 -229.307 -289.143 -89.799 -37.771...

By python
L output.txt<br>binding<br>energy<br>binding energy<br>per Nucleon<br>-448.996<br>-226.623<br>-82.990<br>-3.778<br>47.111<br>64.228<br>70.245<br>55.009<br>35.952<br>1.794<br>-32.682<br>-78.825<br>-123.453<br>-177.641<br>-229.307<br>-289.143<br>-89.799<br>-37.771<br>-11.856<br>-0.472<br>5.235<br>6.423<br>6.386<br>4.584<br>2.766<br>8.<br>10<br>11<br>12<br>13<br>14<br>0.128<br>15<br>16<br>17<br>18<br>19<br>20<br>-2.179<br>-4.927<br>-7.262<br>-9.869<br>-12.069<br>-14.457<br>Figure 3: Output File<br>2. Modular Programming:<br>Your program should be modular and consists of the following functions:<br>a) read () :<br>- Ask the user for a valid atomic number (Z)<br>b) compute_binding_energy (Z, table) :<br>- Build the table (a list of lists) of binding energy where the columns are:<br>the mass number (A), the binding energy (Eb) and the binding energy per<br>nucleon (BEN), while the rows range from A = Z to A = 4Z<br>c) most_stable (table) :<br>Find and return the row that contains the highest binding energy per<br>nucleon, which corresponds to the most stable configuration.<br>d) print_table (table):<br>- Print the table in a neat tabular format as shown in the sample run in<br>figure 2.<br>e) write to file(table, file name):<br>- Save the table in a text file output.txt as shown in figure 3.<br>3<br>f) main () :<br>- The main function is set up to make the calls to the functions as<br>specified in points a) to e)<br>

Extracted text: L output.txt binding energy binding energy per Nucleon -448.996 -226.623 -82.990 -3.778 47.111 64.228 70.245 55.009 35.952 1.794 -32.682 -78.825 -123.453 -177.641 -229.307 -289.143 -89.799 -37.771 -11.856 -0.472 5.235 6.423 6.386 4.584 2.766 8. 10 11 12 13 14 0.128 15 16 17 18 19 20 -2.179 -4.927 -7.262 -9.869 -12.069 -14.457 Figure 3: Output File 2. Modular Programming: Your program should be modular and consists of the following functions: a) read () : - Ask the user for a valid atomic number (Z) b) compute_binding_energy (Z, table) : - Build the table (a list of lists) of binding energy where the columns are: the mass number (A), the binding energy (Eb) and the binding energy per nucleon (BEN), while the rows range from A = Z to A = 4Z c) most_stable (table) : Find and return the row that contains the highest binding energy per nucleon, which corresponds to the most stable configuration. d) print_table (table): - Print the table in a neat tabular format as shown in the sample run in figure 2. e) write to file(table, file name): - Save the table in a text file output.txt as shown in figure 3. 3 f) main () : - The main function is set up to make the calls to the functions as specified in points a) to e)
1. Problem Description:<br>The total nuclear binding energy is the energy required to split a nucleus of an<br>atom in its component parts: protons and neutrons, or, collectively, the nucleons.<br>It describes how strongly nucleons are bound to each other. When a high amount<br>of energy is needed to separate the nucleons, it means nucleus is very stable<br>and the neutrons and protons are tightly bound to each other.<br>The atomic number or proton number (symbol Z) is the number of protons found<br>in the nucleus of an atom. The sum of the atomic number Z and the number of<br>neutrons N gives the mass number A of an atom.<br>+ Binding energy -<br>Nucleus<br>(smaller mass)<br>Separated nucleons<br>(greater mass)<br>Figure 1: Binding Energy in the Nucleus<br>The approximate nuclear binding energy Eb in million electron volts, of an atomic<br>nucleus with atomic number Z and mass number A is calculated using the<br>following formula:<br>(A – 22)², as<br>Eb = a,A – 4,A³ – az¬- as-<br>Eb = a, A - a½A3 – az<br>A<br>A3<br>AZ<br>where, a, = 15.67, az = 17.23, az = 0.75, a, = 93.2 ,and<br>if A is odd<br>if A and Z are both even<br>if A is even and Z is Odd<br>12.0<br>as =<br>(-12.0<br>The binding energy per nucleon (BEN) is calculated by dividing the binding<br>energy (Eb) by the mass number (A).<br>You are asked to write a program that requests the user for a valid atomic<br>number (Z) then goes through all values of A from A = Z to A = 4Z. For example,<br>if the user inputs 5 for Z then A will be all numbers from 5 (Z) to 20 (4 Z)<br>inclusive, see the example output in figure 2.<br>If the user enters invalid atomic number that is not between 1 and 118, the<br>program should give the user another chance to enter a valid input as shown in<br>figure 2.<br>Your main task is to find the nucleus with the highest binding energy per nucleon,<br>which corresponds to the most stable configuration (figure 2), and writes a copy<br>of the table to a text file named output.txt (figure3).<br>In (25]: runfilel'/Users/hanzazidoun/Documents/2101/2101_52021/<br>Progranning Assignnents/PA4/pa4_nuc lear.py, wdire' /Users/hamzazidoun/<br>Documents/2101/2ie1_s2e21/Progranning Assignments/PA4)<br>>>>Enter valid atomic number (Z) (1,118]: e<br>>Enter valid atonic number (z) (1,118]: -120<br>>>Enter valid atomic number (2) (1,118]: 200<br>>>Enter valid atomic number (2) (1,118): 5<br>A<br>binding<br>energy<br>binding energy<br>per Nucleon<br>-448.996<br>ww...<br>-89.799<br>-37.771<br>-11.856<br>-0.472<br>5.235<br>6.423<br>6.386<br>-226.623<br>-82.990<br>-3.778<br>8<br>47.111<br>64.228<br>70.245<br>55.009<br>35.952<br>1.794<br>-32.682<br>-78.825<br>-123.453<br>-177.641<br>-229.307<br>-289.143<br>11<br>12<br>12<br>4.584<br>2.766<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>0.128<br>-2.179<br>-4.927<br>-7.262<br>-9.869<br>-12.069<br>-14.457<br>The most stable nucleus has a mass number 10<br>

Extracted text: 1. Problem Description: The total nuclear binding energy is the energy required to split a nucleus of an atom in its component parts: protons and neutrons, or, collectively, the nucleons. It describes how strongly nucleons are bound to each other. When a high amount of energy is needed to separate the nucleons, it means nucleus is very stable and the neutrons and protons are tightly bound to each other. The atomic number or proton number (symbol Z) is the number of protons found in the nucleus of an atom. The sum of the atomic number Z and the number of neutrons N gives the mass number A of an atom. + Binding energy - Nucleus (smaller mass) Separated nucleons (greater mass) Figure 1: Binding Energy in the Nucleus The approximate nuclear binding energy Eb in million electron volts, of an atomic nucleus with atomic number Z and mass number A is calculated using the following formula: (A – 22)², as Eb = a,A – 4,A³ – az¬- as- Eb = a, A - a½A3 – az A A3 AZ where, a, = 15.67, az = 17.23, az = 0.75, a, = 93.2 ,and if A is odd if A and Z are both even if A is even and Z is Odd 12.0 as = (-12.0 The binding energy per nucleon (BEN) is calculated by dividing the binding energy (Eb) by the mass number (A). You are asked to write a program that requests the user for a valid atomic number (Z) then goes through all values of A from A = Z to A = 4Z. For example, if the user inputs 5 for Z then A will be all numbers from 5 (Z) to 20 (4 Z) inclusive, see the example output in figure 2. If the user enters invalid atomic number that is not between 1 and 118, the program should give the user another chance to enter a valid input as shown in figure 2. Your main task is to find the nucleus with the highest binding energy per nucleon, which corresponds to the most stable configuration (figure 2), and writes a copy of the table to a text file named output.txt (figure3). In (25]: runfilel'/Users/hanzazidoun/Documents/2101/2101_52021/ Progranning Assignnents/PA4/pa4_nuc lear.py, wdire' /Users/hamzazidoun/ Documents/2101/2ie1_s2e21/Progranning Assignments/PA4) >>>Enter valid atomic number (Z) (1,118]: e >Enter valid atonic number (z) (1,118]: -120 >>Enter valid atomic number (2) (1,118]: 200 >>Enter valid atomic number (2) (1,118): 5 A binding energy binding energy per Nucleon -448.996 ww... -89.799 -37.771 -11.856 -0.472 5.235 6.423 6.386 -226.623 -82.990 -3.778 8 47.111 64.228 70.245 55.009 35.952 1.794 -32.682 -78.825 -123.453 -177.641 -229.307 -289.143 11 12 12 4.584 2.766 14 15 16 17 18 19 20 0.128 -2.179 -4.927 -7.262 -9.869 -12.069 -14.457 The most stable nucleus has a mass number 10
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here