Home Blog Page 11

Kateřina Tomalová: Difference between revisions

0
Kateřina Tomalová: Difference between revisions

From Wikipedia, the free encyclopedia

Content deleted Content added


 

Line 75: Line 75:

== External links ==

== External links ==

* {{BWFB|81794|Katerina Tomalova}}

* {{BWF|B3B2087C-D852-4938-A9B7-3B5C9B3682D2}}

* {{|B3B2087C-D852-4938-A9B7-3B5C9B3682D2}}

* {{2015 European Games profile|tomalova-katerina-1017768|Katerina Tomalova}}

* {{COV profile|2717|Kateřina Tomalová}}

{{DEFAULTSORT:Tomalova, Katerina}}

{{DEFAULTSORT:Tomalova, Katerina}}


Latest revision as of 04:02, 18 October 2024

Badminton player

Kateřina Tomalová
Country Czech Republic
Born (1992-04-10) 10 April 1992 (age 32)
Ostrava, Czech Republic
Residence Prague, Czech Republic
Height 1.65 m (5 ft 5 in)
Weight 62 kg (137 lb)
Handedness Right
Highest ranking 93 (WS 18 October 2022)
65 (WD with Tereza Švábíková 25 May 2017)
77 (XD with Jaromír Janáček 22 September 2016)
BWF profile

Kateřina Tomalová (born 10 April 1992) is a Czech badminton player.[1][2] Trained at the TJ Sokol Klimkovice, Tomalová made her international debut in 2004, and later joining the national team in 2007. She was a champion at the 2012 National Championships in the women’s doubles. Tomalová entered the Badminton Europe Centre of Excellence (CoE) program in 2019.[3] She competed at the 2015 and 2019 European Games.[4][5]

BWF International Challenge/Series

[edit]

Women’s singles

Women’s doubles

  BWF International Challenge tournament
  BWF International Series tournament
  BWF Future Series tournament

Kateřina Tomalová: Difference between revisions

Fast Monte Carlo dose calculation with precomputed electron tracks and GPU power – Physics World

0
Fast Monte Carlo dose calculation with precomputed electron tracks and GPU power – Physics World






Fast Monte Carlo dose calculation with precomputed electron tracks and GPU power – Physics World





















Skip to main content



Fast Monte Carlo dose calculation with precomputed electron tracks and GPU power – Physics World

Discover more from Physics World


Copyright © 2024 by IOP Publishing Ltd and individual contributors

Lynn Skrifvars: Difference between revisions

0
Lynn Skrifvars: Difference between revisions

Diffusing Fooian-century BAR people

m top: prepended ‘Use mdy dates’ tag

 

Line 1: Line 1:

{{short description|American swimmer}}

{{short description|American swimmer}}

{{Use mdy dates|date=October 2024}}

{{Infobox swimmer

{{Infobox swimmer

| name = Lynn Skrifvars

| name = Lynn Skrifvars

American swimmer

Lynn Skrifvars

Lynn Skrifvars: Difference between revisions

Skrifvars (left) at the 1972 Olympics

Personal information
Full name Lynn Ellen Skrifvars
National team United States
Born (1951-02-08) February 8, 1951 (age 73)
Lynwood, California, U.S.
Height 5 ft 8 in (1.73 m)
Weight 130 lb (59 kg)
Sport
Sport Swimming
Strokes Backstroke, freestyle
Club Phillips 66

Lynn Ellen Skrifvars (born February 8, 1951), also known by her married name Lynn Nelson, is an American former competition swimmer who won a gold medal in the 4 × 100 m freestyle at the 1971 Pan American Games. Next year she swam for the gold medal-winning U.S. 4 × 100 m team at the 1972 Olympics, but did not receive a medal because she did not swim in the final. Individually, she competed in the preliminary heats of the 200-meter backstroke.[1]

Skrifvars earned a degree in physical therapy from the California State University, Long Beach and later worked as a physiotherapist. She also competed in masters swimming events.[1]

  1. ^ a b Sports-Reference.com, Olympic Sports, Athletes, Lynn Skrifvars. Retrieved October 20, 2012.

32.6 Fission – College Physics

0
32.6 Fission – College Physics

Summary

  • Define nuclear fission.
  • Discuss how fission fuel reacts and describe what it produces.
  • Describe controlled and uncontrolled chain reactions.

Nuclear fission is a reaction in which a nucleus is split (or fissured). Controlled fission is a reality, whereas controlled fusion is a hope for the future. Hundreds of nuclear fission power plants around the world attest to the fact that controlled fission is practical and, at least in the short term, economical, as seen in Figure 1. Whereas nuclear power was of little interest for decades following TMI and Chernobyl (and now Fukushima Daiichi), growing concerns over global warming has brought nuclear power back on the table as a viable energy alternative. By the end of 2009, there were 442 reactors operating in 30 countries, providing 15% of the world’s electricity. France provides over 75% of its electricity with nuclear power, while the US has 104 operating reactors providing 20% of its electricity. Australia and New Zealand have none. China is building nuclear power plants at the rate of one start every month.

32.6 Fission – College Physics
Figure 1. The people living near this nuclear power plant have no measurable exposure to radiation that is traceable to the plant. About 16% of the world’s electrical power is generated by controlled nuclear fission in such plants. The cooling towers are the most prominent features but are not unique to nuclear power. The reactor is in the small domed building to the left of the towers. (credit: Kalmthouts)

Fission is the opposite of fusion and releases energy only when heavy nuclei are split. As noted in Chapter 32.5 Fusion, energy is released if the products of a nuclear reaction have a greater binding energy per nucleon ( [latex]{\text{BE} /A}[/latex] ) than the parent nuclei. Figure 2 shows that [latex]{\text{BE} /A}[/latex] is greater for medium-mass nuclei than heavy nuclei, implying that when a heavy nucleus is split, the products have less mass per nucleon, so that mass is destroyed and energy is released in the reaction. The amount of energy per fission reaction can be large, even by nuclear standards. The graph in Figure 2 shows [latex]{\text{BE}/A}[/latex] to be about 7.6 MeV/nucleon for the heaviest nuclei ([latex]{A}[/latex] about 240), while [latex]{\text{BE}/A}[/latex] is about 8.6 MeV/nucleon for nuclei having [latex]{A}[/latex] about 120. Thus, if a heavy nucleus splits in half, then about 1 MeV per nucleon, or approximately 240 MeV per fission, is released. This is about 10 times the energy per fusion reaction, and about 100 times the energy of the average [latex]{\alpha}[/latex] , [latex]{\beta}[/latex] , or [latex]{\gamma}[/latex] decay.

Example 1: Calculating Energy Released by Fission

Calculate the energy released in the following spontaneous fission reaction:

[latex]{{^{238} \textbf{U}} \rightarrow {^{95} \text{Sr}} + {^{140} \text{Xe}} + 3n}[/latex]

given the atomic masses to be [latex]{m(^{238} \textbf{U} ) = 238.050784 \;\textbf{u}}[/latex], [latex]{m(^{95} \text{Sr}) = 94.919388 \;\textbf{u}}[/latex],  [latex]{m(^{140} \text{Xe}) = 139.921610 \;\textbf{u}}[/latex], and [latex]{m(n)=1.008665 \;\textbf{u}}[/latex] .

Strategy

As always, the energy released is equal to the mass destroyed times [latex]{c^2}[/latex] , so we must find the difference in mass between the parent [latex]{^{238} \textbf{U}}[/latex] and the fission products.

Solution

The products have a total mass of

[latex]\begin{array}{r @{{}={}} l} {m_{\text{products}}} & {94.919388 \;\textbf{u} + 139.921610 \;\textbf{u} +31.008665 \;\textbf{u}} \\[1em] & {237.866993 \;\textbf{u} .} \end{array}[/latex]

The mass lost is the mass of [latex]{^{238} \textbf{U}}[/latex] minus [latex]{m_{\text{products}}}[/latex] , or

[latex]{\Delta m = 238.050784 \;\textbf{u} – 237.8669933 \;\textbf{u} = 0.183791 \;\textbf{u},}[/latex]

so the energy released is

[latex]\begin{array} {r @{{}={}}l} {E} & {(\Delta m)c^2} \\[1em] & {(0.183791 \;\textbf{u}) \frac{931.5 \;\text{MeV}/c^2}{u}c^2 = 171.2 \;\text{MeV}.} \end{array}[/latex]

Discussion

A number of important things arise in this example. The 171-MeV energy released is large, but a little less than the earlier estimated 240 MeV. This is because this fission reaction produces neutrons and does not split the nucleus into two equal parts. Fission of a given nuclide, such as [latex]{^{238} \textbf{U}}[/latex] , does not always produce the same products. Fission is a statistical process in which an entire range of products are produced with various probabilities. Most fission produces neutrons, although the number varies with each fission. This is an extremely important aspect of fission, because neutrons can induce more fission, enabling self-sustaining chain reactions.

Spontaneous fission can occur, but this is usually not the most common decay mode for a given nuclide. For example, [latex]{^{238} \textbf{U}}[/latex] can spontaneously fission, but it decays mostly by [latex]{\alpha}[/latex] emission. Neutron-induced fission is crucial as seen in Figure 2. Being chargeless, even low-energy neutrons can strike a nucleus and be absorbed once they feel the attractive nuclear force. Large nuclei are described by a liquid drop model with surface tension and oscillation modes, because the large number of nucleons act like atoms in a drop. The neutron is attracted and thus, deposits energy, causing the nucleus to deform as a liquid drop. If stretched enough, the nucleus narrows in the middle. The number of nucleons in contact and the strength of the nuclear force binding the nucleus together are reduced. Coulomb repulsion between the two ends then succeeds in fissioning the nucleus, which pops like a water drop into two large pieces and a few neutrons. Neutron-induced fission can be written as

[latex]{n + {^A \textbf{X}} \rightarrow \;\text{FF}_1 + \text{FF}_2 + xn,}[/latex]

where [latex]{\text{FF}_1}[/latex] and [latex]{\text{FF}_2}[/latex] are the two daughter nuclei, called fission fragments, and [latex]{x}[/latex] is the number of neutrons produced. Most often, the masses of the fission fragments are not the same. Most of the released energy goes into the kinetic energy of the fission fragments, with the remainder going into the neutrons and excited states of the fragments. Since neutrons can induce fission, a self-sustaining chain reaction is possible, provided more than one neutron is produced on average — that is, if [latex]{x>1}[/latex] in [latex]{n + {^A \textbf{X}} \rightarrow \;\text{FF}_1 + \;\text{FF}_2 + xn}[/latex]. This can also be seen in Figure 3.

An example of a typical neutron-induced fission reaction is

[latex]{n + {_{92}^{235} \textbf{U}} \rightarrow {_{56}^{142} \text{Ba}} + {_{36}^{91} \text{Kr}} + 3n}.[/latex]

Note that in this equation, the total charge remains the same (is conserved): [latex]{92+0=56+36}[/latex]. Also, as far as whole numbers are concerned, the mass is constant: [latex]{1+235=142+91+3}[/latex]. This is not true when we consider the masses out to 6 or 7 significant places, as in the previous example.

A neutron gets absorbed in a nucleus, making it narrower in the middle, then finally breaking into two parts and ejecting some neutrons.
Figure 2. Neutron-induced fission is shown. First, energy is put into this large nucleus when it absorbs a neutron. Acting like a struck liquid drop, the nucleus deforms and begins to narrow in the middle. Since fewer nucleons are in contact, the repulsive Coulomb force is able to break the nucleus into two parts with some neutrons also flying away.
A uranium nucleus struck by a neutron produces two fragments and three neutrons, two of which continue to strike two other uranium nuclei and hence, initiate a chain reaction.
Figure 3. A chain reaction can produce self-sustained fission if each fission produces enough neutrons to induce at least one more fission. This depends on several factors, including how many neutrons are produced in an average fission and how easy it is to make a particular type of nuclide fission.

Not every neutron produced by fission induces fission. Some neutrons escape the fissionable material, while others interact with a nucleus without making it fission. We can enhance the number of fissions produced by neutrons by having a large amount of fissionable material. The minimum amount necessary for self-sustained fission of a given nuclide is called its critical mass. Some nuclides, such as [latex]{^{239} \text{Pu}}[/latex] , produce more neutrons per fission than others, such as [latex]{^{235} \textbf{U}}[/latex] . Additionally, some nuclides are easier to make fission than others. In particular, [latex]{^{235} \textbf{U}}[/latex] and [latex]{^{239} \text{Pu}}[/latex] are easier to fission than the much more abundant [latex]{^{238} \textbf{U}}[/latex] . Both factors affect critical mass, which is smallest for [latex]{^{239} \text{Pu}}[/latex].

The reason [latex]{^{235} \textbf{U}}[/latex] and [latex]{^{239} \text{Pu}}[/latex] are easier to fission than [latex]{^{238} \textbf{U}}[/latex] is that the nuclear force is more attractive for an even number of neutrons in a nucleus than for an odd number. Consider that [latex]{_{92}^{235} \textbf{U}}[/latex] has 143 neutrons, and [latex]{_{94} ^{239} \textbf{P}}[/latex] has 145 neutrons, whereas [latex]{_{92} ^{238} \textbf{U}}[/latex] has 146. When a neutron encounters a nucleus with an odd number of neutrons, the nuclear force is more attractive, because the additional neutron will make the number even. About 2-MeV more energy is deposited in the resulting nucleus than would be the case if the number of neutrons was already even. This extra energy produces greater deformation, making fission more likely. Thus, [latex]{^{235} \textbf{U}}[/latex] and [latex]{^{239} \text{Pu}}[/latex] are superior fission fuels. The isotope [latex]{^{235} \textbf{U}}[/latex] is only 0.72 % of natural uranium, while [latex]{^{238} \textbf{U}}[/latex] is 99.27%, and [latex]{^{239} \text{Pu}}[/latex] does not exist in nature. Australia has the largest deposits of uranium in the world, standing at 28% of the total. This is followed by Kazakhstan and Canada. The US has only 3% of global reserves.

Most fission reactors utilize [latex]{^{235} \textbf{U}}[/latex], which is separated from [latex]{^{238} \textbf{U}}[/latex] at some expense. This is called enrichment. The most common separation method is gaseous diffusion of uranium hexafluoride ([latex]{\text{UF}_6}[/latex]) through membranes. Since [latex]{^{235} \textbf{U}}[/latex] has less mass than [latex]{^{238} \textbf{U}}[/latex] , its [latex]{\text{UF}_6}[/latex] molecules have higher average velocity at the same temperature and diffuse faster. Another interesting characteristic of [latex]{^{235} \textbf{U}}[/latex] is that it preferentially absorbs very slow moving neutrons (with energies a fraction of an eV), whereas fission reactions produce fast neutrons with energies in the order of an MeV. To make a self-sustained fission reactor with [latex]{^{235} \textbf{U}}[/latex] , it is thus necessary to slow down (“thermalize”) the neutrons. Water is very effective, since neutrons collide with protons in water molecules and lose energy. Figure 4 shows a schematic of a reactor design, called the pressurized water reactor.

The figure shows a close-shielded vessel containing fuel rod and control rods along with a moderator in one chamber from which heat is taken out to the other chamber to change water to steam. Next, the steam is taken out from the vessel to run a turbine, and then it is condensed and sent back to the closed vessel.
Figure 4. A pressurized water reactor is cleverly designed to control the fission of large amounts of 235U , while using the heat produced in the fission reaction to create steam for generating electrical energy. Control rods adjust neutron flux so that criticality is obtained, but not exceeded. In case the reactor overheats and boils the water away, the chain reaction terminates, because water is needed to thermalize the neutrons. This inherent safety feature can be overwhelmed in extreme circumstances.

Control rods containing nuclides that very strongly absorb neutrons are used to adjust neutron flux. To produce large power, reactors contain hundreds to thousands of critical masses, and the chain reaction easily becomes self-sustaining, a condition called criticality. Neutron flux should be carefully regulated to avoid an exponential increase in fissions, a condition called supercriticality. Control rods help prevent overheating, perhaps even a meltdown or explosive disassembly. The water that is used to thermalize neutrons, necessary to get them to induce fission in [latex]{^{235} \textbf{U}}[/latex] , and achieve criticality, provides a negative feedback for temperature increases. In case the reactor overheats and boils the water to steam or is breached, the absence of water kills the chain reaction. Considerable heat, however, can still be generated by the reactor’s radioactive fission products. Other safety features, thus, need to be incorporated in the event of a loss of coolant accident, including auxiliary cooling water and pumps.

Example 2: Calculating Energy from a Kilogram of Fissionable Fuel

Calculate the amount of energy produced by the fission of 1.00 kg of [latex]{^{235} \textbf{U}}[/latex] , given the average fission reaction of [latex]{^{235} \textbf{U}}[/latex] produces 200 MeV.

Strategy

The total energy produced is the number of [latex]{^{235} \textbf{U}}[/latex] atoms times the given energy per [latex]{^{235} \textbf{U}}[/latex] fission. We should therefore find the number of [latex]{^{235} \textbf{U}}[/latex] atoms in 1.00 kg.

Solution

The number of [latex]{^{235} \textbf{U}}[/latex] atoms in 1.00 kg is Avogadro’s number times the number of moles. One mole of [latex]{^{235} \textbf{U}}[/latex] has a mass of 235.04 g; thus, there are [latex]{(1000 \;\text{g})/(235.04 \;\text{g/mol}) = 4.25 \;\text{mol}}[/latex] atoms is therefore,

[latex]{(4.25 \;\text{mol})(6.02 \times 10^{23} \; {^{235} \text{U/mol}}) = 2.56 \times 10^{24} \; {^{235} \textbf{U}}}.[/latex]

So the total energy released is

[latex]\begin{array}{r @{{}={}}l} {E} & {(2.56 \times 10^{24} \; {^{235} \textbf{U}})(\frac{200 \;\text{MeV}}{^{235} \textbf{U}})(\frac{1.60 \times 10^{-13} \;\text{J}}{MeV})} \\[1em] & {8.21 \times 10^{13} \;\text{J}} \end{array}[/latex]

Discussion

This is another impressively large amount of energy, equivalent to about 14,000 barrels of crude oil or 600,000 gallons of gasoline. But, it is only one-fourth the energy produced by the fusion of a kilogram mixture of deuterium and tritium as seen in Chapter 32.5 Fusion Example 1. Even though each fission reaction yields about ten times the energy of a fusion reaction, the energy per kilogram of fission fuel is less, because there are far fewer moles per kilogram of the heavy nuclides. Fission fuel is also much more scarce than fusion fuel, and less than 1% of uranium ([latex]{\text{the} \;{^{235} \textbf{U}}) is readily usable.

One nuclide already mentioned is [latex]{^{239} \text{Pu}}[/latex] , which has a 24,120-y half-life and does not exist in nature. Plutonium-239 is manufactured from [latex]{^{238} \textbf{U}}[/latex] in reactors, and it provides an opportunity to utilize the other 99% of natural uranium as an energy source. The following reaction sequence, called breeding, produces [latex]{^{239} \text{Pu}}[/latex] . Breeding begins with neutron capture by [latex]{^{238} \textbf{U}}[/latex]:

[latex]{{^{238} \textbf{U}} + n \rightarrow {^{239} \textbf{U}} + \gamma}.[/latex]

Uranium-239 then [latex]{\beta ^-}[/latex] decays:

[latex]{{^{239} \textbf{U}} \rightarrow {^{239} \text{Np}} + \beta ^- + v_e (\textbf{t}_{1/2} = 23 \;\text{min})}.[/latex]

Neptunium-239 also [latex]{\beta ^-}[/latex] decays:

[latex]{{^{239} \text{Np}} \rightarrow {^{239} \text{Pu}} + \beta ^- + v_e (\textbf{t}_{1/2} = 2.4 \;\textbf{d})}.[/latex]

Plutonium-239 builds up in reactor fuel at a rate that depends on the probability of neutron capture by [latex]{^{238} \textbf{U}}[/latex] (all reactor fuel contains more [latex]{^{238} \textbf{U}}[/latex] than [latex]{^{235} \textbf{U}}[/latex]). Reactors designed specifically to make plutonium are called breeder reactors. They seem to be inherently more hazardous than conventional reactors, but it remains unknown whether their hazards can be made economically acceptable. The four reactors at Chernobyl, including the one that was destroyed, were built to breed plutonium and produce electricity. These reactors had a design that was significantly different from the pressurized water reactor illustrated above.

Plutonium-239 has advantages over [latex]{^{235} \textbf{U}}[/latex] as a reactor fuel — it produces more neutrons per fission on average, and it is easier for a thermal neutron to cause it to fission. It is also chemically different from uranium, so it is inherently easier to separate from uranium ore. This means [latex]{^{239} \text{Pu}}[/latex] has a particularly small critical mass, an advantage for nuclear weapons.

PhET Explorations: Nuclear Fission

Start a chain reaction, or introduce non-radioactive isotopes to prevent one. Control energy production in a nuclear reactor!

image
Figure 5. Nuclear Fission
  • Nuclear fission is a reaction in which a nucleus is split.
  • Fission releases energy when heavy nuclei are split into medium-mass nuclei.
  • Self-sustained fission is possible, because neutron-induced fission also produces neutrons that can induce other fissions, [latex]{n + {^A \textbf{X}} \rightarrow \text{FF}_1 + \text{FF}_2 + xn}[/latex], where [latex]{\text{FF}_1}[/latex] and [latex]{\text{FF}_2}[/latex] are the two daughter nuclei, or fission fragments, and x is the number of neutrons produced.
  • A minimum mass, called the critical mass, should be present to achieve criticality.
  • More than a critical mass can produce supercriticality.
  • The production of new or different isotopes (especially [latex]{^{239} \text{Pu}}[/latex] by nuclear transformation is called breeding, and reactors designed for this purpose are called breeder reactors.

Conceptual Questions

1: Explain why the fission of heavy nuclei releases energy. Similarly, why is it that energy input is required to fission light nuclei?

2: Explain, in terms of conservation of momentum and energy, why collisions of neutrons with protons will thermalize neutrons better than collisions with oxygen.

3: The ruins of the Chernobyl reactor are enclosed in a huge concrete structure built around it after the accident. Some rain penetrates the building in winter, and radioactivity from the building increases. What does this imply is happening inside?

4: Since the uranium or plutonium nucleus fissions into several fission fragments whose mass distribution covers a wide range of pieces, would you expect more residual radioactivity from fission than fusion? Explain.

5: The core of a nuclear reactor generates a large amount of thermal energy from the decay of fission products, even when the power-producing fission chain reaction is turned off. Would this residual heat be greatest after the reactor has run for a long time or short time? What if the reactor has been shut down for months?

6: How can a nuclear reactor contain many critical masses and not go supercritical? What methods are used to control the fission in the reactor?

7: Why can heavy nuclei with odd numbers of neutrons be induced to fission with thermal neutrons, whereas those with even numbers of neutrons require more energy input to induce fission?

8: Why is a conventional fission nuclear reactor not able to explode as a bomb?

Problems & Exercises

1: (a) Calculate the energy released in the neutron-induced fission (similar to the spontaneous fission in Example 1)

[latex]{n + {^{238} \textbf{U}} \rightarrow {^{96} \text{Sr}} + {^{140} \text{Xe}} + 3n},[/latex]

given [latex]{m(^{96} \text{Sr}) = 95.921750 \;\textbf{u}}[/latex] and [latex]{m(^{140} \text{Xe}) = 139.92164}[/latex]. (b) This result is about 6 MeV greater than the result for spontaneous fission. Why? (c) Confirm that the total number of nucleons and total charge are conserved in this reaction.

2: (a) Calculate the energy released in the neutron-induced fission reaction

[latex]{n + {^{235} \textbf{U}} \rightarrow {^{92} \text{Kr}} + {^{142} \text{Ba}} + 2n},[/latex]

given [latex]{m(^{92} \text{Kr}) = 91.926269 \;\textbf{u}}[/latex] and

[latex]{m(^{142} \text{Ba}) = 141.916361 \;\textbf{u}}.[/latex]

(b) Confirm that the total number of nucleons and total charge are conserved in this reaction.

3: (a) Calculate the energy released in the neutron-induced fission reaction

[latex]{n+ {^{239} \text{Pu}} \rightarrow {^{96} \text{Sr}} + {^{140} \text{Ba}} + 4n},[/latex]

given [latex]{m(^{96} \text{Sr}) = 95.921750 \;\textbf{u}}[/latex] and [latex]{m(^{140} \text{Ba}) = 139.910581 \;\textbf{u}} 4.

(b) Confirm that the total number of nucleons and total charge are conserved in this reaction.

4: Confirm that each of the reactions listed for plutonium breeding just following Example 2 conserves the total number of nucleons, the total charge, and electron family number.

5: Breeding plutonium produces energy even before any plutonium is fissioned. (The primary purpose of the four nuclear reactors at Chernobyl was breeding plutonium for weapons. Electrical power was a by-product used by the civilian population.) Calculate the energy produced in each of the reactions listed for plutonium breeding just following Example 2. The pertinent masses are [latex]{m(^{239} \textbf{U}) = 239.054289 \;\textbf{u}}[/latex] ,  [latex]{m(^{239} \text{Np}) = 239.052932 \;\textbf{u}}[/latex] , and [latex]{m(^{239} \text{Pu}) = 239.052157 \;\textbf{u}}[/latex].

6: The naturally occurring radioactive isotope [latex]{^{232} \text{Th}}[/latex] does not make good fission fuel, because it has an even number of neutrons; however, it can be bred into a suitable fuel (much as [latex]{^{238} \textbf{U}}[/latex] is bred into [latex]{^{239} \textbf{P}}[/latex]).

(a) What are [latex]{Z}[/latex] and [latex]{N}[/latex] for [latex]{^{232} \text{Th}}[/latex]?

(b) Write the reaction equation for neutron captured by [latex]{^{232} \text{Th}}[/latex] and identify the nuclide [latex]{^AX}[/latex] produced in [latex]{n + {^{232} \text{Th}} \rightarrow {^AX} + \gamma }[/latex].

(c) The product nucleus [latex]{\beta ^-}[/latex] decays, as does its daughter. Write the decay equations for each, and identify the final nucleus.

(d) Confirm that the final nucleus has an odd number of neutrons, making it a better fission fuel.

(e) Look up the half-life of the final nucleus to see if it lives long enough to be a useful fuel.

7: The electrical power output of a large nuclear reactor facility is 900 MW. It has a 35.0% efficiency in converting nuclear power to electrical.

(a) What is the thermal nuclear power output in megawatts?

(b) How many [latex]{^{235} \textbf{U}}[/latex] nuclei fission each second, assuming the average fission produces 200 MeV?

(c) What mass of [latex]{^{235} \textbf{U}}[/latex] is fissioned in one year of full-power operation?

8: A large power reactor that has been in operation for some months is turned off, but residual activity in the core still produces 150 MW of power. If the average energy per decay of the fission products is 1.00 MeV, what is the core activity in curies?

Glossary

breeder reactors
reactors that are designed specifically to make plutonium
breeding
reaction process that produces 239Pu
criticality
condition in which a chain reaction easily becomes self-sustaining
critical mass
minimum amount necessary for self-sustained fission of a given nuclide
fission fragments
a daughter nuclei
liquid drop model
a model of nucleus (only to understand some of its features) in which nucleons in a nucleus act like atoms in a drop
nuclear fission
reaction in which a nucleus splits
neutron-induced fission
fission that is initiated after the absorption of neutron
supercriticality
an exponential increase in fissions

Solutions

Problems & Exercises

1: (a) 177.1 MeV

(b) Because the gain of an external neutron yields about 6 MeV, which is the average [latex]{\text{BE}/A}[/latex] for heavy nuclei.

(c) [latex]{A=1+238=96+140+1+1+1}[/latex], [latex]{Z=92=38+53}[/latex], [latex]{\text{efn} = 0=0}[/latex]

3: (a) 180.6 MeV

(b) [latex]{A=1+239=96+140+1+1+1+1}[/latex], [latex]{Z=94=38+56}[/latex], [latex]{\text{efn}=0=0}[/latex]

5: [latex]{{^{238} \textbf{U}} + n \rightarrow {^{239} \textbf{U}} + \gamma}[/latex] 4.81 MeV

[latex]{{^{239} \textbf{U}} \rightarrow {^{239} \text{Np}} + \beta ^- + v_e}[/latex] 0.753 MeV

[latex]{{^{239} \text{Np}} \rightarrow {^{239} \text{Pu}} + \beta ^-+ v_e}[/latex] 0.211 MeV

7: (a) [latex]{2.57 \times 10^3 \;\text{MW}}[/latex]

(b) [latex]{8.03 \times 10^{19} \;\text{fission/s}}[/latex]

(c) 991 kg

 

AI-assisted photonic detector identifies fake semiconductor chips – Physics World

0
AI-assisted photonic detector identifies fake semiconductor chips – Physics World






AI-assisted photonic detector identifies fake semiconductor chips – Physics World



















Skip to main content



AI-assisted photonic detector identifies fake semiconductor chips – Physics World

Discover more from Physics World


Copyright © 2024 by IOP Publishing Ltd and individual contributors

Control flow: Difference between revisions

0
Control flow: Difference between revisions

Execution order of computer commands

In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an imperative programming language from a declarative programming language.

Within an imperative programming language, a control flow statement is a statement that results in a choice being made as to which of two or more paths to follow. For non-strict functional languages, functions and language constructs exist to achieve the same result, but they are usually not termed control flow statements.

A set of statements is in turn generally structured as a block, which in addition to grouping, also defines a lexical scope.

Interrupts and signals are low-level mechanisms that can alter the flow of control in a way similar to a subroutine, but usually occur as a response to some external stimulus or event (that can occur asynchronously), rather than execution of an in-line control flow statement.

At the level of machine language or assembly language, control flow instructions usually work by altering the program counter. For some central processing units (CPUs), the only control flow instructions available are conditional or unconditional branch instructions, also termed jumps.

Control flow: Difference between revisions
A state diagram of a peptide ion mass mapping search process.

The kinds of control flow statements supported by different languages vary, but can be categorized by their effect:

  • Continuation at a different statement (unconditional branch or jump)
  • Executing a set of statements only if some condition is met (choice – i.e., conditional branch)
  • Executing a set of statements zero or more times, until some condition is met (i.e., loop – the same as conditional branch)
  • Executing a set of distant statements, after which the flow of control usually returns (subroutines, coroutines, and continuations)
  • Stopping the program, preventing any further execution (unconditional halt)

A label is an explicit name or number assigned to a fixed position within the source code, and which may be referenced by control flow statements appearing elsewhere in the source code. A label marks a position within source code and has no other effect.

Line numbers are an alternative to a named label used in some languages (such as BASIC). They are whole numbers placed at the start of each line of text in the source code. Languages which use these often impose the constraint that the line numbers must increase in value in each following line, but may not require that they be consecutive. For example, in BASIC:

In other languages such as C and Ada, a label is an identifier, usually appearing at the start of a line and immediately followed by a colon. For example, in C:

Success: printf("The operation was successful.\n");

The language ALGOL 60 allowed both whole numbers and identifiers as labels (both linked by colons to the following statement), but few if any other ALGOL variants allowed whole numbers. Early Fortran compilers only allowed whole numbers as labels. Beginning with Fortran-90, alphanumeric labels have also been allowed.

The goto statement (a combination of the English words go and to, and pronounced accordingly) is the most basic form of unconditional transfer of control.

Although the keyword may either be in upper or lower case depending on the language, it is usually written as:

   goto label

The effect of a goto statement is to cause the next statement to be executed to be the statement appearing at (or immediately after) the indicated label.

Goto statements have been considered harmful by many computer scientists, notably Dijkstra.

The terminology for subroutines varies; they may alternatively be known as routines, procedures, functions (especially if they return results) or methods (especially if they belong to classes or type classes).

In the 1950s, computer memories were very small by current standards so subroutines were used mainly to reduce program size. A piece of code was written once and then used many times from various other places in a program.

Today, subroutines are more often used to help make a program more structured, e.g., by isolating some algorithm or hiding some data access method. If many programmers are working on one program, subroutines are one kind of modularity that can help divide the work.

In structured programming, the ordered sequencing of successive commands is considered one of the basic control structures, which is used as a building block for programs alongside iteration, recursion and choice.

Minimal structured control flow

[edit]

In May 1966, Böhm and Jacopini published an article[1] in Communications of the ACM which showed that any program with gotos could be transformed into a goto-free form involving only choice (IF THEN ELSE) and loops (WHILE condition DO xxx), possibly with duplicated code and/or the addition of Boolean variables (true/false flags). Later authors showed that choice can be replaced by loops (and yet more Boolean variables).

That such minimalism is possible does not mean that it is necessarily desirable; after all, computers theoretically need only one machine instruction (subtract one number from another and branch if the result is negative), but practical computers have dozens or even hundreds of machine instructions.

What Böhm and Jacopini’s article showed was that all programs could be goto-free. Other research showed that control structures with one entry and one exit were much easier to understand than any other form,[citation needed] mainly because they could be used anywhere as a statement without disrupting the control flow. In other words, they were composable. (Later developments, such as non-strict programming languages – and more recently, composable software transactions – have continued this strategy, making components of programs even more freely composable.)

Some academics took a purist approach to the Böhm–Jacopini result and argued that even instructions like break and return from the middle of loops are bad practice as they are not needed in the Böhm–Jacopini proof, and thus they advocated that all loops should have a single exit point. This purist approach is embodied in the language Pascal (designed in 1968–1969), which up to the mid-1990s was the preferred tool for teaching introductory programming in academia.[2] The direct application of the Böhm–Jacopini theorem may result in additional local variables being introduced in the structured chart, and may also result in some code duplication.[3] Pascal is affected by both of these problems and according to empirical studies cited by Eric S. Roberts, student programmers had difficulty formulating correct solutions in Pascal for several simple problems, including writing a function for searching an element in an array. A 1980 study by Henry Shapiro cited by Roberts found that using only the Pascal-provided control structures, the correct solution was given by only 20% of the subjects, while no subject wrote incorrect code for this problem if allowed to write a return from the middle of a loop.[2]

Control structures in practice

[edit]

Most programming languages with control structures have an initial keyword which indicates the type of control structure involved.[clarification needed] Languages then divide as to whether or not control structures have a final keyword.

  • No final keyword: ALGOL 60, C, C++, Go, Haskell, Java, Pascal, Perl, PHP, PL/I, Python, PowerShell. Such languages need some way of grouping statements together:
    • ALGOL 60 and Pascal: beginend
    • C, C++, Go, Java, Perl, PHP, and PowerShell: curly brackets {}
    • PL/I: DOEND
    • Python: uses indent level (see Off-side rule)
    • Haskell: either indent level or curly brackets can be used, and they can be freely mixed
    • Lua: uses doend
  • Final keyword: Ada, APL, ALGOL 68, Modula-2, Fortran 77, Mythryl, Visual Basic. The forms of the final keyword vary:
    • Ada: final keyword is end + space + initial keyword e.g., ifend if, loopend loop
    • APL: final keyword is :End optionally + initial keyword, e.g., :If:End or :If:EndIf, Select:End or :Select:EndSelect, however, if adding an end condition, the end keyword becomes :Until
    • ALGOL 68, Mythryl: initial keyword spelled backwards e.g., iffi, caseesac
    • Fortran 77: final keyword is END + initial keyword e.g., IFENDIF, DOENDDO
    • Modula-2: same final keyword END for everything
    • Visual Basic: every control structure has its own keyword. IfEnd If; ForNext; DoLoop; WhileWend

If-then-(else) statements

[edit]

Conditional expressions and conditional constructs are features of a programming language that perform different computations or actions depending on whether a programmer-specified Boolean condition evaluates to true or false.

  • IF..GOTO. A form found in unstructured languages, mimicking a typical machine code instruction, would jump to (GOTO) a label or line number when the condition was met.
  • IF..THEN..(ENDIF). Rather than being restricted to a jump, any simple statement, or nested block, could follow the THEN key keyword. This a structured form.
  • IF..THEN..ELSE..(ENDIF). As above, but with a second action to be performed if the condition is false. This is one of the most common forms, with many variations. Some require a terminal ENDIF, others do not. C and related languages do not require a terminal keyword, or a ‘then’, but do require parentheses around the condition.
  • Conditional statements can be and often are nested inside other conditional statements. Some languages allow ELSE and IF to be combined into ELSEIF, avoiding the need to have a series of ENDIF or other final statements at the end of a compound statement.
Pascal: Ada:
if a > 0 then
  writeln("yes")
else
  writeln("no");
if a > 0 then
      Put_Line("yes");
else
      Put_Line("no");
end if;
C: Shell script:
if (a > 0) { 
    puts("yes");
}
else {
    puts("no");
}
if [ $a -gt 0 ]; then
      echo "yes"
else
      echo "no"
fi
Python: Lisp:
if a > 0: 
    print("yes")
else:
    print("no")
(princ
  (if (plusp a)
      "yes"
      "no"))

Less common variations include:

  • Some languages, such as Fortran, have a three-way or arithmetic if, testing whether a numeric value is positive, negative or zero.
  • Some languages have a functional form of an if statement, for instance Lisp’s cond.
  • Some languages have an operator form of an if statement, such as C’s ternary operator.
  • Perl supplements a C-style if with when and unless.
  • Smalltalk uses ifTrue and ifFalse messages to implement conditionals, rather than any fundamental language construct.

Case and switch statements

[edit]

Switch statements (or case statements, or multiway branches) compare a given value with specified constants and take action according to the first constant to match. There is usually a provision for a default action (“else”, “otherwise”) to be taken if no match succeeds. Switch statements can allow compiler optimizations, such as lookup tables. In dynamic languages, the cases may not be limited to constant expressions, and might extend to pattern matching, as in the shell script example on the right, where the *) implements the default case as a glob matching any string. Case logic can also be implemented in functional form, as in SQL’s decode statement.

Pascal: Ada:
case someChar of
  'a': actionOnA;
  'x': actionOnX;
  'y','z':actionOnYandZ;
  else actionOnNoMatch;
end;
case someChar is
  when 'a' => actionOnA;
  when 'x' => actionOnX;
  when 'y' | 'z' => actionOnYandZ;
  when others => actionOnNoMatch;
end;
C: Shell script:
switch (someChar) {
  case 'a': actionOnA; break;
  case 'x': actionOnX; break;
  case 'y':
  case 'z': actionOnYandZ; break;
  default: actionOnNoMatch;
}
case $someChar in 
   a)    actionOnA ;;
   x)    actionOnX ;;
   [yz]) actionOnYandZ ;;
   *)    actionOnNoMatch  ;;
esac
Lisp: Fortran:
(case some-char
  ((#\a)     action-on-a)
  ((#\x)     action-on-x)
  ((#\y #\z) action-on-y-and-z)
  (else      action-on-no-match))
select case (someChar)
  case ('a')
    actionOnA
  case ('x')
    actionOnX
  case ('y','z')
    actionOnYandZ
  case default
    actionOnNoMatch
end select

A loop is a sequence of statements which is specified once but which may be carried out several times in succession. The code “inside” the loop (the body of the loop, shown below as xxx) is obeyed a specified number of times, or once for each of a collection of items, or until some condition is met, or indefinitely. When one of those items is itself also a loop, it is called a “nested loop”.[4][5][6]

In functional programming languages, such as Haskell and Scheme, both recursive and iterative processes are expressed with tail recursive procedures instead of looping constructs that are syntactic.

Count-controlled loops

[edit]

Most programming languages have constructions for repeating a loop a certain number of times.
In most cases counting can go downwards instead of upwards and step sizes other than 1 can be used.

FOR I = 1 TO N
   xxx
NEXT I
for I := 1 to N do begin
   xxx
end;
DO I = 1,N
    xxx
END DO
for ( I=1; I<=N; ++I ) {
    xxx
}

In these examples, if N < 1 then the body of loop may execute once (with I having value 1) or not at all, depending on the programming language.

In many programming languages, only integers can be reliably used in a count-controlled loop. Floating-point numbers are represented imprecisely due to hardware constraints, so a loop such as

   for X := 0.1 step 0.1 to 1.0 do

might be repeated 9 or 10 times, depending on rounding errors and/or the hardware and/or the compiler version. Furthermore, if the increment of X occurs by repeated addition, accumulated rounding errors may mean that the value of X in each iteration can differ quite significantly from the expected sequence 0.1, 0.2, 0.3, …, 1.0.

Condition-controlled loops

[edit]

Most programming languages have constructions for repeating a loop until some condition changes. Some variations test the condition at the start of the loop; others test it at the end. If the test is at the start, the body may be skipped completely; if it is at the end, the body is always executed at least once.

DO WHILE (test)
    xxx
LOOP
repeat
    xxx
until test;
while (test) {
    xxx
}
do
    xxx
while (test);

A control break is a value change detection method used within ordinary loops to trigger processing for groups of values. Values are monitored within the loop and a change diverts program flow to the handling of the group event associated with them.

   DO UNTIL (End-of-File)
      IF new-zipcode <> current-zipcode
         display_tally(current-zipcode, zipcount)
         
         current-zipcode = new-zipcode
         zipcount = 0
      ENDIF
      
      zipcount++
   LOOP

Collection-controlled loops

[edit]

Several programming languages (e.g., Ada, D, C++11, Smalltalk, PHP, Perl, Object Pascal, Java, C#, MATLAB, Visual Basic, Ruby, Python, JavaScript, Fortran 95 and later) have special constructs which allow implicit looping through all elements of an array, or all members of a set or collection.

   someCollection do: [:eachElement |xxx].

   for Item in Collection do begin xxx end;

   foreach (item; myCollection) { xxx }

   foreach someArray { xxx }

   foreach ($someArray as $k => $v) { xxx }

   Collection<String> coll; for (String s : coll) {}

   foreach (string s in myStringCollection) { xxx }

   someCollection | ForEach-Object { $_ }

   forall ( index = first:last:step... )

Scala has for-expressions, which generalise collection-controlled loops, and also support other uses, such as asynchronous programming. Haskell has do-expressions and comprehensions, which together provide similar function to for-expressions in Scala.

General iteration constructs such as C’s for statement and Common Lisp’s do form can be used to express any of the above sorts of loops, and others, such as looping over some number of collections in parallel. Where a more specific looping construct can be used, it is usually preferred over the general iteration construct, since it often makes the purpose of the expression clearer.

Infinite loops are used to assure a program segment loops forever or until an exceptional condition arises, such as an error. For instance, an event-driven program (such as a server) should loop forever, handling events as they occur, only stopping when the process is terminated by an operator.

Infinite loops can be implemented using other control flow constructs. Most commonly, in unstructured programming this is jump back up (goto), while in structured programming this is an indefinite loop (while loop) set to never end, either by omitting the condition or explicitly setting it to true, as while (true) .... Some languages have special constructs for infinite loops, typically by omitting the condition from an indefinite loop. Examples include Ada (loop ... end loop),[7] Fortran (DO ... END DO), Go (for { ... }), and Ruby (loop do ... end).

Often, an infinite loop is unintentionally created by a programming error in a condition-controlled loop, wherein the loop condition uses variables that never change within the loop.

Continuation with next iteration

[edit]

Sometimes within the body of a loop there is a desire to skip the remainder of the loop body and continue with the next iteration of the loop. Some languages provide a statement such as continue (most languages), skip,[8] cycle (Fortran), or next (Perl and Ruby), which will do this. The effect is to prematurely terminate the innermost loop body and then resume as normal with the next iteration. If the iteration is the last one in the loop, the effect is to terminate the entire loop early.

Redo current iteration

[edit]

Some languages, like Perl[9] and Ruby,[10] have a redo statement that restarts the current iteration from the start.

Ruby has a retry statement that restarts the entire loop from the initial iteration.[11]

Early exit from loops

[edit]

When using a count-controlled loop to search through a table, it might be desirable to stop searching as soon as the required item is found. Some programming languages provide a statement such as break (most languages), Exit (Visual Basic), or last (Perl), which effect is to terminate the current loop immediately, and transfer control to the statement immediately after that loop. Another term for early-exit loops is loop-and-a-half.

The following example is done in Ada which supports both early exit from loops and loops with test in the middle. Both features are very similar and comparing both code snippets will show the difference: early exit must be combined with an if statement while a condition in the middle is a self-contained construct.

with Ada.Text IO;
with Ada.Integer Text IO;

procedure Print_Squares is 
    X : Integer;
begin
    Read_Data : loop
        Ada.Integer Text IO.Get(X);
    exit Read_Data when X = 0;
        Ada.Text IO.Put (X * X);
        Ada.Text IO.New_Line;
    end loop Read_Data;
end Print_Squares;

Python supports conditional execution of code depending on whether a loop was exited early (with a break statement) or not by using an else-clause with the loop. For example,

for n in set_of_numbers:
    if isprime(n):
        print("Set contains a prime number")
        break
else:
    print("Set did not contain any prime numbers")

The else clause in the above example is linked to the for statement, and not the inner if statement. Both Python’s for and while loops support such an else clause, which is executed only if early exit of the loop has not occurred.

Some languages support breaking out of nested loops; in theory circles, these are called multi-level breaks. One common use example is searching a multi-dimensional table. This can be done either via multilevel breaks (break out of N levels), as in bash[12] and PHP,[13] or via labeled breaks (break out and continue at given label), as in Go, Java and Perl.[14] Alternatives to multilevel breaks include single breaks, together with a state variable which is tested to break out another level; exceptions, which are caught at the level being broken out to; placing the nested loops in a function and using return to effect termination of the entire nested loop; or using a label and a goto statement. C does not include a multilevel break, and the usual alternative is to use a goto to implement a labeled break.[15] Python does not have a multilevel break or continue – this was proposed in PEP 3136, and rejected on the basis that the added complexity was not worth the rare legitimate use.[16]

The notion of multi-level breaks is of some interest in theoretical computer science, because it gives rise to what is today called the Kosaraju hierarchy.[17] In 1973 S. Rao Kosaraju refined the structured program theorem by proving that it is possible to avoid adding additional variables in structured programming, as long as arbitrary-depth, multi-level breaks from loops are allowed.[18] Furthermore, Kosaraju proved that a strict hierarchy of programs exists: for every integer n, there exists a program containing a multi-level break of depth n that cannot be rewritten as a program with multi-level breaks of depth less than n without introducing added variables.[17]

One can also return out of a subroutine executing the looped statements, breaking out of both the nested loop and the subroutine. There are other proposed control structures for multiple breaks, but these are generally implemented as exceptions instead.

In his 2004 textbook, David Watt uses Tennent’s notion of sequencer to explain the similarity between multi-level breaks and return statements. Watt notes that a class of sequencers known as escape sequencers, defined as “sequencer that terminates execution of a textually enclosing command or procedure”, encompasses both breaks from loops (including multi-level breaks) and return statements. As commonly implemented, however, return sequencers may also carry a (return) value, whereas the break sequencer as implemented in contemporary languages usually cannot.[19]

Loop variants and invariants

[edit]

Loop variants and loop invariants are used to express correctness of loops.[20]

In practical terms, a loop variant is an integer expression which has an initial non-negative value. The variant’s value must decrease during each loop iteration but must never become negative during the correct execution of the loop. Loop variants are used to guarantee that loops will terminate.

A loop invariant is an assertion which must be true before the first loop iteration and remain true after each iteration. This implies that when a loop terminates correctly, both the exit condition and the loop invariant are satisfied. Loop invariants are used to monitor specific properties of a loop during successive iterations.

Some programming languages, such as Eiffel contain native support for loop variants and invariants. In other cases, support is an add-on, such as the Java Modeling Language’s specification for loop statements in Java.

Some Lisp dialects provide an extensive sublanguage for describing Loops. An early example can be found in Conversional Lisp of Interlisp. Common Lisp[21] provides a Loop macro which implements such a sublanguage.

Loop system cross-reference table

[edit]

Programming language conditional loop early exit loop continuation redo retry correctness facilities
begin middle end count collection general infinite [1] variant invariant
Ada Yes Yes Yes Yes arrays No Yes deep nested No
APL Yes No Yes Yes Yes Yes Yes deep nested [3] Yes No No
C Yes No Yes No [2] No Yes No deep nested [3] deep nested [3] No
C++ Yes No Yes No [2] Yes [9] Yes No deep nested [3] deep nested [3] No
C# Yes No Yes No [2] Yes Yes No deep nested [3] deep nested [3]
COBOL Yes No Yes Yes No Yes No deep nested [15] deep nested [14] No
Common Lisp Yes Yes Yes Yes builtin only [16] Yes Yes deep nested No
D Yes No Yes Yes Yes Yes Yes[14] deep nested deep nested No
Eiffel Yes No No Yes [10] Yes Yes No one level [10] No No No [11] integer only [13] Yes
F# Yes No No Yes Yes No No No [6] No No
FORTRAN 77 Yes No No Yes No No No one level Yes
Fortran 90 Yes No No Yes No No Yes deep nested Yes
Fortran 95 and later Yes No No Yes arrays No Yes deep nested Yes
Go Yes No No Yes builtin only Yes Yes deep nested deep nested No
Haskell No No No No Yes No Yes No [6] No No
Java Yes No Yes No [2] Yes Yes No deep nested deep nested No non-native [12] non-native [12]
JavaScript Yes No Yes No [2] Yes Yes No deep nested deep nested No
Natural Yes Yes Yes Yes No Yes Yes Yes Yes Yes No
OCaml Yes No No Yes arrays,lists No No No [6] No No
PHP Yes No Yes No [2] [5] Yes [4] Yes No deep nested deep nested No
Perl Yes No Yes No [2] [5] Yes Yes No deep nested deep nested Yes
Python Yes No No No [5] Yes No No deep nested [6] deep nested [6] No
Rebol No [7] Yes Yes Yes Yes No [8] Yes one level [6] No No
Ruby Yes No Yes Yes Yes No Yes deep nested [6] deep nested [6] Yes Yes
Standard ML Yes No No No arrays,lists No No No [6] No No
Visual Basic .NET Yes No Yes Yes Yes No Yes one level per type of loop one level per type of loop
PowerShell Yes No Yes No [2] Yes Yes No ? Yes
  1. a while (true) does not count as an infinite loop for this purpose, because it is not a dedicated language structure.
  2. a b c d e f g h C’s for (init; test; increment) loop is a general loop construct, not specifically a counting one, although it is often used for that.
  3. a b c Deep breaks may be accomplished in APL, C, C++ and C# through the use of labels and gotos.
  4. a Iteration over objects was added in PHP 5.
  5. a b c A counting loop can be simulated by iterating over an incrementing list or generator, for instance, Python’s range().
  6. a b c d e Deep breaks may be accomplished through the use of exception handling.
  7. a There is no special construct, since the while function can be used for this.
  8. a There is no special construct, but users can define general loop functions.
  9. a The C++11 standard introduced the range-based for. In the STL, there is a std::for_each template function which can iterate on STL containers and call a unary function for each element.[22] The functionality also can be constructed as macro on these containers.[23]
  10. a Count-controlled looping is effected by iteration across an integer interval; early exit by including an additional condition for exit.
  11. a Eiffel supports a reserved word retry, however it is used in exception handling, not loop control.
  12. a Requires Java Modeling Language (JML) behavioral interface specification language.
  13. a Requires loop variants to be integers; transfinite variants are not supported. [1]
  14. a D supports infinite collections, and the ability to iterate over those collections. This does not require any special construct.
  15. a Deep breaks can be achieved using GO TO and procedures.
  16. a Common Lisp predates the concept of generic collection type.

Structured non-local control flow

[edit]

Many programming languages, especially those favoring more dynamic styles of programming, offer constructs for non-local control flow. These cause the flow of execution to jump out of a given context and resume at some predeclared point. Conditions, exceptions and continuations are three common sorts of non-local control constructs; more exotic ones also exist, such as generators, coroutines and the async keyword.

PL/I has some 22 standard conditions (e.g., ZERODIVIDE SUBSCRIPTRANGE ENDFILE) which can be raised and which can be intercepted by: ON condition action; Programmers can also define and use their own named conditions.

Like the unstructured if, only one statement can be specified so in many cases a GOTO is needed to decide where flow of control should resume.

Unfortunately, some implementations had a substantial overhead in both space and time (especially SUBSCRIPTRANGE), so many programmers tried to avoid using conditions.

Common Syntax examples:

 ON condition GOTO label

Modern languages have a specialized structured construct for exception handling which does not rely on the use of GOTO or (multi-level) breaks or returns. For example, in C++ one can write:

try {
    xxx1                                  // Somewhere in here
    xxx2                                  //     use: '''throw''' someValue;
    xxx3
} catch (someClass& someId) {             // catch value of someClass
    actionForSomeClass 
} catch (someType& anotherId) {           // catch value of someType
    actionForSomeType
} catch (...) {                           // catch anything not already caught
    actionForAnythingElse
}

Any number and variety of catch clauses can be used above. If there is no catch matching a particular throw, control percolates back through subroutine calls and/or nested blocks until a matching catch is found or until the end of the main program is reached, at which point the program is forcibly stopped with a suitable error message.

Via C++’s influence, catch is the keyword reserved for declaring a pattern-matching exception handler in other languages popular today, like Java or C#. Some other languages like Ada use the keyword exception to introduce an exception handler and then may even employ a different keyword (when in Ada) for the pattern matching. A few languages like AppleScript incorporate placeholders in the exception handler syntax to automatically extract several pieces of information when the exception occurs. This approach is exemplified below by the on error construct from AppleScript:

try
    set myNumber to myNumber / 0
on error e  number n  from f  to t  partial result pr
    if ( e = "Can't divide by zero" ) then display dialog "You must not do that"
end try

David Watt’s 2004 textbook also analyzes exception handling in the framework of sequencers (introduced in this article in the section on early exits from loops). Watt notes that an abnormal situation, generally exemplified with arithmetic overflows or input/output failures like file not found, is a kind of error that “is detected in some low-level program unit, but [for which] a handler is more naturally located in a high-level program unit”. For example, a program might contain several calls to read files, but the action to perform when a file is not found depends on the meaning (purpose) of the file in question to the program and thus a handling routine for this abnormal situation cannot be located in low-level system code. Watts further notes that introducing status flags testing in the caller, as single-exit structured programming or even (multi-exit) return sequencers would entail, results in a situation where “the application code tends to get cluttered by tests of status flags” and that “the programmer might forgetfully or lazily omit to test a status flag. In fact, abnormal situations represented by status flags are by default ignored!” Watt notes that in contrast to status flags testing, exceptions have the opposite default behavior, causing the program to terminate unless the program deals with the exception explicitly in some way, possibly by adding explicit code to ignore it. Based on these arguments, Watt concludes that jump sequencers or escape sequencers are less suitable as a dedicated exception sequencer with the semantics discussed above.[24]

In Object Pascal, D, Java, C#, and Python a finally clause can be added to the try construct. No matter how control leaves the try the code inside the finally clause is guaranteed to execute. This is useful when writing code that must relinquish an expensive resource (such as an opened file or a database connection) when finished processing:

FileStream stm = null;                    // C# example
try
{
    stm = new FileStream("logfile.txt", FileMode.Create);
    return ProcessStuff(stm);             // may throw an exception
} 
finally
{
    if (stm != null)
        stm.Close();
}

Since this pattern is fairly common, C# has a special syntax:

using (var stm = new FileStream("logfile.txt", FileMode.Create))
{
    return ProcessStuff(stm); // may throw an exception
}

Upon leaving the using-block, the compiler guarantees that the stm object is released, effectively binding the variable to the file stream while abstracting from the side effects of initializing and releasing the file. Python’s with statement and Ruby’s block argument to File.open are used to similar effect.

All the languages mentioned above define standard exceptions and the circumstances under which they are thrown. Users can throw exceptions of their own; C++ allows users to throw and catch almost any type, including basic types like int, whereas other languages like Java are less permissive.

C# 5.0 introduced the async keyword for supporting asynchronous I/O in a “direct style”.

Generators, also known as semicoroutines, allow control to be yielded to a consumer method temporarily, typically using a yield keyword (yield description) . Like the async keyword, this supports programming in a “direct style”.

Coroutines are functions that can yield control to each other – a form of co-operative multitasking without threads.

Coroutines can be implemented as a library if the programming language provides either continuations or generators – so the distinction between coroutines and generators in practice is a technical detail.

Non-local control flow cross reference

[edit]

Proposed control structures

[edit]

In a spoof Datamation article[31] in 1973, R. Lawrence Clark suggested that the GOTO statement could be replaced by the COMEFROM statement, and provides some entertaining examples. COMEFROM was implemented in one esoteric programming language named INTERCAL.

Donald Knuth’s 1974 article “Structured Programming with go to Statements”,[32] identifies two situations which were not covered by the control structures listed above, and gave examples of control structures which could handle these situations. Despite their utility, these constructs have not yet found their way into mainstream programming languages.

Loop with test in the middle

[edit]

The following was proposed by Dahl in 1972:[33]

   loop                           loop
       xxx1                           read(char);
   while test;                    while not atEndOfFile;
       xxx2                           write(char);
   repeat;                        repeat;

If xxx1 is omitted, we get a loop with the test at the top (a traditional while loop). If xxx2 is omitted, we get a loop with the test at the bottom, equivalent to a do while loop in many languages. If while is omitted, we get an infinite loop. The construction here can be thought of as a do loop with the while check in the middle. Hence this single construction can replace several constructions in most programming languages.

Languages lacking this construct generally emulate it using an equivalent infinite-loop-with-break idiom:

while (true) {
    xxx1
    if (not test)
        break
    xxx2
}

A possible variant is to allow more than one while test; within the loop, but the use of exitwhen (see next section) appears to cover this case better.

In Ada, the above loop construct (loopwhilerepeat) can be represented using a standard infinite loop (loopend loop) that has an exit when clause in the middle (not to be confused with the exitwhen statement in the following section).

with Ada.Text_IO;
with Ada.Integer_Text_IO;

procedure Print_Squares is 
    X : Integer;
begin
    Read_Data : loop
        Ada.Integer_Text_IO.Get(X);
    exit Read_Data when X = 0;
        Ada.Text IO.Put (X * X);
        Ada.Text IO.New_Line;
    end loop Read_Data;
end Print_Squares;

Naming a loop (like Read_Data in this example) is optional but permits leaving the outer loop of several nested loops.

Multiple early exit/exit from nested loops

[edit]

This construct was proposed by Zahn in 1974.[34] A modified version is presented here.

   exitwhen EventA or EventB or EventC;
       xxx
   exits
       EventA: actionA
       EventB: actionB
       EventC: actionC
   endexit;

exitwhen is used to specify the events which may occur within xxx,
their occurrence is indicated by using the name of the event as a statement. When some event does occur, the relevant action is carried out, and then control passes just after endexit. This construction provides a very clear separation between determining that some situation applies, and the action to be taken for that situation.

exitwhen is conceptually similar to exception handling, and exceptions or similar constructs are used for this purpose in many languages.

The following simple example involves searching a two-dimensional table for a particular item.

   exitwhen found or missing;
       for I := 1 to N do
           for J := 1 to M do
               if table[I,J] = target then found;
       missing;
   exits
       found:   print ("item is in table");
       missing: print ("item is not in table");
   endexit;

One way to attack a piece of software is to redirect the flow of execution of a program. A variety of control-flow integrity techniques, including stack canaries, buffer overflow protection, shadow stacks, and vtable pointer verification, are used to defend against these attacks.[35][36][37]

  1. ^ Böhm, Jacopini. “Flow diagrams, turing machines and languages with only two formation rules” Comm. ACM, 9(5):366-371, May 1966.
  2. ^ a b Roberts, E. [1995] “Loop Exits and Structured Programming: Reopening the Debate Archived 2014-07-25 at the Wayback Machine,” ACM SIGCSE Bulletin, (27)1: 268–272.
  3. ^ David Anthony Watt; William Findlay (2004). Programming language design concepts. John Wiley & Sons. p. 228. ISBN 978-0-470-85320-7.
  4. ^ “Nested Loops in C with Examples”. GeeksforGeeks. 2019-11-25. Retrieved 2024-03-14.
  5. ^ “Python Nested Loops”. www.w3schools.com. Retrieved 2024-03-14.
  6. ^ Dean, Jenna (2019-11-22). “Nested Loops”. The Startup. Retrieved 2024-03-14.
  7. ^ Ada Programming: Control: Endless Loop
  8. ^ “What is a loop and how we can use them?”. Archived from the original on 2020-07-28. Retrieved 2020-05-25.
  9. ^ “redo – perldoc.perl.org”. perldoc.perl.org. Retrieved 2020-09-25.
  10. ^ “control_expressions – Documentation for Ruby 2.4.0”. docs.ruby-lang.org. Retrieved 2020-09-25.
  11. ^ “control_expressions – Documentation for Ruby 2.3.0”. docs.ruby-lang.org. Retrieved 2020-09-25.
  12. ^ Advanced Bash Scripting Guide: 11.3. Loop Control
  13. ^ PHP Manual: “break”
  14. ^ perldoc: last
  15. ^ comp.lang.c FAQ list · “Question 20.20b”
  16. ^ [Python-3000] Announcing PEP 3136, Guido van Rossum
  17. ^ a b Kozen, Dexter (2008). “The Böhm–Jacopini Theorem is False, Propositionally”. Mathematics of Program Construction (PDF). Lecture Notes in Computer Science. Vol. 5133. pp. 177–192. CiteSeerX 10.1.1.218.9241. doi:10.1007/978-3-540-70594-9_11. ISBN 978-3-540-70593-2.
  18. ^ Kosaraju, S. Rao. “Analysis of structured programs,” Proc. Fifth Annual ACM Syrup.
    Theory of Computing, (May 1973), 240-252; also in J. Computer and System Sciences, 9,
    3 (December 1974). cited by Knuth, Donald (1974). “Structured Programming with go to Statements”. Computing Surveys. 6 (4): 261–301. CiteSeerX 10.1.1.103.6084. doi:10.1145/356635.356640. S2CID 207630080.
  19. ^ David Anthony Watt; William Findlay (2004). Programming language design concepts. John Wiley & Sons. pp. 215–221. ISBN 978-0-470-85320-7.
  20. ^ Meyer, Bertrand (1991). Eiffel: The Language. Prentice Hall. pp. 129–131.
  21. ^ “Common Lisp LOOP macro”.
  22. ^ for_each. Sgi.com. Retrieved on 2010-11-09.
  23. ^ Chapter 1. Boost.Foreach Archived 2010-01-29 at the Wayback Machine. Boost-sandbox.sourceforge.net (2009-12-19). Retrieved on 2010-11-09.
  24. ^ David Anthony Watt; William Findlay (2004). Programming language design concepts. John Wiley & Sons. pp. 221–222. ISBN 978-0-470-85320-7.
  25. ^ “Asyncio: Asynchronous I/O: Python 3.10.2 documentation”.
  26. ^ “Socketry/Async”. GitHub. 25 February 2022.
  27. ^ “Generators – the Rust Unstable Book”.
  28. ^ “Corona – Rust”.
  29. ^ “Getting Started – Asynchronous Programming in Rust”.
  30. ^ “Jitsi Meet”. Storm-enroute.com. Retrieved 2022-09-07.
  31. ^ We don’t know where to GOTO if we don’t know where we’ve COME FROM. This (spoof) linguistic innovation lives up to all expectations. Archived 2018-07-16 at the Wayback Machine By R. Lawrence Clark* From Datamation, December, 1973
  32. ^ Knuth, Donald E. “Structured Programming with go to Statements” ACM Computing Surveys 6(4):261-301, December 1974.
  33. ^ Dahl & Dijkstra & Hoare, “Structured Programming” Academic Press, 1972.
  34. ^ Zahn, C. T. “A control statement for natural top-down structured programming” presented at Symposium on Programming Languages, Paris, 1974.
  35. ^ Payer, Mathias; Kuznetsov, Volodymyr. “On differences between the CFI, CPS, and CPI properties”. nebelwelt.net. Retrieved 2016-06-01.
  36. ^ “Adobe Flash Bug Discovery Leads To New Attack Mitigation Method”. Dark Reading. 10 November 2015. Retrieved 2016-06-01.
  37. ^ Endgame. “Endgame to Present at Black Hat USA 2016”. www.prnewswire.com. Retrieved 2016-06-01.
  • Hoare, C. A. R. “Partition: Algorithm 63,” “Quicksort: Algorithm 64,” and “Find: Algorithm 65.” Comm. ACM 4, 321–322, 1961.

Enabling battery quality at scale – Physics World

0
Enabling battery quality at scale – Physics World






Enabling battery quality at scale – Physics World





















Skip to main content



Enabling battery quality at scale – Physics World

Discover more from Physics World


Copyright © 2024 by IOP Publishing Ltd and individual contributors

Wikipedia:Wiki Ed/University of Michigan-Dearborn/Environmental Politics (Fall 2024): Difference between revisions

0
Wikipedia:Wiki Ed/University of Michigan-Dearborn/Environmental Politics (Fall 2024): Difference between revisions

Line 17: Line 17:

The course focuses on environmental politics and policymaking, mostly in the United States, but with some attention across local, national, and global scales. Students will be focusing their Wikipedia work on environmental politics topics, potentially including political and policy decisions about the environment, political conflicts around the environment, environmental institutions or organizations, the effects of environmental concerns on politics, etc.

The course focuses on environmental politics and policymaking, mostly in the United States, but with some attention across local, national, and global scales. Students will be focusing their Wikipedia work on environmental politics topics, potentially including political and policy decisions about the environment, political conflicts around the environment, environmental institutions or organizations, the effects of environmental concerns on politics, etc.

{{students table}}

{{students table}}

{{student table row|Monika2024|[[Environment of Canada]], [[Regulation of chemicals]], [[European Chemicals Bureau]], [[Climate change in Europe]], [[Environmental impact of the Russian invasion of Ukraine]]|}}

{{student table row|Monika2024|[[Environment of Canada]], [[Regulation of chemicals]]|}}

{{student table row|Intelmononoke|[[Environmental impacts of animal agriculture]], [[Health and environmental effects of battery electric cars]], [[Direct air capture]]|}}

{{student table row|Intelmononoke|[[Environmental impacts of animal agriculture]], [[Health and environmental effects of battery electric cars]], [[Direct air capture]]|}}

{{student table row|Chaplikabob!0|[[Greenwashing]]|}}

{{student table row|Chaplikabob!0|[[Greenwashing]]|}}

Course name
Environmental Politics
Institution
University of Michigan-Dearborn
Instructor
Emily Luxon
Wikipedia Expert
Ian (Wiki Ed)
Subject
Political Science
Course dates
2024-09-03 00:00:00 UTC – 2024-12-20 23:59:59 UTC
Approximate number of student editors
40

The course focuses on environmental politics and policymaking, mostly in the United States, but with some attention across local, national, and global scales. Students will be focusing their Wikipedia work on environmental politics topics, potentially including political and policy decisions about the environment, political conflicts around the environment, environmental institutions or organizations, the effects of environmental concerns on politics, etc.

Student Assigned Reviewing
Monika2024 Environment of Canada, Regulation of chemicals
Intelmononoke Environmental impacts of animal agriculture, Health and environmental effects of battery electric cars, Direct air capture
Chaplikabob!0 Greenwashing
Bugsandslugs Sierra Leone
Naz2844 Flint water crisis
Mliodo Wildfire suppression
Bdasacco Household air pollution
Loloe312 Environmental racism, Environmental tax, Energy policy of the United Kingdom
Charlieumich
Wpuser2727 Environmental crime
Bsbl2004 2013 United Nations Climate Change Conference
Envpol Environmental policy of the United States
Sveit1 Climate policy of China
Politicaladventure Pollution in the United States
Research is c00L
AMileAMinute Wildlife corridor, Guerrilla gardening, Seed ball
Blakepet Climate Change Act 2008, Climate change denial, Plastic bag ban, List of environmental laws by country
VerballyConflicted
Carnivore1234
Doopaboy
Weevilbeetle
Fallenpol Latvian Green Party
Typedfrommycomputer Wildlife corridor
Bandar122 American Clean Energy and Security Act
Bionicgem Diversity, equity, and inclusion
Saltwaternaturalenv Environmental policy of the Donald Trump administration, Assistant Secretary of State for Oceans and International Environmental and Scientific Affairs
Panda23 24 Aarhus Convention, Million Tree Initiative, Citizens’ Climate Lobby
Mamangoes
Pandabackpack152 Mountaintop removal mining
BoredOnASunday OpenAI
Simba06 Electric vehicle
DetroitDolls Water in Michigan
DonavenGarrison

Draft:Amena Karimyan: Difference between revisions

0
Draft:Amena Karimyan: Difference between revisions

From Wikipedia, the free encyclopedia

Content deleted Content added


Line 6: Line 6:

Karimyan graduated in civil engineering from the [[Herat University]] . She worked as an engineer on the United Nations (UN) UN-Habitat project. In 2018, Karimyan and Sohail Karimi founded the Kayhana Astronomical Group. When the Taliban took over Afghanistan in 2021, they received threats and had to flee.

Karimyan graduated in civil engineering from the [[Herat University]] . She worked as an engineer on the United Nations (UN) UN-Habitat project. In 2018, Karimyan and Sohail Karimi founded the Kayhana Astronomical Group. When the Taliban took over Afghanistan in 2021, they received threats and had to flee.

She crossed the border into Pakistan to go to the Austrian embassy where she was to pick up a visa previously granted to her for scientific studies. On the way, she was captured and beaten by the Taliban. When she was released, she continued on her journey. Upon reaching the Austrian embassy, ​​she was denied a visa. A group of journalists appealed to the Austrian government. The case caught the attention of the German government , which granted Karimyan a visa, where he is currently a refugee in Germany. <ref>{{Cite web |last=Penelas |first=Sandra |date=2023-03-25 |title=“No quiero que las jóvenes afganas desperdicien sus vidas” |url=https://www.epe.es/es/sociedad/20230325/jovenes-afganas-refugiadas-desperdicien-vidas-85007066 |access-date=2024-10-18 |website=www.epe.es |language=es}}</ref>

She crossed the border into Pakistan to go to the Austrian embassy where she was to pick up a visa previously granted to her for scientific studies. On the way, she was captured and beaten by the Taliban. When she was released, she continued on her journey. Upon reaching the Austrian embassy, ​​she was denied a visa. A group of journalists appealed to the Austrian government. The case caught the attention of the German government , which granted Karimyan a visa, where he is currently a refugee in Germany. <ref>{{Cite web |last=Penelas |first=Sandra |date=2023-03-25 |title=“No quiero que las jóvenes afganas desperdicien sus vidas” |url=https://www.epe.es/es/sociedad/20230325/jovenes-afganas-refugiadas-desperdicien-vidas-85007066 |access-date=2024-10-18 |website=www.epe.es |language=es}}</ref>


Revision as of 03:29, 18 October 2024

Amena Karimyan (born 1996 Herāt ) is an Afghan astronomer , women’s rights activist and pioneer of astronomy in her country. She is also a civil engineer and founder of the Kayhana Astronomical Group , an organization that encourages young women and women in the field of astronomy. She was ranked as one of the 100 most inspiring women in the world by BBC 100 Women in 2021. [1]

Life

Karimyan graduated in civil engineering from the Herat University . She worked as an engineer on the United Nations (UN) UN-Habitat project. In 2018, Karimyan and Sohail Karimi founded the Kayhana Astronomical Group. When the Taliban took over Afghanistan in 2021, they received threats and had to flee.

She crossed the border into Pakistan to go to the Austrian embassy where she was to pick up a visa previously granted to her for scientific studies. On the way, she was captured and beaten by the Taliban. When she was released, she continued on her journey. Upon reaching the Austrian embassy, ​​she was denied a visa. A group of journalists appealed to the Austrian government. The case caught the attention of the German government , which granted Karimyan a visa, where he is currently a refugee in Germany. [2][3]

References

Kateřina Tomalová: Difference between revisions

Half-life measurement of samarium-146 could help reveal secrets of the early solar system – Physics World

0
Half-life measurement of samarium-146 could help reveal secrets of the early solar system – Physics World






Half-life measurement of samarium-146 could help reveal secrets of the early solar system – Physics World



















Skip to main content



Half-life measurement of samarium-146 could help reveal secrets of the early solar system – Physics World

Discover more from Physics World


Copyright © 2024 by IOP Publishing Ltd and individual contributors