NetLogo Investigations in Electromagnetism (NIELS)

Gabriella Anton, Connor Bain
Physics
2 weeks
High School
v2

Unit Overview

Students will explore Coulomb's Law and connections between Kinematics and Electrostatics Motion. Students will learn that oppositely charged particles attract each other and particles with the same charge repel each other. Students will discover that Coulomb’s force between a pair of particles is determined by the distance between the particles and the charge of each particle.

Students will learn about electric field lines and motion of electrons in an electric field. Students can also reflect about the relationship between force and motion • Students will directly confront a very common misconception: electric field lines also represent trajectories of charges. They will develop an understanding of why that is not necessarily the case, and learn to differentiate between field lines and paths of charges.

Students will learn that electric current depends on length, and width of the wire, as well as the applied voltage. Additionally, students will learn to develop measures for measuring electric current.

Standards

Next Generation Science Standards
  • Physical Science
  • NGSS Practice
    • Using Models
    • Arguing from Evidence
    • Analyzing Data
    • Communicating Information
Computational Thinking in STEM
  • Data Practices
    • Analyzing Data
    • Collecting Data
    • Visualizing Data
  • Modeling and Simulation Practices
    • Using Computational Models to Understand a Concept
  • Computational Problem Solving Practices
    • Computer Programming
  • Systems Thinking Practices
    • Understanding the Relationships within a System

Underlying Lessons

  • Lesson 1. Lesson 1 - Electrostatic Motion
  • Lesson 2. Lesson 2 - Lines of Force
  • Lesson 3. Lesson 3 - Measuring Current: Wire Width
  • Lesson 4. Lesson 4 - Measuring Current: Wire Length and Metal Type - v3.
  • Lesson 5. Lesson 5 - Measuring Current: Instantaneous and Average

Lesson 1. Lesson 1 - Electrostatic Motion

Gabriella Anton, Connor Bain
Physics
55-90 mins
High School
v2

Lesson 1 Overview

In this lesson, students will explore Coulomb's Law and connections between Kinematics and Electrostatics Motion. Students will use computational models built in a modeling environment called NetLogo to explore how charged particles interact.

Lesson 1 Activities

  • 1.1. Exploring a Model of Coulomb's Law
  • 1.2. Plotting Coulomb's Force
  • 1.3. Plotting Potential Energy
  • 1.4. Distance, Potential Energy, and Force

1.0. Student Directions and Resources


In this lesson, you will explore Coulomb's Law and connections between Kinematics and Electrostatics Motion. You will use computational models built in a modeling environment called NetLogo to explore how charged particles interact. 

1.1. Exploring a Model of Coulomb's Law


Recall that opposite charges attract and like charges repel. These interactions result in an electric force between the two particles. 

The force between two charges depends on two variables:  how strong the charge is, and the distance between the two charges.

The model is built in a modeling environment called NetLogo. NetLogo models are agent-based, meaning that it is composed of individual components which are coded to interact. In the model below, the agents are coded to behave like charged particles. The element of time is experienced in NetLogo through a unit called ticks. With each tick, all agents of the model take commands and perform them (or do nothing if told so), and then the tick counter progresses forward by one. Then any monitors or graphs expressing data from the model are updated. 

The elements of the model can be changed using sliders that let you control specific elements, but it can also be modified using code. Scroll down to look at the code tab if you are curious what NetLogo code looks like. The command center is used to write specific code to interact with the model. 

Explore the model below to see how the amount of charge and the distance between two charges affects Coulombs' force. 

To interact with the model:

1) Adjust sliders on the left side of the model to desired levels. In this lesson, you will mostly be concerned with the TEST-CHARGE slider.

2) Press SETUP. You will see the black space change to a color. If the TEST-CHARGE slider is at a positive value, you will see a blue positive charge appear in the model. If the TEST-CHARGE slider is at a negative value, you will see a red negative charge appear in the model.

3) Press GO. Click the mouse anywhere in the green space. You will see a blue particle appear. Hold down and drag the mouse to move this blue charge in the model. You can also lift up the mouse which will stop the model from ticking forward (you can then press down again to interact with the model).


Question 1.1.1

How do the two particles behave in the model when the test charge is positive? Why?



Question 1.1.2

How do the two particles behave in the model when the test charge is negative? Why?



Question 1.1.3

What happens when you increase or decrease the test charge quantity? Why do you think the particles behave this way when you change the charge quantity? 



Question 1.1.4

Please wait for teacher instruction before moving on. 

Note: Draw your sketch in the sketchpad below


1.2. Plotting Coulomb's Force


Using the Electrostatics NetLogo model, plot distance vs. Coulomb's Force. 

To create a plot:

1) In the model, use the TEST-CHARGE slider to choose an electrostatic charge value. Then, click SETUP, then GO as you did before. 

2) Click anywhere in the green box to place the blue charge. Click on the charge and drag it around to adjust the distance between the blue and the other (smaller, red or blue) charge.

3) As you run the model, your data is collected in a data table on the right. Drag the column titled Coulomb's Force to the y-axis of the graph below the data table. Drag the column titled Distance to the x-axis of the graph. 

4) Repeat with different electrostatic charge values. 


Question 1.2.1

According to your graph, what do you notice about the relationship between distance, Coulomb's force, and the electrostatic charge value?



Question 1.2.2

Upload a photo of the graph that supports these findings. To do this, click on the graph in the workspace above. When the teal option bar pops up, click on the camera at the bottom and save the image as a local file. Then, click use the file finder below to attach the image to this page. You can upload more than one graph that support your findings.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


1.3. Plotting Potential Energy


Using the Electrostatics model, plot distance vs. potential energy. 

To create a plot:

1) In the model, use the CHARGE slider to choose an electrostatic charge value. Then, click SETUP, then GO.

2) Click anywhere in the green box to place the grey charge. Click on the charge and drag it around to adjust the distance between the grey and blue charge. 

3) Your data has been collected in a data table on the right. Drag the column titled Potential Energy to the y-axis of the graph below the data table. Drag the column titled Distance to the x-axis of the graph. 

4) Repeat with different electrostatic charge values. 

 


Question 1.3.1

According to your graph, what do you notice about the relationship between distance, potential energy, and the electrostatic charge value?



Question 1.3.2

Upload a photo of the graph that supports these findings. To do this, click on the graph in the workspace above. When the teal option bar pops up, click on the camera at the bottom and save the image as a local file. Then, click use the file finder below to attach the image to this page. You can upload more than one graph that support your findings.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


1.4. Distance, Potential Energy, and Force


Now that you have used a NetLogo model to explore how the distance between particles effects potential energy and Coulomb's force, answer the questions below. You can use the model below to aid in your explanations. 

 


Question 1.4.1

Explain the relationship between the distance between two charged particles, the Coulomb's force between them, and their electric potential energies. 



Question 1.4.2

Please wait for teacher instruction before moving on 

Note: Draw your sketch in the sketchpad below


Lesson 2. Lesson 2 - Lines of Force

Gabriella Anton, Connor Bain
Physics
55-90 minutes
High School
v2

Lesson 2 Overview

In this lesson, students will continue their investigation of the motion of electrons due to electric forces.They will explore the notion of electric field lines, which are visualizations of electric field. Students should investigate "what do the field lines represent?" They should be introduced to how to generate a continuous field by "spatially arranging" poles. 

Lesson 2 Activities

  • 2.1. Electric Fields Introduction
  • 2.2. Electric Force Field Lines
  • 2.3. Electric Force Field Lines
  • 2.4. Dipolar Electric Field
  • 2.5. Dipolar Electric Field

2.0. Student Directions and Resources


In this lesson, you will continue your investigation of the motion of electrons due to electric forces. You will explore the notion of electric field lines, which are visualizations of electric field.

2.1. Electric Fields Introduction


Every charged object emits an electric field that extends outward into the space that surrounds it. We call this charged object the source charge. To explore the source charge's electric force, we can bring a smaller test charge close to it and see how the test charge is effected. 

The Electrostatics Model that you've used doesn't model or show you the electric force field, but instead shows how two charges are effected by each other's electric force fields. For example, in the electrostatics model if you move a positive source charge closer to a positive test-charge, the test-charge will be repelled and move away from the source charge. You can think of the positive source charge as having a force field around it that determines how other charged particles that come close to it will behave. 

Make some guesses now: How can you visually represent the force field around the source charge in the Electrostatics Model? Run the model again and observe how the particles move in order to come up with one or more possible ways to visually represent the force field.

 


Question 2.1.1

How can you visually represent the electric force field lines around the blue, positive source charge in the electrostatics model? Provide at least two different ideas.



Question 2.1.2

Based on your idea above, sketch an electric force field around the positive source charge below. Be careful with the eraser as it will erase all components of your drawing. 

Note: Draw your sketch in the sketchpad below


Question 2.1.3

Please wait for teacher instruction before moving on

Note: Draw your sketch in the sketchpad below


2.2. Electric Force Field Lines


The model below shows one possible representation of electric lines of force. Electric fields are typically represented as lines that point in the direction that a positive test charge would accelerate if placed upon the line. 

So, if you use test-protons (that have a positive charge) the lines are directed away from positively charged source charges and toward negatively charged source charges, and if you use test-electrons (that have a negative charge) the lines are directed toward positively charged source charges and away from negatively charged source charges. 

To create electric field lines and use the model:

1) Click SETUP then GO

2) Click ADD POSITIVE + SOURCE CHARGE. Drag the positive source charge anywhere in the black box. 

3) In the CREATE drop-down menu choose test-protons.

4) Click anywhere in the black box to test protons in the space you've created. Make sure to test many protons. Observe how the test proton charges behave in the space and how the electric field lines are drawn. 

5) Repeat with different numbers and positions of positive and negative source charges. You can do this by hitting the ADD POSITIVE + SOURCE CHARGE button and the ADD NEGATIVE - SOURCE CHARGE multiple times. Also, be sure to also test your space with test electrons, by selecting test-electrons in the CREATE drop-down menu.


Question 2.2.1

Describe the trajectories of the test protons when there is one positive source charge in the space. Make sure to test protons around the entirety of the the source charge.



Question 2.2.2

Now, describe the trajectories of the test electrons when there is one positive source charge. Make sure to test electrons around the entirety of the the source charge.



Question 2.2.3

What are some differences and similarities between the trajectories of the test electrons and test protons? Explain WHY you think these differences and similarities exist.  



Question 2.2.4

What information does this electric field model provide that the previous electrostatics model did not provide? What information is each model providing and how is this information related?



Question 2.2.5

How does this representation of an electric field compare to your hypothesized representation that you sketched previously?



2.3. Electric Force Field Lines



Question 2.3.1

Now, create your own space with at least two source charges (either positive or negative) and experiment with the space using test protons. Sketch your space below and label all the positive or negative source charges, the test protons, and the electric force field lines.

Note: Draw your sketch in the sketchpad below


Question 2.3.2

Describe the electric force field in your space and why you think the particles behave the way they do. 



Question 2.3.3

What happens to the speed of the test-charges when you adjust the strength of the source charges? Why do you think this happens? 



2.4. Dipolar Electric Field


The image below shows an electric field with an orange negative source charge on the left and a blue positive source charge on the right, the two source charges are equal in magnitude. This is called a dipolar electric field. Now imagine that you are placing test-protons at positions along the three lines shown in the image: A (left), B (middle) & C (right).


Question 2.4.1

Do you think that the test-protons along A, B and C will all follow the same path? Or, do you think that the trajectories of charges starting at A, B & C will be different? Explain your reasoning.



Question 2.4.2

Below, sketch the paths you think charges placed on these lines would follow. 

Note: Draw your sketch in the sketchpad below


2.5. Dipolar Electric Field


Now create a scenario like the one shown in the image below, using the Electric Field model. First, create a dipolar field with a positive source charge and a negative source charge, and then run your model by placing test-protons along the three lines shown in the image: A (left), B (middle) & C (right). Place test-charges at various positions along the three lines. 

To create a dipolar field by using the model:

1) Click SETUP then GO

2) Click ADD POSITIVE + SOURCE CHARGE. Drag the positive source to the right side of the black box, as it is in the picture. 

2) Click ADD NEGATIVE - SOURCE CHARGE. Drag the negative source to the left side of the black box, as it is in the picture. 

3) In the CREATE drop-down menu choose test-protons.

4) Click in the black box on numerous positions along the three lines shown in the picture to test protons in the space you've created. Make sure to test many protons along these lines. Observe how the test proton charges behave in the space (based on where they started) and how the electric field lines are drawn. 


Question 2.5.1

What do you observe about the trajectories of the test charges?



Question 2.5.2

Do the test charges starting from A, B, and C follow the same paths? Why or why not?



Question 2.5.3

How does this representation of a dipolar field compare to your hypothesized representation that you sketched previously?



Question 2.5.4

Using the information provided from the model, sketch the electric fields. Make sure to label the source charges and indicate which direction the test charges are moving by using arrows.

Note: Draw your sketch in the sketchpad below


Question 2.5.5

Please wait for teacher instruction before moving on 

Note: Draw your sketch in the sketchpad below


Lesson 3. Lesson 3 - Measuring Current: Wire Width

Gabriella Anton, Connor Bain
Physics
90 minutes
High School
v2

Lesson 3 Overview

Throughout lessons 3, 4, and 5, students will continue to deepen their understanding of how to measure electric current, and how constancy of flow is maintained. Students will develop two different ways to measure current: average current and instantaneous current. Students will be introduced to some computer-based modeling to achieve this. 

In this lesson particularly, students will identify how electric current depends on the width of the wire, as well as the applied voltage. They will also start to explore tools for measuring electric current (sampling different areas of the wire, and comparing the values; averaging) and aggregate data they collect with the class. 

Lesson 3 Activities

  • 3.1. Current in a Wire Model Introduction
  • 3.2. Prediction of Current Based on Wire Width
  • 3.3. Testing Prediction of Wire Width
  • 3.4. Comparing Data
  • 3.5. Averaging Data

3.0. Student Directions and Resources


In this lesson you will explore how electric current flows in a wire and explore how current depends on applied voltage and wire width. Additionally, you will start to explore ways to measure current and compare data with your classmates. 

3.1. Current in a Wire Model Introduction


In this activity, you will use a model to identify how electric current depends on applied voltage.

This model shows a microscopic look at how electric current flows through a wire connected to a battery. It shows how electric current depends on the number of free electrons and how fast these red electrons are traveling towards the positive end of a battery. This speed depends on (1) the applied voltage difference and (2) the obstacles that the electrons encounter in their way, which are represented in this model by blue atoms.

In this model, time is represented in terms of ticks, which can be adjusted using the slider at the top to slow down or speed up the model. 

To use the model:

1) Click SETUP then GO. You will start to see electrons flow through the wire, see data readings on the monitors, and a plot form on the graph. 

2) You can change the voltage at any time, even while the model is running. However, to have accurate comparable readings it might be best to hit SET-UP and GO to reset the model after you've changed the parameters to where you'd like them. 


Question 3.1.1

What do the blue circles represent in the model?



Question 3.1.2

What do the red circles represent in the model?



Question 3.1.3

Set the Voltage slider to 0 and click SETUP and then GO. What happens to the current now and the flow of electrons when you decrease the voltage to zero? 



Question 3.1.4

Increase the Voltage. Click SETUP and then GO. What happens to the current now and flow of electrons as voltage increases? Why do you think this happens?



3.2. Prediction of Current Based on Wire Width


Now using your explorations with the model, and the screenshot below, make a prediction about how wire width will impact current. 

Consider how electrons might flow differently through a wire that is half as wide. 

 

 

 


Question 3.2.1

Do you think that with a wire with a smaller width will have a higher or lower current?



Question 3.2.2

Describe your prediction about how the wire width will impact current and explain your reasoning.



3.3. Testing Prediction of Wire Width


Use the model to test your hypothesis about how wire width will impact current.

To use the model:

1) Click SETUP then GO. You will start to see electrons flow through the wire, see data readings on the monitors, and a plot form on the graph. 

2) If you'd like to change the wire's width, select 2 or 1 from the drop-down menu WIRE-WIDTH. 


Question 3.3.1

Try running the model with different wire widths.

First, run FOUR trials of the model with a voltage difference of 1, wire width of 1, and measure the current after 100 ticks (it's okay if you can't get it exactly at 100 ticks!). Once the ticks counter has gotten to your desired time for a trial, hit GO again to stop the model. Then run FOUR trials of the model with a voltage difference of 1, wire width of 2, and measure the current after 100 ticks. 

Input the data collected in the table below. Use the green plus in the upper right corner to add more rows to the table so that you can collect data for all 8 of your trials.



Question 3.3.2

When the voltage is set at 1 and the samples are about 100 ticks long, how does the wire width impact current? Support your explanation with evidence from the data you collected from the model.



Question 3.3.3

Please wait for teacher instruction before moving on 

Note: Draw your sketch in the sketchpad below


Question 3.3.4

What is the average current you found by aggregating data with your class?



3.4. Comparing Data


Now that you've compared your data list with your classmates' data lists or trials with the same conditions, consider the data you collected on your own and the data collected by the rest of the class. 


Question 3.4.1

What is the difference between the data you individually generated compared to those generated by the whole class? Which data do you think are more accurate for measuring the current and why?



3.5. Averaging Data


Now you will look at what happens to the average current after a long period of time. You will see that an average current counter has been added to the model in the lower right corner. 

1) Set the VOLTAGE slider to 1 and the WIRE-WIDTH drop down menu to 1. 

2) Click SETUP then GO. 

3) When your model has gone for at least 600 ticks, hit GO again to stop your model. Take note of the AVERAGE CURRENT


Question 3.5.1

Which is closer to the model's average current that you found on this page—the current found in an individual trial that you ran on your own on Page 4 or the average current you found as a class after you finished Page 4? Why do you think this is the case?



Question 3.5.2

Please wait for teacher instruction 

Note: Draw your sketch in the sketchpad below


Lesson 4. Lesson 4 - Measuring Current: Wire Length and Metal Type - v3.

Gabriella Anton, Connor Bain
Physics
90 minutes
High School
v2

Lesson 4 Overview

In this lesson students will explore how electric current flows in a wire and explore how current depends on applied voltage, wire length, and wire material. Additionally, students will continue to explore ways to measure current and find ways to aggregate their own data using computational tools. They will be introduced to an additional modeling tool called Codap which allows data from NetLogo to be displayed in a table and be manipulate and analyzed. 

Lesson 4 Activities

  • 4.1. Prediction on Wire Length
  • 4.2. Testing Prediction of Wire Length
  • 4.3. Prediction on Metal Type
  • 4.4. Testing Prediction on Metal Type

4.0. Student Directions and Resources


In this lesson you will explore how electric current flows in a wire and explore how current depends on applied voltage, wire length, and wire material. Additionally, you will continue to explore ways to measure current and find ways to aggregate your own data. 

4.1. Prediction on Wire Length


Yesterday, you used this model to explore how wire width affected current and how current can be measured. Now, based on your prior explorations with the model, make a prediction about how wire length will impact current. Use the screenshot below as a reference and answer the question below. 


Question 4.1.1

Using the screenshot above as reference, describe your prediction about how wire length will impact current and explain your reasoning. 



4.2. Testing Prediction of Wire Length


Use the model below to test your prediction about how wire length affects current.

When you were examining wire width, you compared data with other classmates to come up with a more accurate measurement representing current. Now you can use the modeling tool below to run multiple trials and aggregate your own data.

With your classmates, you found averages by conducting multiple trials and averaging the data collected across trials. Now, you'll be introduced to a tool that allows you to calculate a running average that will average all the measurements for current within one trial. To find that the average current within an individual trial, you can average all the individual current now measurements that you take.

In the workspace below is the model, now with an empty table and empty graph. As you run your model, the table will automatically update data from the model at each tick. Each time you press setup, you will begin a new “run” or trial of data collection. You can graph these data by pulling the variable headers from the table into an axis of the graph. You can also calculate specific information about the data by updating the table with formulas. 

There are instructions on using the data table and graphing tools are embedded in the model's instruction window. You can move this window by dragging it's blue headers and also resize it by dragging any side of it. If you close the instructions, click the GUIDE button that looks like a book in the upper right-hand corner and select "Show Guide". 


Question 4.2.1

What is the relationship between wire length and current?



Question 4.2.2

Upload a photo of the graph that supports these findings. To do this, click on the graph in the workspace above. When the teal option bar pops up, click on the camera at the bottom and save the image as a local file. Then, click use the file finder below to attach the image to this page. You can upload more than one graph that support your findings.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


Question 4.2.3

Explain the graph(s) uploaded above support your findings.



Question 4.2.4

How did you generate data to determine the relationship? Justify the process you used. Hint: Consider how many trials you conducted, how long you let each trial run (ticks), and what parameters you changed between trials.



Question 4.2.5

What size of wire widths and lengths provide the highest current? What sizes provide the lowest current?



Question 4.2.6

Compare the data collection process from discovering the impact of wire width and of wire length. What was the difference between the first and second explorations? How did computational tools help you to determine the relationship between these parameters (wire width's and wire length's affect on current)?



Question 4.2.7

Please wait for teacher instruction before moving on 

Note: Draw your sketch in the sketchpad below


4.3. Prediction on Metal Type


Using prior explorations with the model, make a prediction about how wire type will impact current. The model contains three types of wire, each with a different resistance. Resistance is an electrical quantity that measures how the material reduces electric current flow through it. The materials in the model are lead, tin, and aluminum. Use the chart of resistance and the screenshots below to identify what metal matches each model state.

Tin  11.5 x10-8 Ohm m
Aluminum 2.65 x10-8 Ohm m
Lead 22 x 10-8 Ohm m

The Ohm meter is a measure of resistivity, with higher values reflecting greater resistance. 

Metal 1 

Metal 2 

Metal 3


Question 4.3.1

Using the table and screenshots above as reference, match each metal with the model states and explain your reasoning for the match. Make sure to discuss both current and resistance in your explanations.



4.4. Testing Prediction on Metal Type


Use the model below to test your prediction about how wire metal affects current. When you were examining wire width, you compared data with other classmates to come up with a more accurate measurement representing current measurements taken from multiple trials. Now, just like you did to learn about wire length, you can use the modeling tool below to run multiple trials and aggregate your own data in a similar way.

There are instructions on using the data table and graphing tools are embedded in the model's instruction window. You can move this window by dragging it's blue headers and also resize it by dragging any side of it. If you close the instructions, click the GUIDE button that looks like a book in the upper right-hand corner and select "Show Guide". 


Question 4.4.1

What was the data generating process you used to determine the relationship? Justify the process used



Question 4.4.2

How did you use the model to find out the relationship?



Question 4.4.3

What is the relationship between metal type and current? Upload a photo of the graph that supports these findings.



Question 4.4.4

Upload a photo of the graph that supports your findings of the relationship between metal type and current. 

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


Question 4.4.5

Please wait for teacher instruction before moving on 

Note: Draw your sketch in the sketchpad below


Lesson 5. Lesson 5 - Measuring Current: Instantaneous and Average

Gabriella Anton, Connor Bain
Physics
90 minutes
High School
v2

Lesson 5 Overview

Students will further develop their understanding of the two different ways to measure current: average current and instantaneous current. Students will be introduced to some computer-based modeling to achieve this, and will interact directly with the NetLogo code and be prompted to write their own code as well. 

Lesson 5 Activities

  • 5.1. Prediction of Sampling Rate
  • 5.2. Testing Prediction of Sampling Rate
  • 5.3. Plotting Instantaneous and Average Currents

5.0. Student Directions and Resources


Here, you will further develop their understanding of different ways to measure current. Further, you'll explore how this data is managed and visualized in the NetLogo model you've been using. 

5.1. Prediction of Sampling Rate


When you drive a car, you typically don't drive the same speed the whole time. The car's speedometer changes as you drive and tells you the instantaneous speed at that moment in time. 

The current through a wire functions in a similar way: current changes at different points in time because the flow of electrons through the wire is changing. This means that the number of charges passing through one part of the wire is changing. Imagine pausing time and then measuring the current in the wire at one point--that is the instantaneous current.

This NetLogo model does not measure the exact instantaneous current. So, to estimate instantaneous current, the model takes a very small amount of time which simulates one instant. This small amount of time is called the sampling rate and can be adjusted in the model using the "sampling-rate" slider. Remember that NetLogo time units are called ticks


Question 5.1.1

Make a prediction about how bigger and smaller sampling rates will impact instantaneous current. Explain your reasoning.



5.2. Testing Prediction of Sampling Rate


Use the model below to change the sampling-rate slider and then answer the questions below. Try using both very small and very large values of sampling-rate and observe the graph.

Try putting sampling-rate on the x-axis of your graph, and then currentNow on the Y axis. 

1) Use the SAMPLING-RATE slider to start the sampling rate at a very low value of 1. 

2) Hit SET UP and GO to run the model. 

3) Hit GO to stop the model between trials.

4) Move the SAMPLING-RATE slider to a new value. 

5) Hit SET UP and GO to run the next trial. 

6) Repeat these steps until you have a graph that allows you to make a conclusion. You may also be able to make conclusions by looking at the data in the table. 


Question 5.2.1

What is the relationship between sampling rate and instantaneous current?



Question 5.2.2

Upload a photo of the graph that supports these findings. To do this, click on the graph in the workspace above. When the teal option bar pops up, click on the camera at the bottom and save the image as a local file. Then, click use the file finder below to attach the image to this page. You can upload more than one graph that support your findings.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


Question 5.2.3

Explain how the graph(s) uploaded above support your findings.



Question 5.2.4

Explain how you collected data using the model. 



Question 5.2.5

Please wait for teacher instruction before moving on

Note: Draw your sketch in the sketchpad below


5.3. Plotting Instantaneous and Average Currents


Now you will learn how to graph average current in the model, just as instantaneous current is. The code below shows how instantaneous current was plotted in the model.

set-current-plot-pen provides a label for the graph and tells the model to start plotting something

plotxy ticks tells the model what to plot every tick (or time point)

current-now-list is a list that contains values representing how many charges are passing through this section of the wire at every tick for the past n ticks where n is the sampling rate in the slider

sum  adds up all the values in a list 

length finds the length of a list. For current-now-list, this will always be the sampling rate

Now, open the code tab of the model. To do this:

1) Scroll down in the model on the left and you will see three tabs "Command Center", "NetLogo Code", and "Model Info".

2) Click "NetLogo Code" to open the code tab. 

You can find the plotting code from above if you scroll down in the code tab to lines 378 and 379. Look in the code tab and find current-now-list. This shows how the current now (stored in current-now-list) is plotted in the graph within the model. 

If you want to see how current-now-list look at lines 204 and 205 which contain code that states if the length of the list is greater than the sampling-rate (that is set by you with the slider), the first item of the list is removed. So, if you set your sampling rate to 50, then my-charge-list shows how many charges pass through this sections of the wire for the most recent 50 ticks. You can see in lines 201 and 202 how the code adds the current at each tick to lists.  

With the model below, there is another list introduced called average-current-list which also shows how many charges are passing through this section of the wire at every tick like current-now-list, but average-current-list does not remove items when the length of the list surpasses the sampling rate. This means all values remain in the list and none are ever removed. 

Explore the model and look at the code tab to examine this.


Question 5.3.1

At the bottom of the code tab, around line 371, you will see that the plotting code has been changed to reflect the addition of this new list, but the highlighted line, that should tell the plot what data to display, is still missing the code to create the plot. 

What code would you need to add on this highlighted line to make the plot appear correctly?

Hint: The code you wrote in Codap to perform this calculation similarly in a data table has a completely different syntax than NetLogo code. The NetLogo code should perform a similar operation, but you should use the other plotting code (line 369) as a reference for what your code should look like. 

Play around with the model to test your code.