text:
# How to Make a Battery with Metal, Air, and Saltwater

## Abstract

Have you ever wondered how your cell phone or laptop keeps running once you unplug it? Sure, it is the battery that makes your portable electronics work, but how exactly does a battery do that, and from where does the electricity come? Generally, in a battery chemical energy is converted into electrical energy. In fact, many different types of batteries exist that are all based on a different set of chemical reactions. In this science project, you will explore a special battery variant called the metal air battery—specifically, a zinc-air battery, sometimes also called a saltwater battery. How much electric current do you think it can generate?

## Summary

Areas of Science
Difficulty

Time Required
Very Short (≤ 1 day)
Prerequisites
Some knowledge of basic chemistry and familiarity with the concept of electrochemistry would be helpful.
Material Availability
This science project requires specialty electronics items. Specialty items are available in a kit from our partner Home Science Tools.
Cost
Average ($40 -$80)
Safety
Hydrogen peroxide can irritate the skin and eyes. When working with this chemical, make sure to wear eye and skin protection in case of any splashes or spills. In case of chemical contact, rinse skin or eyes immediately with plenty of water.
Credits
Svenja Lohner, PhD, Science Buddies
This science project was inspired by "The Salty Science of the Aluminum-Air Battery" experiment by Dr. Stephanie Chasteen, Dr. Dennis Chasteen, and Dr. Paul Doherty.

### Recommended Project Supplies

Get the right supplies — selected and tested to work with this project.

## Objective

Investigate the chemistry of a saltwater zinc-air battery, and measure how much voltage and current it can make.

## Introduction

If you need to power something on the go without an electric cord, what do you do? Rely on a battery, of course. You already know that batteries come in all sizes and shapes (Figure 1), from large car batteries to tiny hearing-aid batteries. But, what makes a battery work? Probably something complicated, right? Well, it does get complicated, but the basic idea is pretty simple. So simple that you can make a battery at home out of saltwater, metal, and air! But first, let us explore how a battery works.

Figure 1. A selection of different batteries of different shapes, sizes, and voltage outputs. (Image credit: by Lead holder, via Wikimedia Commons)

There is one thing that all batteries have in common; they consist of one or several electrochemical, or galvanic cells that are embedded in the battery container and that generate the electricity for all electrical devices connected. But what is a "galvanic cell"? It is a device that can generate electrical energy from chemical reactions. In general, electricity is defined as "the presence of an electric charge," which can be either positive or negative. An electric current is the flow of moving charges (usually in the form of electrons or ions) through an electric circuit. In a battery, the galvanic cell usually consists of two electrodes, usually made from metals or carbon, which are in contact with an electrolyte, as shown in Figure 2. The electrodes, as well as the electrolyte, both need to be electrically conductive to allow electrons and ions to flow through an external wire or load from one electrode to the other. Within the electrolyte, the charges are generally carried by ions, whereas electrons carry the charge through the electrodes into the external wires and the load that the battery is connected with. The question now is where do the electrons come from? Here is where the chemistry comes into play.

Electrons are generated through chemical reactions, called redox (reduction-oxidation) reactions, where negative charges (in the form of electrons) are transferred from one chemical to another. There are many different battery types that use different chemical reactions to generate electrons. Two common examples are the lithium ion battery or nickel cadmium battery. The voltage, or electric potential difference, that a battery can generate is mainly determined by the redox reactions that take place at both electrodes. By definition, the electrode at which the oxidation reaction happens, is called the anode, whereas the electrode at which the reduction reaction happens is called the cathode. During an oxidation reaction, a chemical compound loses an electron. This lost electron is transferred to another chemical compound, which then takes it up in a reduction reaction.

Figure 2. In a galvanic cell, two electrodes are in contact with an electrolyte. Due to the electrical potential difference of the redox reactions at the anode and cathode, a voltage is generated between the electrodes, which induces an electron flow from the anode into an external wire through a load into the cathode. In the electrolyte, charges are carried by cations (positively charged) and anions (negatively charged).

The battery type that you will explore in this science project is called a metal air battery or, more specifically, a zinc-air battery, sometimes also referred to as a saltwater battery. The zinc-air battery is a relatively mature technology and is most commonly used in hearing aids and watches due to its high energy density. The zinc-air battery that you will create has a zinc anode, a copper cathode, and saltwater as an electrolyte. Commercial zinc-air batteries use zinc powder as the anode, a porous carbon cathode, and potassium hydroxide (KOH) as the electrolyte, but the basic chemical reactions are the same. The name already hints at the chemical reactions that drive this battery; the zinc metal at the anode gets oxidized and releases electrons that are transferred to the copper cathode. Here, the electrons are taken up by oxygen (O2) from the air that is dissolved in the electrolyte. Once it comes in contact with the surface of the copper electrode inside the electrolyte, the oxygen is reduced to hydroxyl ions (OH-). As you can see from the chemical equations below, the copper electrode is not participating in this reaction, but instead, functions as a catalyst that facilitates the oxygen reduction. For more detailed information about the zinc-air battery chemistry, see the Technical Note at the end of this introduction.

Anode (oxidation): Cathode (reduction):

The need for a continuous oxygen supply as a fuel makes the metal air battery a cross between a traditional battery and a fuel cell, which runs on hydrogen and oxygen. As oxygen is usually not very soluble in liquids like saltwater, the flow of electrons—or the current output of your battery—will be limited by the availability of oxygen at the copper cathode. In this science project, you will explore how you can improve the flow of electrons in your battery using different methods (mechanical and chemical) that are aimed toward increasing the oxygen concentration in your electrolyte. How much current do you think your battery can generate?

Technical Note: Chemistry of the zinc-air battery

The chemical reactions that happen at the electrodes of a galvanic cell determine the voltage a battery can generate. The electrical potential difference between the anode and the cathode induces an electron flow and thus, generates electric current. In a zinc-air battery, the electrons are derived from the zinc anode that, once in contact with the electrolyte, releases electrons in the following oxidation reaction (Reaction 1).

Anode (oxidation):

Reaction 1: Reaction 2: Reaction 3:

The zinc joins the electrolyte as positive ions (Zn2+) where they combine with hydroxyl ions (OH-) to form insoluble zinc hydroxide (Zn(OH)2), as shown in Reaction 2. Zinc hydroxide can then decompose into zinc oxide (ZnO) and water (H2O), as shown in Reaction 3. In an alkaline electrolyte, such as potassium hydroxide, which is used in commercial zinc-air batteries, the zinc ions will react with the excess hydroxyl ions to form soluble zincate ions (Zn(OH)42-), as shown in Reaction 4. At a lower pH, or once the electrolyte is over saturated with zincate ions, these ions decompose into insoluble zinc oxide and water (Reaction 5).

Reaction 4: Reaction 5:

In addition to these electrochemical reactions, the zinc electrode can also corrode in a parasitic reaction that does not contribute to the generation of electric current, and creates hydrogen gas, as shown in Reaction 6.

Reaction 6:

The electrons that are left behind from the zinc electrode flow through an external wire into a load, such as an LED, and then into the copper electrode. There, oxygen from the surrounding air that is dissolved in the electrolyte, takes up the electrons (gets reduced) at the surface of the copper and forms hydroxyl ions. The copper itself is not participating in this reaction, as can be seen in Reaction 7, but instead reacts as a catalyst that facilitates the oxygen reduction process.

Cathode (reduction):

Reaction 7:

Combining the anode and cathode reactions results in the overall net reaction that takes place in a zinc-air battery and can be described as:

Net reaction:

Reaction 8:

Once you add additional chemicals to the electrolyte, such as hydrogen peroxide, bleach, or a different salt, the battery chemistry can change depending on if this chemical compound is electrochemically active or not. In the case of hydrogen peroxide (H2O2), which you will use in this experiment, two things can happen. First, as H2O2 is not very stable in water (especially in the presence of transition metals), it will decompose into oxygen and water according to Reaction 9.

Reaction 9:

At the same time, however, hydrogen peroxide can also react electrochemically with the cathode. Thus, instead of oxygen, H2O2 is taking up electrons from the copper electrode and forms hydroxyl ions (Reaction 10). This results in a change of the battery chemistry, which leads to a different cell voltage.

Reaction 10:

### Terms and Concepts

• Battery
• Electrochemistry
• Electrochemical, or galvanic cell
• Electricity
• Electric charge
• Current
• Electrode
• Electrolyte
• Redox (reduction-oxidation) reaction
• Voltage
• Electric potential difference
• Anode
• Cathode
• Metal air battery
• Zinc-air battery
• Catalyst
• Fuel cell
• Corrosion
• Open-circuit voltage
• Short-circuit current

### Questions

• What different types of batteries exist? What do they all have in common and how are they different from each other?
• What chemical reactions happen at the electrodes of a zinc-air battery? How would the reactions change if you replace the zinc anode with an aluminum anode?
• How is a metal air battery similar to a fuel cell?
• What role does the cathode material (copper or carbon) play in a metal air battery?
• Where are metal air batteries currently used and how do they compare to other batteries?

## Materials and Equipment

These specialty items can be purchased from our partner Home Science Tools:

• Veggie Power Battery Kit (1). From this you will need:
• Copper electrodes (3)
• Zinc electrodes (3)
• Digital multimeter with test leads
• Piezoelectric buzzer

You will also need to gather these items (not included in the kit):

• Plastic cups or Mason jars, 8 oz (3)
• Table salt (sodium chloride) (about 25 g)
• Measuring cup, metric
• Bowl that can hold at least 500 mL
• Teaspoon
• Tap water
• Kitchen scale
• Hydrogen peroxide (3%) (about 3 teaspoons), available at the pharmacy or grocery store
• Straw (paper or plastic)
• Paper towels for cleanup of any spills
• Timer or watch with second hand
• Pen
• Permanent marker
• Lab notebook

Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at scibuddy@sciencebuddies.org.

## Experimental Procedure

### Setting Up and Testing Your Zinc-Air Battery

1. Prepare the saltwater electrolyte for your zinc-air battery.
1. Place the bowl on your scale and put the balance back to zero (tare the scale).
2. Weigh 25 grams (g) of table salt (NaCl) into the bowl.
3. Fill your measuring cup with 500 milliliters (mL) of tap water.
5. Stir the solution with a clean spoon until all salt is dissolved.
2. Label three plastic cups or Mason jars #1–3 using a permanent marker. You will do three trials in parallel to make sure that you get accurate and reproducible results.
Trial #Electrode Condition at the BeginningElectrode Condition at the End
Anode (Zn) Cathode (Cu)Anode (Zn)Cathode (Cu)
1
2
3
Table 1. Data table for recording your observations about the zinc and copper electrodes (such as color, surface roughness, gloss, etcetera) at the beginning and at the end of your experiment.
1. Fill each of your labeled cups or jars with 150 mL of your prepared saltwater electrolyte.
2. In each of your cups or jars, insert one zinc and one copper electrode. Place them on opposite sides of the cup so they face each other. Be careful not to knock over the cups. The electrodes should remain in the saltwater electrolyte throughout the entire experiment. You have to make sure that they never touch each other to prevent an accidental short circuit.
3. Now you are ready to test if your batteries are working. Test each of your batteries successively.
1. Take one red and one green alligator clip cable from the Veggie Power Kit and connect one end of the green alligator cable to the zinc anode. Use the clip to attach the electrode to the cup wall, as shown in Figure 3. Note: Figure 3 shows a black alligator clip. Your kit may come with a green alligator clip instead of black. The colors of the cables are just used for convenience and color-coding circuits, but there is no practical difference between wires/cables with different colors.

Figure 3. Use the clips of the alligator cables to attach the electrodes to the cup or jar wall to hold them in place.

2. Take the red alligator clip cable and connect one end of the cable to the copper cathode. Again, attach the electrode to the cup wall with the clip to hold it in place.
3. Get the piezoelectric buzzer (round-shaped black object) from the kit. Connect the second end of the red alligator clip cable to buzzer's positive (red) wire, and the green alligator clip to the buzzer's negative (black) wire, as shown in Figure 4.

Figure 4. Alligator clips connected to the buzzer. Note: the buzzer shown in this picture has short metal pins, with one marked by a "+" sign for positive. Your buzzer may have longer red (positive) and black (negative) wires attached.

4. If your battery is working you should hear the buzzer making some loud noise. If you do not hear a sound, check your battery setup and all your cable connections, or refer to the Frequently Asked Questions. Make sure you did not connect the buzzer backwards by getting red and black wires mixed up.
5. Remove the buzzer from the alligator clip cables before you continue with the next step.

### Measuring Voltage and Current Output

1. Prepare a data table, like Table 2, in your lab notebook. You will use this table to record the open-circuit voltage (the voltage across both electrodes when no current is flowing) and the short-circuit current (the current when the battery's electrodes are shorted together) for each of your zinc-air batteries under different experimental conditions.
Treatment Trial # Open-circuit Voltage (V) Short-circuit Current (mA)
Beginning of Measurement (Highest Value) 3 Minutes Later
None 1
2
3
Average
Continuous stirring with straw 1
2
3
Average
Continuous blowing bubbles with straw 1
2
3
Average
+ 5 mL of 3% H2O2 1
2
3
Average
+ 5 mL of 3% H2O2 plus continuous stirring 1
2
3
Average
Table 2. Data table for recording open-circuit voltages and short-circuit currents of all your zinc-air batteries for each individual experimental condition.
1. Measure the open-circuit voltage and short-circuit current of each of your zinc-air batteries. Start with the first one and then continue with the other two trials. These values give you the highest voltage and the highest current that your battery can supply (but note that it cannot provide both at the same time). Refer to the Science Buddies resource How to Use a Multimeter if you need help using a multimeter.
1. Connect the alligator clip cables that are still connected to your electrodes to the multimeter leads, as shown in Figure 5.
1. First, plug the red multimeter probe into the multimeter port labeled VΩmA, and the black multimeter probe into the multimeter port labeled COM.
2. Now clip the end of the red alligator clip cable (still connected to your copper electrode) onto the metal part of the red multimeter probe.
3. Finally, clip the end of the green alligator clip cable (still connected to your zinc electrode) onto the metal part of the black multimeter probe.

Figure 5. Setup for measuring the open-circuit voltage and short-circuit current of your zinc-air batteries. Note: The multimeter screen has been blurred in the image. We do not want to give away the data!

2. Set the multimeter dial to measure in the 20 V range (the "20" in the upper left of the dial). Record the open-circuit voltage in your data table (Table 2).
3. Change the multimeter dial to measure in the 200 mA range (the "200m" on the right side of the dial). Quickly record the short-circuit current in your data table. The current will start to drop rapidly as the battery begins to drain and the oxygen dissolved in the electrolyte gets depleted.
4. Then set your timer to 3 minutes and record the short-circuit current again in your data table, even if it has not fully stabilized yet. These will be your results for the "no treatment" batteries.
5. Refer to the Help section if you get stuck or have trouble taking a reading.
2. Once you finished measuring the open-circuit-voltage and short-circuit-current of all three batteries, you are ready to start with your first mechanical treatment. Start with the first battery and repeat the procedure with the other two afterwards.
1. Keep the multimeter dial set to measuring direct current in the 200 mA range (the green "200m" on the right side of the dial). The readings should still be very low and fairly stable from your previous measurements. If the current is still rapidly decreasing, wait 3 more minutes until the reading has stabilized and does not change much anymore.
2. Take the straw and stir the solution (electrolyte) in the cup without knocking the cup over. It is okay to touch the electrodes with the straw, but do not bump them too hard.
3. Right after you started stirring, watch the short-circuit-current readings on your multimeter display. They probably will fluctuate a lot. In your data table, write down the highest current reading that you see during stirring.
4. Keep stirring and set your timer to 3 minutes. You will notice that the current readings will still fluctuate. After 3 minutes of treatment, while still stirring, record the highest reading of the short-circuit current in your data table.
5. Set the multimeter dial back to measure in the 20 V range (the "20" in the upper left of the dial). Repeat the stirring procedure and observe the voltage readings on the multimeter. Write down the voltage that you get when you stir the solution in your data table.
6. Set your multimeter dial back to measuring direct current in the 200 mA range (the "200m" on the right side of the dial) as you did before, and wait 5 minutes before you continue with the next step until the current reading is stable or does not change much anymore.
3. Next, you will continue with your second mechanical treatment. Repeat step 3, but this time, instead of stirring the electrolyte with the straw, use the straw to blow bubbles into the solution. Hold the straw close to the copper electrode, as this is where the dissolved oxygen gets reduced. Note: You do not have to blow bubbles continuously, and can breathe normally in between.
4. Now you will do the chemical treatment. Again, start with the first battery and then repeat the same treatment with the second and third one.
1. Keep the multimeter set to measuring direct current in the 200 mA range (the "200m" on the right side of the dial). The current reading should be stable again after completing step 4. If not, wait a little longer until the current does not change that much anymore.
2. Add 1 tsp. of 3% hydrogen peroxide to the electrolyte and quickly stir the solution with the spoon to disperse the H2O2 equally. Then stop stirring.
3. Immediately after adding the hydrogen peroxide and you have stopped stirring, record the current in your data table.
4. Just as with the mechanical treatment, wait 3 minutes for the current to get more stable and then write down the short-circuit-current in your data table (even if the current is still decreasing a little bit).
5. Set your multimeter back to measure DC voltage in the 20 V range (the white "20" in the upper left of the dial) and note down the voltage that you get with hydrogen peroxide added to your electrolyte.
5. The last treatment is the combination of chemical and mechanical treatment. With the hydrogen peroxide still added to your battery, repeat step 3 and stir the electrolyte with a straw for 3 minutes while you are monitoring the short-circuit current.
6. Once you have completed your data table (Table 2), you can start disassembling your zinc-air batteries.
1. Disconnect the alligator clip cables from the multimeter leads, as well as the two electrodes.
2. Take the zinc anode and the copper cathode out of the electrolyte solution and put them down on a paper towel. Look at their appearance and write down your observations in Table 1. Do they look different compared to the beginning?
3. Rinse the electrodes with tap water and dry them with a paper towel. How do the electrodes look now?
4. Optional: To see a more obvious electrode change, let the saltwater battery run for longer in short-circuit mode, meaning that you keep your electrodes in the saltwater electrolyte with the alligator clip cables attached. Disconnect the multimeter leads, then connect the free ends of the red and black alligator clips directly to each other. After one or two more days, take the electrodes out and assess their condition again.

1. Both your data tables should be complete. Making graphs helps you to visualize your data.
2. Make a bar graph in which you specify the treatment (none, stirring, blowing bubbles, hydrogen peroxide, hydrogen peroxide plus stirring) on the x-axis and plot the average short-circuit current that you measured after 3 minutes on the y-axis.
3. How does the current change with each treatment? Why do you think the current changed? What treatment resulted in the highest current output? If you need help with these questions, read the Technical Note in the Introduction to review the electrode reactions in the zinc-air battery.
4. Look at your data in Table 2. How do the initial current readings differ from the values you measured after 3 minutes? If you want to visualize your data, you can make another bar graph similar to the one you made in step 2, but this time plot the current that you measured at the very beginning of your treatment on the y-axis. Can you explain your data?
5. Make another bar graph that shows the treatment type on the x-axis and the average open-circuit voltage for each treatment on the y-axis.
6. How is the battery voltage influenced by the different treatments? Does the cell voltage change with any treatment? Remember that your treatments included mechanical and chemical treatments. Did the type of treatment matter? Note that the voltage or electrical potential difference of a battery is dependent on the redox reactions that happen at the electrodes. Looking at your results, do you think the presence of hydrogen peroxide changes the cell chemistry and electrode reactions? Tip: Revisit the Technical Note in the Introduction for more information.
7. Look at your observations in Table 1. Did the electrodes change at all over the course of the experiment? How do they look different? Can you explain your findings? Note: The time frame of your experiment might not be long enough to detect obvious electrode changes. Leave your battery setup in short-circuit measurement mode for 1–3 days to see how the electrodes of a zinc-air battery change over time. For this, leave the alligator clip cables connected to the electrodes, but instead of attaching the other ends of the cables to a buzzer or the multimeter, connect the free ends of the red and black alligator clips directly to each other.

### Troubleshooting

For troubleshooting tips, please read our FAQ: How to Make a Battery with Metal, Air, and Saltwater.

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

## Variations

• Can you find different ways of improving the performance of your zinc-air battery? Test if you get higher cell voltages and currents when adding other chemicals to your electrolyte, such as bleach, vinegar, or different salts such as Epsom salt. Will these additions change the cell chemistry? Do your own research or read through the references in the Bibliography to find out how the electrode reactions can change when adding different chemicals.
• The electrolyte of a battery has an important function. It has to be electrically conductive to be able to move charges from one electrode to the other as cations or anions. In your experiments, these are the sodium and chloride ions of the table salt (NaCl). What happens if you leave out the salt and only use tap water as the electrolyte? Will the battery work when you use distilled water that has most ions removed? How does your battery performance vary with different salt concentrations?
• Adding more chemicals to your electrolyte is only one way of changing the cell chemistry. What if you switched the electrode materials with a different metal? Try to exchange the zinc anode with an aluminum metal strip that you can cut out from a disposable aluminum tray, or just use aluminum foil as an electrode. How does the open-circuit voltage and the short-circuit current change in this battery setup? What are the anode and cathode reactions in this case?
• How does the zinc-air battery perform over a longer period of time? Let your whole battery setup (as shown in Figure 5 in the Procedure) run for several days and evaluate the battery performance (measuring open-circuit voltage and short-circuit current) twice a day. Does the voltage or the current change a lot? Observe both electrodes over time; what do you notice?
• Can your zinc-air battery create enough power to light up an LED? Use the red LED that comes with the Veggie Power Kit and find out. You can also connect several zinc-air batteries in series or parallel if one battery is not enough. See the Science Buddies project How to Turn a Potato Into a Battery for more details. How many batteries do you think you will need? Does the LED get brighter with blowing bubbles?
• How does the current of your zinc-air battery vary over time during all your different treatments? Instead of just writing down the short-circuit current at the beginning of your treatment and after 3 minutes, monitor the current over time from 0–5 minutes and record the values every 30 seconds. Make a graph showing the time on the x-axis and the current values on the y-axis. Do you see a difference between the individual treatments?

Q: Why am I getting negative voltage and current readings?
A: This simply means you either have your multimeter probes or connections to the copper and zinc electrodes switched. Refer to Figure 5 in the Procedure. Make sure the red probe is inserted into the VΩmA port and connected to the copper electrode, and the black probe is inserted into the COM port and connected to the zinc electrode.
Q: I cannot get the buzzer to work. What should I do?
A: The buzzer only lets current flow through it in one direction, and will not work if you connect it backwards. Refer to Figure 4 in the Procedure and pay attention to how the buzzer is connected.
Q: What setting should I use on my multimeter to measure voltage and current?
A: The general rule of thumb for making measurements with a multimeter is to start with the next highest scale above the value you expect to measure. Then, move to a smaller scale, if possible, to improve measurement accuracy. For this project:
• For voltage, start with the 20 volt (V) scale. If the measured value turns out to be less than 2 V, you can move down to the next lowest scale for improved accuracy. On the DT830L multimeter that comes with the Science Buddies Veggie Power Kit, these scales are labeled "20" and "2000m" on the upper left part of the dial. 2000m stands for 2,000 millivolts (mV), which is equal to 2 V.
• For current, start with the 200 milliamp (mA) scale. If the measured current is less than 20 mA, you can move down to the next lowest scale for improved accuracy. On the DT830L multimeter that comes with the kit from our partner Home Science Tools, these scales are labeled "200m" and "20m" on the right side of the dial.
If you need help using a multimeter, or if this is your first time using one, you should ask an adult for help, or refer to the Science Buddies resource How to Use a Multimeter.
Q: My multimeter's screen always reads "0.00" when I try to take a measurement. What is wrong?
A: Make sure you have your multimeter set up correctly. The red probe should be plugged into the port labeled VΩmA and the black probe should be plugged into the port labeled COM. You should start out with your dial settings at 20 V for measuring voltage or 200 mA for measuring current. Also make sure that all of your alligator clips are tightly connected to the multimeter probes and electrodes. If a single alligator clip comes loose, that will cause the multimeter to read 0.00.
Q: How can I make sure the voltage measurement function on my multimeter is working?
A: Test your multimeter on a normal household battery like a AA, AAA, or 9 V. Set your multimeter to measure 20 V (the "20" in the upper left of the dial). Important: Double-check to make sure your multimeter is set to measure voltage, not current. Measuring current in this configuration can damage the multimeter. Plug the black probe into the port labeled COM and the red probe into the port labeled VΩmA. Then, press the multimeter's red probe against the positive (+) end of the battery, and the black probe against the negative (-) end of the battery. Fresh AA and AAA batteries should produce about 1.5–1.6 V, and a 9 V battery should produce (not surprisingly) about 9 V. If you can successfully measure the voltage of a regular household battery, this means your multimeter's voltage measurement mode is working properly. Refer to the previous steps to look for other problems with your experimental setup. If you are still having trouble with your multimeter, contact service@homesciencetools.com for assistance.
Q: How can I make sure the current measurement function on my multimeter is working?
A: You can use a simple setup to determine if the current measurement function of your multimeter is working. It will require a 9 V battery, which is not included in your Veggie Power kit.

Your Veggie Power Kit should contain a 1,000 ohm, or 1 kilo-ohm (kΩ) resistor; a small, tan-colored cylindrical piece with two metal wires sticking out of it. You can use this resistor to test your multimeter as described here and shown in Figure 6.

1. Set your multimeter to measure current in the 20 mA range (the dial setting labeled "20m" on the right).
2. Plug the multimeter's black probe into the port labeled COM.
3. Plug the multimeter's red probe into the port labeled VΩmA.
4. Use a red alligator clip lead to connect the multimeter's red probe to the positive (+) terminal of the 9 V battery.
5. Use a black alligator clip lead to connect the multimeter's black probe to one of the resistor's leads.
6. Use another black alligator clip lead to connect the resistor's other lead to the 9 V battery's negative (-) terminal.
7. Your multimeter should read about 9 mA (maybe slightly less if you are not using a fresh battery).
1. If this works, then you know the current measurement function on your multimeter is working. If you are still having trouble with your experiment, the problem is with something else in your setup. See the other troubleshooting steps for more ideas.
2. If this does not work, and you are confident that you set up the test correctly as shown in Figure 6, then your multimeter might be defective or have a blown fuse. Please contact service@homesciencetools.com for assistance.
8. When you are done, disconnect the alligator clips so you do not drain the 9 V battery, and remember to turn your multimeter off.

Figure 6. Setup for making sure the multimeter has a working fuse. Note: this picture was taken with a 100,000 ohm resistor instead of a 1,000 ohm resistor, so the multimeter screen reads 0.08 instead of 8.
Q: The short-circuit current readings decrease rapidly and fluctuate during each treatment. What is wrong?
A: The short-circuit current of your battery will be highest at the very beginning and then decrease rapidly. This is because in your zinc-air battery, the dissolved oxygen in the electrolyte, reacts at the cathode and gets depleted rapidly. As it takes time for the oxygen to re-dissolve from the air into the electrolyte, the oxygen concentration in solution is the current-limiting factor. If at the cathode there is no more oxygen present that can take up the electrons that have been generated at the anode, the electron flow will stall and the current readings will go down. The purpose of the different mechanical and chemical treatments is to increase the amount of oxygen in the electrolyte so more electrons can flow from the anode to the cathode. During your treatments, the oxygen concentration will never be constant, even if you stir continuously, which is why you will see fluctuating current readings.
Q: The copper and zinc electrodes did not change during the experiment and still look the same? What should I do?
A: If you only run your battery for a short time, do not expect the electrodes to change significantly. However, as mentioned in the Procedure, you can also let your battery run for longer (in short-circuit mode). You should be able to see noticeable changes at the electrodes after a couple of days. As the zinc anode is getting oxidized, the zinc metal is slowly getting dissolved. You might notice some pitting at the electrode surface after several days. At the same time, zinc hydroxide is formed, as described in the Introduction, which you can see as a white precipitate floating in the electrolyte or stuck to the zinc anode. As the copper cathode is not directly participating in the electrode reaction, it should remain unchanged, but the shiny copper metal will eventually become blackish or greenish due to side reactions that can lead to precipitates like copper(II) oxide (CuO) or copper(II) hydroxide (Cu(OH)2) on the copper electrode.

## Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Everything in the environment, whether naturally occurring or of human design, is composed of chemicals. Chemists search for and use new knowledge about chemicals to develop new processes or products. Read more
Career Profile
The role that the chemical technician plays is the backbone of every chemical, semiconductor, and pharmaceutical manufacturing operation. Chemical technicians conduct experiments, record data, and help to implement new processes and procedures in the laboratory. If you enjoy hands-on work, then you might be interested in the career of a chemical technician. Read more
Career Profile
Chemical engineers solve the problems that affect our everyday lives by applying the principles of chemistry. If you enjoy working in a chemistry laboratory and are interested in developing useful products for people, then a career as a chemical engineer might be in your future. Read more

If you have purchased a kit for this project from Science Buddies, we are pleased to answer any question not addressed by the FAQ above.

1. What is your Science Buddies kit order number?
2. Please describe how you need help as thoroughly as possible:

Examples

Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
Bad Question I don't understand the instructions. Help!
Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
Bad Question Can I use a different part?

## News Feed on This Topic

, ,

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

#### MLA Style

Lohner, Svenja. "How to Make a Battery with Metal, Air, and Saltwater." Science Buddies, 11 Nov. 2021, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Chem_p107/chemistry/make-a-battery-with-metal-air-and-saltwater?from=Blog. Accessed 9 Aug. 2022.

#### APA Style

Lohner, S. (2021, November 11). How to Make a Battery with Metal, Air, and Saltwater. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Chem_p107/chemistry/make-a-battery-with-metal-air-and-saltwater?from=Blog

Last edit date: 2021-11-11
Top
Free science fair projects.


text:
• Followers 0

Introduction to Pointers, Structures and Linked-Lists Part 4

General and Gameplay Programming

Dynamic Memory Allocation

OK, so I mentioned allocation and deallocation. How do we go about this? Well, there is a standard function that is available from the library by including or by the name of 'malloc ()' and another that is the reverse of malloc, called 'free ()'. So how do these functions work? The malloc function has the following structure:

void *malloc(size_t size);

This means, that when you use malloc, you call it with the parameter for the size of the memory that you want to allocate, and the function returns a pointer to the memory block. A 'void *' (void pointer) is a special pointer. It has no defined type, and every defined type. You can cast this pointer to be any pointer you choose it to be. If I wanted to allocate a string of 20 characters dynamically, then the following code would suffice

char *Buffer; // Pointer to our dynamic buffer
Buffer = (char *)malloc(20);

The '(char *)' part in the code is the 'casting' of the void pointer to be of type 'char *'. Type casting is very useful and in this case is very important. Without typecasting the pointer to the allocated block, the program is likely to return errors. In the event that the memory allocation fails, the pointer that is returned is a NULL. The other thing that we need to have a look at in detail is the size of memory to be allocated.

When it comes to allocating memory for structures and types, we need to be careful to specify the right size for what we want. If I wanted to allocate enough room for an array of 20 integers (long integers) and I did the following then I would end up with unexpected errors

long *LArray;
LArray = (long *)malloc(20);

This would allocate enough room for 5 long integers. This is because size is measured in bytes, and a long integer is 4 bytes long. But what about when it comes to allocating for large structures? Do we have to add up all of the elements to figure out how big it is? The answer is no, because we can use a keyword that was created for this specific reason. The sizeof keyword evaluates the size of your structure, and by doing so you can allocate the correct memory for a new dynamic instance of that structure. Here is how we can make the above code correct for what we specified for it

long *LArray;
LArray = (long *)malloc(20*sizeof(long));

Before we actually use this array, we should ALWAYS check to see if the memory block was successfully allocated. That is quite simple, as in the event of failure to allocate the memory, the malloc function returns a NULL, so therefore our pointer should be NULL in such a case. Usually I return from a function in the event of an allocation failure.

if (!LArray)
return();

Now that we have the simple side of allocating memory, we can look at deallocation. Deallocation is quite a bit easier than what we had to go through for allocation. The one thing that you have to be sure of about freeing memory is that there is an allocated block of memory to free. Fortunately, we can do a memory deallocation in a single line, and with a line that also handles the error case.

if (LArray) free(LArray);

This checks that the pointer actually references something, and if it actually points somewhere then the reference is freed.

If you already have an allocated block of memory then you can also use the realloc () function, which reallocates memory to the size that you wanted using the current block of memory. If we wanted to reallocate the block for the LArray so that we could access 40 long integers, then we would do the following.

LArray = (long *)realloc(LArray, sizeof(long)*40);

You need to get the return value to determine if there was a failure (in which case it returns NULL) or if the memory block was moved during the reallocation.

So now that we can allocate and deallocate memory for simple data types, let us use this knowledge in conjunction with the linked list from the previous section. We will now write a function that allocates memory for a new Address to be added to the list.

int NewAddress(AddressPtr_t Head,
char Name[30],
char PhoneNo[10])
{
// Go to the end of the list
if(Cur)
while(Cur->Next)
Cur = Cur->Next;

// Allocate a new block of
// memory for this address

// ensure that the allocation passed
if (!Temp) return (FAILURE);

// Add the block to the end of the list
Temp->Next = NULL;
Cur->Next = Temp;

// Update the values of the new block
strcpy(Temp->Name, Name);
strcpy(Temp->PhoneNo, PhoneNo);
return (SUCCESS);
}

Firstly, the return values of 'FAILURE' and 'SUCCESS' are just macros defined in a way similar to SUCCESS being 0 and failure being 1, or however you want your errors handled through return values. I think that the function is fairly self-explanatory. There still remains one error though. It will not show up unless there was no original list to begin with. If the list was empty, then we need to modify it to avoid getting assertion errors.

int NewAddress(AddressPtr_t Head,
char Name[30],
char PhoneNo[10])
{

// Go to the end of the list
if(Cur)
while(Cur->Next)
Cur = Cur->Next;

// Allocate a new block of memory
// for this address

// ensure that the allocation passed
if (!Temp) return (FAILURE);

// Put a plug on the end of the list
Temp->Next = NULL;

if (!Cur)
{
// If this is the first element,
// then avoid assertion
Cur = Temp;
}
else
{
// Add to the end of the list
Cur->Next = Temp;
}

// Update the values of the new block
strcpy(Temp->Name, Name);
strcpy(Temp->PhoneNo, PhoneNo);
return (SUCCESS);
}

Do you understand what I did just there? Basically, if there was no elements in the list to start with, then Cur was pointing to NULL. If I tried to add to the end of the list by using 'Cur->Next' then I would be causing an assertion. There is no way to point to a NULL->Next, so we need to include a way of avoiding this.

We also need to include a CleanUp routine for when we have finished with our program, so as not to leave memory allocated where the system can't access it. For this, we can use the simple following function

int CleanUp (AddressPtr_t Head)
{
while (Cur)
{
Cur = Cur->Next;
}
return(SUCCESS);
}

Conclusion

Well, there you have it, a simple introduction to Dynamic Memory allocation for use in linked lists. Next I will be talking about specific algorithms for use in linked list systems in the region of Sorts, Searches and Saves.

One quick note before I go, though. In the two functions listed above, there is a parameter 'AddressPtr_t Head'. This is the start of the list. Seeing as we are using a single linked list, there needs to be a pointer to the beginning of the list so that each function can start at the beginning of the list and work to the end.

Cheers, Chris (aka. Dwarfsoft)

Author: Chris Bennett aka Dwarfsoft
Contact: dwarfsoft@hotmail.com
November 26, 2000
(C) Copyright Chris Bennett, 2000-2001

0

Followers 0

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

format: plain


text:
# Changes: 3.2#

General:

• Calling sequence of PetscBinarRead.m has been changed

• All XXXDestroy() functions now take a pointer to the object itself so that it can be nullified after destruction.

• PetscError() and SETERRQX() now take a MPI_Comm as the first argument to indicate where the error is known. If you don’t know what communicator use then pass in PETSC_COMM_SELF

• Added PetscObjectAddOptionsHandler() that allows adding new routines to any object that are called to process options when XXXSetFromOptions() is called.

• Changed PetscTruth to PetscBool, PETSC_TRUTH to PETSC_BOOL, PetscOptionsTruth to PetscOptionsBool, etc.

• Introduced PetscCopyMode

• Changed -log_history to -history and PetscLogOpenHistory() PetscLogCloseHistory() to PetscOpenHistory(), PetscCloseHistory() because “log” is reserved for related to the performance logging

• Changed PetscOptionsPrint() to PetscOptionsView()

• Changed PetscLogPrintSummary() to PetscLogView()

• Using gcc 4.6 you can now ./configure –with-precision=__float128 –download-qblaslapack to get computations in quad precision. gfortran 4.6 is also supported. Warning some of the PETSc printing of numbers in some places will print garbage. I haven’t figured out a way to handle the %G format. Can be run in parallel :-)

• PetscFListFind() now takes a searchlibraries flag, if this is set and the function is NOT found in the function list then the libraries and executable are searched (when shared or dynamic libraries are used). Previously it always search the libraries and executables if not found in the list.

• PetscOpenMPxxx() utilities are now PetscHMPIxxx() for hierarchical MPI, the previous name was bad

Logging:

• PetscCookie changed to PetscClassId in all forms.

config/configure.py:

• –with-64-bit-pointers option removed. It doesn’t work properly anway. The user should specify the correct 32bit or 64bit compilers to configure. For eg: configure --with-cc='gcc -m64'             --with-fc='gfortran -m64'

• Python requirement is changed from 2.2 to 2.3

• Changed –with-shared to –with-shared-libraries, –known-mpi-shared to –known-mpi-shared-libraries and –with-dynamic to –with-dynamic-loading

• The make macro PETSC_INCLUDE has been replaced by PETSC_CC_INCLUDES and PETSC_FC_INCLUDES for C and Fortran, respectively.

IS:

• ISBlock(),ISStride() are removed. Use PetscTypeCompare((PetscObject)is,ISBLOCK,&flag), PetscTypeCompare((PetscObject)is,ISSTRIDE,&flag) instead.

• Added ISCreate(), ISSetType(), ISRegister() etc to match style of other PETSc objects. Also added ISGeneralSetIndices(), ISBlockSetIndices(), ISStrideSetStride()

• ISCreateGeneral() and ISCreateBlock() now takes PetscCopyMode as an argument and hence ISCreateGeneralNC() and ISCreateGeneralWithArray() are not needed and removed. Use ISCreateGeneral() with the argument PETSC_OWN_POINTER and PETSC_USE_POINTER instead.

• ISLocalToGlobalMappingCreate() now takes PetscCopyMode as an additional argument and ISLocalToGlobalMappingCreateNC() is no longer needed and removed

• ISStrideToGeneral() is replaced with ISToGeneral() that works for all basic IS types.

• ISCreateBlock() now takes indexing relative to block, no longer relative to element. This is to match the paradigm of Vec/MatSetValuesBlocked()

• ISBlockGetBlockSize() is now ISGetBlockSize(). Block sizes can be set for conforming ISGENERAL and ISSTRIDE using ISSetBlockSize().

• ISAllGatherIndices() is removed, use ISCreateGeneral() then ISAllGather().

PF:

• The source array is marked constant in PFApply and the callback.

Vec:

• changed VecSqrt() to VecSqrtAbs()

• VecLoad() and VecLoadIntoVector() have been merged into a single NEW VecLoad() that takes a partially constructed vector as input and loads according to any type or sizes that have previously been set into the Vec.

• VecDestroyVecs(PetscInt n,Vec **) instead of VecDestroyVecs(Vec**,PetscInt n), also VecDestroyVecsF90(PetscInt n,{Vec, pointer :: x},PetscErrorCode ierr)

• VecLoad() does NOT access the options database to check for the VecType, call VecSetFromOptions() first if you wish to check it.

• VecDestroyVecs() now takes the pointer to the first array and zeros it on return

• VecDestroy() now zeros the pointer to the destroyed vector so it cannot be reused

• VecDestroyVecs(PetscInt n,Vec **) instead of VecDestroyVecs(Vec**,PetscInt n)

VecScatter:

• The ghost indices for VecCreateGhostBlock() and VecCreateGhostBlockWithArray() are now by block instead of by entry.

Mat:

• MAT_SOLVER_XXX is now MATSOLVERXXX

• MAT_PARTIONING_XXX is now MATPARTITIONINGXXX

• MATCOLORING_XXX is now MATCOLORINGXXX

• MATORDERING_XXX is now MATORDERINGXXX

• It is an error to call MatSetOption() before the implementation has been created (after MatSetSizes() and MatSetType()). Formerly, options were silently ignored in this circumstance.

• MatLoad() now takes a created Mat as input (and no longer a Mat type), if you provide the size and type in the Mat then that is used other defaults are used.

• MATCRL -> MATAIJCRL, MATSEQCRL -> MATSEQAIJCRL, MATMPICRL -> MATMPIAIJCRL

• MatCreateSeqCRL() -> MatCreateSeqAIJCRL() MatCreateMPICRL() -> MatCreateMPIAIJCRL()

• MATCSRPERM -> MATAIJPERM, MATSEQCSRPERM -> MATSEQAIJPERM, MATMPICSRPERM -> MATMPIAIJPERM

• MatCreateSeqCSRPERM() -> MatCreateSeqAIJPERM() MatCreateMPICSRPERM() -> MatCreateMPIAIJPERM()

• MatZeroRows() and MatZeroRowsIS() now take an x and b vector as optional arguments; if these are provided then the b[idx[i]] is set to diag*x[idx[i]]] for all rows listed in idx[].

• MatSetLocalToGlobalMapping() and MatSetLocalToGlobalMappingBlock() now take separate row and column maps. MatPreallocateSetLocal() has an extra argument for the column mapping.

• MatLoad() does NOT access the options database to check for the MatType, call MatSetFromOptions() first if you wish to check it.

• Removed MatMFFDSetFromOptions() since one can call MatSetFromOptions()

• MatGetLocalMat() and MatGetLocalMatCondensed() are now MatMPIAIJGetLocalMat() and MatMPIAIJGetLocalMatCondensed()

• MatOption MAT_USE_COMPRESSEDROW changed to MAT_CHECK_COMPRESSED_ROW

PC:

• PCFieldSplitSetIS() and PCFieldSplitSetFields() now take a split-name parameter which is used to define the options database keys.

• CHOLMOD can be used for Cholesky factorization using AIJ or SBAIJ(1) matrix formats.

• PCREDUNDANT now uses the inner KSP with the inner PC. Default is still preonly for KSP and LU for PC so default behavior is the same but now you can use for example -redundant_ksp_gmres. PCRedundantGetPC() is now changed to PCRedundantGetKSP()

• The header “petscmg.h” is renamed to “petscpcmg.h”, “petscasa.h” is renamed to “petscpcasa.h”.

• The preconditioner PCBFBT has been removed. The same functionality is available in PCFIELDSPLIT.

• PCOPENMP is now PCHMPI and its prefix is now -hmpi_ for heirarchical MPI

• PCMGSetGalerkin() has a second argument of type PetscBool.

KSP:

• KSPSetPreconditionerSide() changed to KSPSetPCSide() to match name of second argument

• -ksp_right_pc -ksp_left_pc changed to -ksp_pc_side left,right,symmetric to match KSPSetPCSide()

• Added KSPSPECEST which estimates the spectrum on the first solve and uses it to configure a reduction-free method for subsequent solves, intended for use when reductions are expensive such as levels of multigrid.

SNES:

• Add SNESKSPONLY, for solving linear problems with SNES.

• Added the minlambda argument to SNESLineSearchGetParams() and SNESLineSearchSetParams().

TS:

• Rename TSCRANK_NICHOLSON to TSCN and TSRUNGE_KUTTA to TSRK for consistency.

• TSSetIFunction() and TSSetRHSFunction() have an additional argument for the vector to compute the function value in. If PETSC_NULL is used, then one is created by the TS.

• TSSetMatrices() has been removed, use TSSetIFunction() and TSSetRHSFunction(), perhaps providing Jacobian matrices and TSComputeRHSFunctionLinear() and/or TSComputeRHSJacobianConstant(). See src/ts/examples/tutorials/ex{2,4,5,6}.c for an example.

• Changed TSStep() interface to only perform one step, added TSSolve() to perform multiple steps with callbacks and monitors if desired.

DM/DA:

• Change array argument of DAGetArray and related functions from void** to void* to avoid the need for an explicit cast (the argument still has the meaning of a pointer to d-dimensionally indexed array of user-defined node type, old code will still compile correctly but the cast is no longer necessary).

• DAGetCoordinates(), DAGetGhostedCoordinates(), and DAGetCoordinateDA() now return borrowed references. The returned object should not be destroyed by the user.

• Changed DASetVertexDivision to DASetOwnershipRanges

• The SDA object and all its method have been removed

• The DA, ADDA, Slice and DMComposite objects are now all represented by a DM object.

• Routines that began with ADDA and Slice now begin with DMADDA and DMSlice

• DA/ADDA/Slice/DMCompositeGetMatrix() -> DMGetMatrix(), similar for all other routines that have a DM version

• Removed DASetType(), DARegister() etc since they will all be handled via DMSetType() etc

• Added DMSetUp() that is called, for example, after all the parameters are passed to the DM object to actually construct the data structures; replace all calls to DASetType() with calls to DMSetUp()

• DAXXX() routines are now either DMXXX() or DMDAXXX() see petscdmda.h for details

• The operation DALocalToGlobal() which performed no communication can now be performed with DMLocalToGlobalBegin/End() with INSERT_VALUES.

• DAGetISLocalToGlobalMapping() and DAGetISLocalToGlobalMappingBlck() are now DMGetLocalToGlobalMapping() and DMGetLocalToGlobalMappingBlock() and are collective since they may be constructed lazily.

• Changed DMDAPeriodicType to DMDABoundaryType, and changed this enum to only specify one boundary (one for each dimension). This enum is now one of DMDA_BOUNDARY_NONE, DMDA_BOUNDARY_GHOSTED, or DMDA_BOUNDARY_PERIODIC. See DMDABoundaryType man page for more.

• DMDASetPeriodicity() is now DMDASetBoundaryType(), and API is changed to take three DMDABoundaryType arguments.

• Changed API for DMDACreate*D(), DMDAGetInfo() to take the correct number of DMDABoundaryType enums for the dimension.

• DMDASetGhostedCoordinates() is added to set coordinates of non-periodic ghost cells.

DMMG:

PetscViewer:

• PETSC_VIEWER_XXX is now PETSCVIEWERXXX

• Added PetscViewerASCIISynchronizedAllow() which must be called before using PetscViewerASCIISynchronizedPrintf()

SYS:

• PetscOptionsAtoi(),PetscOptionsAtod(),PetscOptionsAtol() -> PetscOptionsStringToInt(), PetscOptionsStringToReal(), PetscOptionsStringToBool()

• PetscFListFind() takes an additional argument to look up the symbol in dynamically loaded libraries if not already in the list.

• Added PetscBagSetOptionsPrefix(), which allows a prefix for the option names of bag items.


text:
# A newsletter publisher believes that over 52% of their readers own a Rolls Royce. For marketing...

###### Question:

A newsletter publisher believes that over 52% of their readers own a Rolls Royce. For marketing purposes, a potential advertiser wants to confirm this claim. After performing a test at the 0.01 level of significance, the advertiser failed to reject the null hypothesis. What is the conclusion regarding the publisher's claim?

#### Similar Solved Questions

##### Problem 2. Find thc radii of convcrgcncc and intcrvals of convcrgcncc for the following power series (a) Cnz1(-1)"nr" 00 (-l)"r" (b) Xn1 1 Ue '1 >7VfI0n? 6oinoe ~'V ' T Anf "n '. " ,dji /f0% '{] : J</.1 .( [ "(4 @ Ljegn) (-1)z" A, )n[ 4 "',' :6s (c) Cnz1 n2 3
Problem 2. Find thc radii of convcrgcncc and intcrvals of convcrgcncc for the following power series (a) Cnz1(-1)"nr" 00 (-l)"r" (b) Xn1 1 Ue '1 >7VfI0n? 6oinoe ~'V ' T Anf "n '. " ,dji /f0% '{] : J</.1 .( [ "(4 @ Ljegn) (-1)z" ...
##### Make for a heal envirommert Describe he euments in claveloping ifketie learng Lppefn learnn Sjstms Analyse...
make for a heal envirommert Describe he euments in claveloping ifketie learng Lppefn learnn Sjstms Analyse nursing Statins Thed can afket ushy ot Core...
##### In a simple linear regression , the following information is given:x - -24;y 45;x(x -x) - y) = 861; 2(1-.) = 700 Calculate b1: (Negative value should be indicated by minus sign: Round your answer to decimal places:)Calculate bo (Round intermediate calculations decimal places:)decimal places and final answerWhat is the sample regression equation? (Negative value should be indicated by minus sign: Round your answers to decima places:|c-2, Predict places:)equals -16_ (Round intermediate coefficie
In a simple linear regression , the following information is given: x - -24;y 45; x(x -x) - y) = 861; 2(1-.) = 700 Calculate b1: (Negative value should be indicated by minus sign: Round your answer to decimal places:) Calculate bo (Round intermediate calculations decimal places:) decimal places an...
##### Jane Eyre But now, of course, we must try to deal with the ending. So: what...
Jane Eyre But now, of course, we must try to deal with the ending. So: what do you make of the ending? Other ways of thinking about the question: What is the ending—or maybe another way of putting it is this: where do you consider the ending of the novel to begin, since my own sense is that ce...
##### Draw the most stable resonance form for the intermediate in the following electrophilic substitution reaction.CH;COCI AICl3You do not have to consider stereochemistry: Include all valence lone pairs in your answer: In cases where there is more than one answer; just draw one_CH3
Draw the most stable resonance form for the intermediate in the following electrophilic substitution reaction. CH;COCI AICl3 You do not have to consider stereochemistry: Include all valence lone pairs in your answer: In cases where there is more than one answer; just draw one_ CH3...
##### Point) Find particular solution toy" + 5y' + 6y = ~8te&t
point) Find particular solution to y" + 5y' + 6y = ~8te&t...
##### Please answer question 4, 5, 6 and and 7. thnks newconnect.mheducation.com/llow/connect 6 Homework problems Toxaway Company...
please answer question 4, 5, 6 and and 7. thnks newconnect.mheducation.com/llow/connect 6 Homework problems Toxaway Company is a merchandiser that segments its business into two divisions commercial and Residential. The company's accounting intern was asked to prepare segmented income statements...
##### Ckulate the pH &f J solution whose bufier solution contains (HSOs ] = 0 4SMand [SO;' ] = 0.60M ThepK, ol this coluton is 7.19. pH = pK; bog
Ckulate the pH &f J solution whose bufier solution contains (HSOs ] = 0 4SMand [SO;' ] = 0.60M ThepK, ol this coluton is 7.19. pH = pK; bog...
##### Previcus 3 8720 0 0 1845 0.8 Eormula List Question 28 U VL of them weigh breed 65 renowned able Ibs or more? Ilian sheep dogs weigh 65 pounds = intelligence and more. workethic -Asample of 13 adult dogs [s studied - equaoe Kalhuiuea 1
Previcus 3 8720 0 0 1845 0.8 Eormula List Question 28 U VL of them weigh breed 65 renowned able Ibs or more? Ilian sheep dogs weigh 65 pounds = intelligence and more. workethic -Asample of 13 adult dogs [s studied - equaoe Kalhuiuea 1...
##### Part III: Common Ion Effect: Solubility of Calcium Iodate in 0.01OOM Potassium IodateTrial AInitial burette reading of NazSzOjFinal burette reading of NazSzO3Volume of NazSzO3 used21.2Moles of thiosulfate ion usedMoles of IOxConcentration of IOx0100o M solution of KIOxis replaced with saturuted solution of Cu(IO )zprepared in 0.01000 M KIO} |Molar solubility (S) for calcium iodate in the presence of & common ion
Part III: Common Ion Effect: Solubility of Calcium Iodate in 0.01OOM Potassium Iodate Trial A Initial burette reading of NazSzOj Final burette reading of NazSzO3 Volume of NazSzO3 used 21.2 Moles of thiosulfate ion used Moles of IOx Concentration of IOx 0100o M solution of KIOxis replaced with satur...
##### Programming-Python Language
USE one of the two queue data structures (array or linked structure).Write a program to simulate a Division of Motor Vehicle (DMV) office. Here are the details:1.) Customer will enter the building at a rate of 1 every 1-5minutes2.) There are three clerks to help customers. Each clerk can process a c...
##### Lesson 3: unit vectors Honors Precalculus B Unit 5: VectorsGetting StartedUClonAcCLYRevic Assessment1010Use the image answer the question:Find the components of vector (9.1) (-5, (6,1)point)
Lesson 3: unit vectors Honors Precalculus B Unit 5: Vectors Getting Started UClon AcCLY Revic Assessment 10 10 Use the image answer the question: Find the components of vector (9.1) (-5, (6,1) point)...
##### Choose 1 of the 4 areas addressed below and discuss: the driver, one possible exposure, a...
Choose 1 of the 4 areas addressed below and discuss: the driver, one possible exposure, a related health outcome and impact : Vectors (mosquitoes, ticks, and fleas) can carry infective pathogens such as viruses, bacteria, and protozoa, which can be transferred from one host (carrier) to another. The...
##### Ihe Deterinatin_L Ksp Equilibrium ConstanL Data 0.20 M ofthe Meral lon Nickel (Il) Chloride Was used with an initial pH reading of 0,26 Drops o 4,0 NaQH Added pH Reading 026120 130 140 L50 160180 190
Ihe Deterinatin_L Ksp Equilibrium ConstanL Data 0.20 M ofthe Meral lon Nickel (Il) Chloride Was used with an initial pH reading of 0,26 Drops o 4,0 NaQH Added pH Reading 026 120 130 140 L50 160 180 190...
##### Cunous paitcms occurs in can predict the numbcr of shoke Ohacople who all shake hands with handshakes that will occur ifyou] bx onc anothat. tbe numbct 4en If we are 'of pcople 04t197 room of people_ 4e can determing the number of bandshakes by this line The first pcrson will shake hands (she won of rcasonings won shake his Own of the hand of the first- ohathchea Own) The sccond Penon will shake } OSamc reasoning). The fourth Person; they alcady shook) Tke third prrson will hands @ person
cunous paitcms occurs in can predict the numbcr of shoke Ohacople who all shake hands with handshakes that will occur ifyou] bx onc anothat. tbe numbct 4en If we are 'of pcople 04t197 room of people_ 4e can determing the number of bandshakes by this line The first pcrson will shake hands (she ...
##### 70.6 319 12.7 56.7 220 44.5 Two blocks on a frictionless table are held at rest...
70.6 319 12.7 56.7 220 44.5 Two blocks on a frictionless table are held at rest with a compressed spring between them. When the blocks are released, the spring pushes them apart and they move in opposite directions. The spring was compressed by 0.05 m. One of the blocks moves away at 0.28 m/s while...
##### 9. Using the diagram of the lac operon (regulates transcription of genes for lactose metabolizing enzymes)...
9. Using the diagram of the lac operon (regulates transcription of genes for lactose metabolizing enzymes) below, draw the appropriate positions for RNA polymerase and the CAP activator molecule when CAMP is present. Then draw the appropriate position for the repressor molecule when lactose is prese...
##### Give the delinition of Aa function and that of A ockd fuuction; Show that the product of odd functions Crc function: Sketch the following periodic function for periods:Marks _Mauks _In 2 < < <u 0 <1 < In? f(s= 2lu 2) otherwiSC _f(f)State whether f() is GVCn; otkd or ueit hcr. Briefly explait YOll MwCMaks _
Give the delinition of Aa function and that of A ockd fuuction; Show that the product of odd functions Crc function: Sketch the following periodic function for periods: Marks _ Mauks _ In 2 < < <u 0 <1 < In? f(s= 2lu 2) otherwiSC _ f(f) State whether f() is GVCn; otkd or ueit hcr. Br...
##### According to the Balassa-Samuelson effect
According to the Balassa-Samuelson effect, price levels are related to productivity in the tradables sector.a. Explain the intuition behind the Balassa-Samuelson effect.b. What does the Balassa-Samuelson effect imply for differences in price levels between rich and poor countries?c. What does the Ba...
##### For a certain data set, a z-score of +2 corresponds to ð‘¥ = 65, while a z-score of -1 corresponds to ð‘¥ = 29. Determine the mean and standard deviation of this data.Please explain in detail so i understand and can solve similar problems in the future. thank you.
For a certain data set, a z-score of +2 corresponds to ð‘¥ = 65, while a z-score of -1 corresponds to ð‘¥ = 29. Determine the mean and standard deviation of this data.Please explain in detail so i understand and can solve similar problems in the future. thank you....


text:
# Tag Info

0

In addition to Steven B. Segletes' answer, I have made a modification that offers to separate scaling-relevant from scaling-irrelevant arguments, so that, for example, a trimmed image can be used as the scaling base: \usepackage{graphicx,fp} \newcount\scaledwidth \newcount\unscaledwidth \newcommand{\SetTrimIncludegraphics}[3]{% % #1: scaling, #2: trimming ...

3

You can use \resizebox with the height given as the same height as a capital letter, e.g. A: \documentclass{article} \usepackage{graphicx} \newlength{\CapLen} \AtBeginDocument{\settoheight{\CapLen}{A}} % after \normalsize \begin{document} N\resizebox{!}{\CapLen}{$\alpha$}ME \end{document}

3

Here I introduce \SetIncludegraphics[]{} for the reference image whose purpose is to compute the \myscale while setting the image. What it does (in temporary boxes) is compare the results of the \includegraphics with and without the application of the optional argument. The \myscale is computed as the ratio of the widths of two images with vs. without the ...

3

With expl3 facilities, you can easily get the scaling factor: \documentclass{article} \usepackage{graphicx} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\setscale}{mmm} {% #1 is the object to scale, % #2 the width to scale to, % #3 the name for the scale factor \hbox_set:Nn \l_tmpa_box { #1 } \tl_clear_new:c {l_douba_scale_#3_tl} \...

5

The following example defines \setscalewidth[<options>]{<image} (and \setscaleheight) to set the scale used by LaTeX when including an image using \includegraphics[<options>]{<image>}: \documentclass{article} \usepackage{xparse,graphicx} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n \ExplSyntaxOff \makeatletter \newcommand{\...

5

Here is my try:  The three images have different widths (big, medium and small), but the star has the same size on each. I used \settowidth to get the original image width, and \pgfmathsetmacro to divide the dimentions (answere by Matthew Leingang here helped me). \documentclass{article} \usepackage{graphicx} \usepackage{pgf} \begin{document} \newlength{\...

3

You can also use forest which optimizes trees sizes. I've changed slide distribution and distributed its contents in two columns. \documentclass{beamer} \mode<presentation> { \usetheme{Madrid} \usecolortheme[RGB={0,0,0}]{structure} } \usepackage{forest} \begin{document} \begin{frame} \frametitle{Example: AVL Trees} \begin{columns} \column{.5\...

2

transform canvas seems to mess things up for some reason, but you don't need that, nor the resizebox. Just reduce the font size of the nodes, the level distance and the sibling distances. \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame} \frametitle{Example: AVL Trees} \textbf{2.} Consider the following tree $T$: \begin{tikzpicture}[...

1

Your standalone file uses fontsize=12pt while the main document uses KOMA's default which is 11pt. So the letters and numbers must be larger with mode=build than with mode=tex. The value of compat should be the same in both the main and the standalone file. But you forgot \pgfplots{compat=newest} in the standalone file. If there is no compat set the ...

1

Here, I first save the original geometry, Then, I place the page one contents in a saved \vbox, then change the geometry and present a scaled version of the box. Finally, I restore the original geometry for the next page. EDITED to apply \centering to \scalebox, as noted by OP. Note: I employ \savegeometry{} and \loadgeometry{}, but as runartrollet notes, ...

1

Using \scalebox is not always that pretty. Although you said that you didn't want to change the font for every field, this is exactly what I suggest you do. It keeps the font sizes consistent through your documents, and for the title, there really isn't that many fields. Have a look at Wikisbooks' article on font sizing for the different macros for the sizes....

1

You can vastly simplify your code: the minipages are not needed, nor the center environments. Also, a figure environment can contain any number of \caption commands, so you just need one (and definitely no [H] option). Apply a \footnotesize command as soon as the figure environment starts. I also fixed the appearance of text subscripts to be upright. \...

Top 50 recent answers are included


text:
# How do you find the product t(4t^2+15t+4)-4(3t-1)?

Apr 11, 2018

$4 {T}^{3} + 15 {T}^{2} - 8 T - 4$

#### Explanation:

$\left(4 {T}^{3} + 15 {T}^{2} + 4 T\right) - \left(12 T + 4\right)$
$4 {T}^{3} + 15 {T}^{2} + 4 T - 12 T - 4$
$4 {T}^{3} + 15 {T}^{2} - 8 T - 4$


text:
Review question

# For what values of $k$ is $x^2 + 6kx +144$ always positive? Add to your resource collection Remove from your resource collection Add notes to this resource View your notes for this resource

Ref: R6526

## Suggestion

Write $x^2 + 6kx +144$ in the form $(x+p)^2+q$ and thus obtain expressions for $p$ and $q$ in terms of $k$.

Hence find the range of values for $k^2$ such that $x^2+6kx+144$ is positive for all values of $x$, and deduce the corresponding range of values for $k$.

When drawing the graph of $y = (x+p)^2+q$, what do $p$ and $q$ represent?

How does knowing $p$ and $q$ help us to determine whether the quadratic function is always positive?

Here is the graph of $y = x^2+6kx+144$.


text:
# Work done by cyclic process (thermodynamics)

## Homework Statement

http://s9.postimage.org/5iw5rixyl/image.jpg
(sorry doesn't let me embed)

## Homework Equations

P1V1=P2V2
and
PV=nRT

I know that Work done by gas from a --> b = (nRT)*Integral(V2/V1)
My question is do i use PV=nRT to find N? and if T is constant (isothermal) what do I plug in for T when evaluating work?

Using PV=nRT I got n= 14.440 when T=constant (1), is this correct?

I appreciate all of your help.

Last edited:

## Answers and Replies

bump. i really need help.

n is constant so you shouldn't need to worry about it.
(PV)/(nRT)=1 for both "a" and "b" so we can set them equal since they both equal 1.
=> P_f*V_f = P_i*V_i
Now you can solve for P_f since everything else is given.
At this point you can integrate from each initial to final (remember to set your integrals limits in the correct order). The total work is the sum of the individual work done on/by the system.


text:
# How to change chapter created by \printindex to section?

I wonder if there is a solution to the following problem: I wanted to create an index with the package makeidx and the scrartcl document class. \printindex creates a chapter called "Index". But all I wanted to have is a section (!) called "Index". (I cant find anything in the makeidx doc about this.) How can this be done? Any ideas?

\documentclass[]{scrartcl}

\usepackage{makeidx}

\makeindex

\begin{document}

This is a test\index{test} text.

\printindex % prints out a chapter but i want a section to be printed.

\end{document}

-

In fact, \printindex does create an (unnumbered) \section* with the article and scrartcl classes -- but because the index uses \twocolumn internally, it starts on a new page, which does resemble \chapters behaviour.

Solution: Load my idxlayout package -- it uses multicol internally and therefore does not start a new page. idxlayout is respondent to KOMA-Script's index-related options and commands.

\documentclass{scrartcl}

\usepackage{makeidx}
\makeindex

\usepackage{idxlayout}

\begin{document}

\section{foo}

This is a test\index{test} text.

\printindex

\end{document}

-
tanks! this seems to point me in the right direction. but after compiling your source code with xelatex and processing with makeindex the output is just the same. do i have to do something else? –  user8317 Oct 2 '11 at 23:28
Delete all auxiliary files and then compile with xelatex-makeindex-xelatex- xelatex. –  lockstep Oct 2 '11 at 23:35
its working perfectly now! thx a lot! –  user8317 Oct 3 '11 at 10:22


text:
Public Group

# Doxygen question (#ifdef problem)

This topic is 4751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi! Any doxygen users here? Probably! Has anybody here had the same problem and maybe solved it? I have a header file with a class that I only include if DEBUG is defined. Doxygen ignored everything inside the #ifdef ... #endif part ... no matter if it is defined or not. If it was defined in the same file it would work. The include guard is not a problem. Ignore that stupid remark ... of course the includeguard has a #ifndef ... I tried putting an #ifdef directly after the #define and the problem occurs as well. [/edit] But DEBUG has to be set in a global header file. Is there a way to fix that problem? Maybe by changing something in the Doxyfile? [Edited by - Clueless on May 24, 2005 7:22:02 AM]

##### Share on other sites
I haven't used doxygen before, but does it hate #if too? You could always give DEBUG a numerical value..
// instead of#define DEBUG... later on..#ifdef DEBUG// you could just do#define DEBUG 0.... later on...#if DEBUG

##### Share on other sites
Thanks for the reply ... good idea. Unfortunately that too doesn't work.
;(

Maybe it is just because I messed with the standard settings.
Probably it usually works.
Such a thing as a bug would be weird. I don't think using ifdefs like that is bad design ... ?

##### Share on other sites
In the doxygen configuration file there is a setting named PREDEFINED. Stick it in there.

Also, the standard method of having debug only code is

#ifndef NDEBUG
//...
#endif

The assert macro uses this method for example.

##### Share on other sites
There's an option in the doxygen settings "Enable preprocessing". Try disabling that, perhaps it's relevant.

##### Share on other sites
Thanks ... adding it to PREDEFINED did the trick.
Guess that is the kind of info I should be able to find in the documentation.
I'm not good at reading those I guess (I tried).
Pretty straightforward ... now that I think of it.

Thanks for the using ifndef as standard tip.
Should have thought of trying that after writing about the include guard (d'oh).

• 10
• 17
• 9
• 14
• 41
• ### Forum Statistics

• Total Topics
631067
• Total Posts
2997735
×