10. UNDOUBTEDLY experiments provide an real value to any
learning experience as a way ofconnecting the real-world with
the abstract. This is particularly true for the topic of "Electricity
and Magnetism", which deals with quantities that are very real,
electric and magnetic fields, but our
senses are poor at measuring (although for electromagnetic
waves in the visible range, our eyes
help).
Experiments, however, can be complex to setup and costly. An
intermediate experience, therefore,
are interactive simulations. These are computer programs that
have programmed algorithms,
which simulate certain settings. Many simulations are available
nowadays, but I would like to
point out a particular project, which was sponsored by the
National Science Foundation, and
developed by the University of Colorado, it is called the PhET
simulations, available at https:
//phet.colorado.edu/. A collection of interactive simulations for
the Sciences and Mathematics
made available to the public through federal science grants. We
provide you with a set of worksheets
that guide you using these simulations in part I starting on page
33.
11. In addition to the simulations, the online PHYS 152 lab includes
hands-on experiments detailed
in part II starting on page 75. The procedure for these labs is
detailed in Chapter 2 starting on
page 13. It is based on a home experimental kit and so all
experiments can be performed with the
help of this kit, a smartphone, computer, and everyday tools.
Indeed, the aim of this series of small
experiments related to discovering electricity and magnetism is
to make the procedures applicable,
so that you can carry out many more of the same type of
experiments on your own. Therefore, this
course provides only the beginning boundaries of much more
exploration. A home kit is therefore
ideal as it gives you some tools needed to continue this
scientific process.
Lastly, science and engineering are highly collaborative
disciplines with team tasks. Sharing,
communicating, and evaluating each other is an everyday task
of professionals in this field. A
paradigm for this is research. It is based on proposals of
experiments that are evaluated and vetted
based on their merits and benefits. The best experiments are
12. conducted, data is acquired and a
lab report is submitted for publication. Peers review these
reports before some are accepted for
publication. You have the opportunity to practice and learn this
process in small teams using
an asynchronous discussion forum. The teams are small (around
5 participants) formed by the
https://phet.colorado.edu/
https://phet.colorado.edu/
8 Chapter 1. Introduction
instructor. The team will work on team tasks (see part III on
page 93) using team roles that are
mapped to the specific steps of problem solving.[4, 3] These
roles are explained on page 10, with the
underlying understanding that an expert wears all hats at the
same time, but for a learner focusing
on one role will be good practice. Additionally, we will use
these teams to evaluate lab reports. The
team will give feed-back based on the lab report grading rubric
(page 15) to selected lab reports.
This mechanism provides multiple benefits, for one you get to
13. see how your peers write reports,
normalizing your experience, applying the grading rubric
focuses your attention to critical portions
of the report, and finally you can received feed-back from teams
to improve your reports. Lastly,
this process mirrors the professional approach and eases a
pathway into a career.
1.1 Activity Worksheets
The following worksheets will provide you some guidance as
how to use those simulations and
others by asking questions. For the purpose of effective
learning, it is important to first reflect
on your current knowledge. This is generally done by making
predictions, which is to think
about different scenarios related to the topic and based on your
knowledge foresee outcomes.
You may be tempted to guess the answer without much
reflection, or look up the solution.[5]
Resist this temptation, as this step is crucial in memory
building. It is important to write those
predictions down. In the next step, you will use the simulations
and recreate the questions, then
make observations of the results. In the third step, you will
compare the predictions with the
14. observations and note any discrepancies. In the last step, you
reflect on your findings and try to
apply the learned experiences to other settings, which are
similar. If done properly, this procedure
is extremely efficient. Essentially, you know that learning
would occur, if your predictions would
be different in some way from your observations. Note that
sometimes, seemingly the predictions
agree with your observations, there are fine discrepancies, or
nuances, that are different, scientists
and engineers are good at detecting those details and ponder
about them.
During the course, different activities are assigned with specific
deadlines. Submit your worksheets
as single PDF files that you can easily scan with one of many
available PDF scanners. From your
phone, you can use CamScanners, GeniusScan, etc. there are
other ways as well. You can either
print the worksheets and directly work on them, using the space,
or you can use separate sheets for
your answers. Always make sure (to get full points) that you
label all the questions in accordance to
the numbering scheme from this worksheet. For every activity,
you may also be asked to capture a
screenshot of the simulation and include it. For full points,
15. capture and submit a unique screenshot
that shows that it is your work. It is also important to label the
axes of all graphs and include units
as well. Some examples are given in the worksheets.
1.2 Hands-on Experiments
There are several experimental hands-on labs that can be carried
out at home. The first step will be to
clarify the experimental procedures and writing down the
predictions. In your notebook, you write
down the procedure of how you will carry out the experiment,
the hypothesis, and the predictions.
In the next step, you build the experiment and take data.
Commonly, data needs to be taken several
times in order to verify the experimental procedure and the
reproducibility. The repetition also
gives you a way to judge the reliability of the data and the error
bars. During the experiment, all
results are carefully noted in the lab notebook. At this point,
you are ready to write the report
according to the guidelines listed on page 13; scientists and
engineers use this method and you can
find many sample reports at https://arxiv.org/. We strive to
learn from the experts. Note that
the report provides both details about the experimental method
16. used, the results, and analysis. It
also includes photos of the experimental setup with the date in
the photograph, see Fig. 2.2.1. A
lab report has graphs, which you can generate with OpenCalc
(https://www.openoffice.org/
https://arxiv.org/
https://www.openoffice.org/product/calc.html
https://www.openoffice.org/product/calc.html
1.2 Hands-on Experiments 9
product/calc.html), Google Sheets
(https://www.google.com/sheets/about/), RStudio
(https://www.rstudio.com/), R-Fiddle (http://www.r-
fiddle.org/#/), gnuplot (http://
www.gnuplot.info/), or Plot2 for Mac
(http://apps.micw.eu/apps/plot2/). All of these
programs are free, and several open-source, most can be
installed on different platforms. The lab
report is, then, an independent, complete summary of the
experiment you conducted.
Before reports are published, scientists and engineers, peer-
17. review the reports and give feed-back.
In the course, this process is called "lab evaluations", and you
are responsible to review lab reports
of your peers based on a rubric (see page 15). Reading your
peer’s lab reports and evaluating them
is a powerful learning tool that you should not underestimate.
Not all reports will get published,
based on the reviews and his or her judgement of the report, the
editor (here, the instructor) will
make the final evaluation of the report.
In order to make the experimental kit, or tool box, cost
effective, we have adopted the micro-
controller platform called Arduino. The Arduino controller is
open-source and inexpensive (order
of USD 10 – 20), widely available. There are many types of
Arduino, for the course, the basic
UNO type will be sufficient. The Arduino board comes with
sensor inputs and also with outputs.
We will use these sensors to connect resistor circuits, and test
RC circuits. The board connects via
USB port to a computer; details are provided on the website
https://www.arduino.cc/ and the
software is installed from the "Download" button.
18. 1.2.1 Experimental Kit
You will need to purchase an experimental Arduino kit in order
to perform the experiments. You
have several options to purchase or build the kit. Reviewing the
labs, you can see all the required
tools and materials listed in part II starting on page II. Here is a
summary:
• Arduino micro-controller with USB
(http://tinyurl.com/phys152Arduino)
• breadboard and wires
• several resistors (1 kΩ, 10 kΩ, 1 MΩ)
• one or more capacitors (0.5 µF or more, product of largest
resistor multiplied with capacitance
should equal about 1 s)
• basic compass (possibly compass of phone)
• Al foil, drinking straws, other home materials
You can build your own kit based on the previous list, or you
can purchase a package, which
contains all of these items and a few more.
• Sunfounder Project Super Starter Kit for Arduino UNO R3 at
19. tinyurl.com/phys152kit2
plus an Arduino Board at http://tinyurl.com/phys152Arduino
• Arduino UNO R3 Ultimate Starter Kit at
tinyurl.com/phys152kit1
• KT003 Arduino UNO Start Kit with Bread Plate at
http://tinyurl.com/phys152kit4
(does not include capacitor, see page 87)
Note that the Sunfounder Kit (tinyurl.com/phys152kit2) is
probably the best and it includes
100 nF capacitors and one 5 MΩ resistor, which would give you
a time constant of 0.5 s, a bit less
than 1 s. However, if you put all 4 capacitors in parallel, you
can quadruple the time constant by
increasing the capacitance to 400 nF, which is quite sufficient.
You can also purchase capacitors and resistors separately from
several stores and online from
Mouser at http://www.mouser.com/, searching for multilayer
"capacitors 10 uF", you will find
that the cost is less than one US dollar.
https://www.openoffice.org/product/calc.html
21. help you train each step of the
problem solving (see section 3 on page 21).
Note that an expert problem solver will rotate independently
through all roles (team leader, planner,
researcher, executive, and skeptic). In order to become or
improve as an expert problem solver, it is
important to practice / train each specific step independently.
The grading and point distribution of
the midterm and final exam is based on the problem solving
steps or the roles outlined here. Once
you master each step, you can put them together and gradually
become an expert yourself.
If you are interested in more details and the physics education
research, you can read more in this
booklet:
http://groups.physics.umn.edu/physed/Research/CGPS/GreenBo
ok.html
Use the team work assignments to your advantage, namely to
make learning more productive.[1]
Somewhat surprisingly, the benefits, although different in
aspects, are to all learners regardless of
their prior expertise.
1.3.1 Team Roles
Here is a summary of the team roles. You will be assigned
22. different roles in different tasks. As a
member of your group you work holistically, but focus on your
specific role.
• Team Leader: motivates team, sends messages to the team,
makes sure the team understands
the task, helps make major decisions, and keeps track of time,
and posts the solution. The
team leader of the team may also help assign sub tasks to the
team and makes sure everyone
stays motivated. The team leader is responsible to post a
summary of the finding in the
showcase.
• Planner: restates the problem in his/her own words, draws a
diagram including a coordinate
system, draws a sketch and identifies parameters useful in the
problem. The planner typically
identifies the important variables. Each sketch and diagram
generally includes a coordinate
system with labeled axes.
• Researcher: identifies an underlying physical principle /
concept useful to solve the problem,
such Coulomb’s Law, Mobile Charges in Conductor, . . . The
23. researcher typically categorizes
the problem (which section / chapter) and provides any
definitions, or fundamental relations.
• Executive: Applies the concept / principle to the specific
problem outlined by the planner
and finds a concrete solution. The executive would apply the
researchers definitions and
fundamental relations to the specific problem and find a specific
result.
• Skeptic: Makes sure the planner, researcher, and executive are
on the right track, by asking
questions, such as is this right? should we consider something
else? did we assume anything
here? then at the end, the skeptic says: are the units correct? did
we answer all the questions?
does the solution make sense? The skeptic provides critical
feed-back to all members of the
team.
1.3.2 Problem Solving
Quantitative problem solving is a marketable skill. Any physics
course is particularly geared
towards training those skills. You are provided with the
24. immutable fundamental principles. The
premises are that a small set of fundamental principles
(conservation of energy or loop rule,
conservation of momentum, conservation of charge or node rule,
Maxwell’s equations, etc.) fully
explain all concepts across multiple disciplines. For example, a
school of fish can be conceptualized
as a result of Hooke’s law (|~F|=−k∆x), where fish experience
two forces, one is that they like to
stay around other fish, at the same time avoiding other fish. The
different shapes of schools of fish
are related to different spring constants k, which represent the
material. A solid understanding of
http://groups.physics.umn.edu/physed/Research/CGPS/GreenBo
ok.html
1.3 Team Work 11
springs therefore helps understand aspects of fish in biology.
Using the same example, the concept
is extended to Electricity and Magnetism, where a capacitor can
be understood in a similar way as
a spring. The maximum displacement ∆x or amplitude A is
25. compared with the charge Q and the
inverse of the spring constant is compared with the capacitance
C. In this sense, then capacitors
reappear as an old concept related to springs and an expert
quickly understands what happens to a
configuration of capacitors in series, given the framework from
springs. Therefore, training for the
recognition of analogies is crucial in conveying the importance
of physics in everyday life.
Hence, problem solving in physics is based on a method than
can be trained and learned. The
first step in problem solving is "understanding the problem"; the
problem solver resolves this step
by paraphrasing the problem and drawing a sketch that includes
all important variables in his/her
own language. The paraphrasing should reuse the least possible
wording images from the given
problem. About 20 – 35% of the points are awarded for this
practice. In the next step, the problem
is "classified"; i.e. you identify the relevant broad principles
and definitions of quantities associated
with the problem. This step is given 20 – 25% of the score. At
this point, you should be able to
execute the problem by modifying and adapting the principles
and definitions to the specifics of
26. the problem and solving for unknown quantities. This step is
scored 15 – 30%. In the last steps,
verification that the units are carried in all steps, vectors are
properly marked, answers are clearly,
either as magnitudes or as vectors. This step receives about 5 –
10% of the score. At last, the
answer is spelled out in a sentence that clearly answers all
questions that were asked. You also
check whether the answer makes sense, relates to anything that
you know (being skeptical). This
part is attributed about 10 – 20% of the full problem score.
More details and examples are provided in section 3 on page 21.
1.3.3 Discussion Forum
You will receive an invitation to participate in the discussion
forum. Once, you accept it, you create
a username, which will be the name listed for your postings (so
do not use your student ID), but
rather your first name or something simple. The discussion
forum has two main sections, one
for team tasks and another section for showcases. As a first
step, familiarize yourself with the
discussion forum, find your team members, and your
assignments. The team leader will create a
task in the forum, and members of the team will participate in
27. the discussion to solve the particular
task. Regular postings will be useful and are called "team
posts". Aside from "team posts", you are
also encouraged to make "peer posts" in threads run by other
teams. You can also post images from
your phone, dropbox, social media, and share your diagrams,
sketches, and ideas you have on paper.
Make sure to only include your own images, as other images
may infringe copyright laws; the same
is true for text, any amounts of text that exceed one sentence
should be linked, rather than copied or
paraphrased. Posting inappropriate and/or copyrighted content
may result in getting permanently
banned from the site with no possibility to make up further
points for team tasks.
The feed-back includes sentences, such as "did you think of . . .
", "I found section . . . in the book
useful in respect to this problem as it explains", "a good
application of this problem would be
. . . ", "this problem makes me think of . . . ", and "In the book,
I found . . . ", etc. For some students,
solving problems is easy, for other asking questions is easy.
Both are equally important in this task.
Asking questions is particularly useful as it provides peers the
opportunity to respond. Remember
28. that team work is difficult, but also rewarding. Even though,
you may think that you understand
something, once you put the physics in writing, conceptions can
be clarified.
1.3.4 Bloom’s taxonomy
The educational benefits to team work stress that several
learning levels of Bloom’s taxonomy can
be integrated.[1] According to B. Bloom learning is based on
the taxonomy that includes 6 aspects:
• remember: memorize fundamental relations, such as ~F = 14π
ε0
Q1Q2
r2 r̂
12 Chapter 1. Introduction
• understand: what do the variables mean in the fundamental
relations? What is r and Q1, can
you make a drawing that explains it?
• apply: can you solve a problem with Coulomb’s law?
• analyze: how is Coulomb’s law different and the same to the
29. gravitational law?
• evaluate: what kind of charge distributions can be solved with
Coulomb’s law?
• create: can you synthesize a problem that involves Coulomb’s
law?
You notice that the difficulty increase as you step through the
taxonomy. A good learning style
includes several or all of these aspects.
2. Lab Report Guidelines
THE following is an outline of the requirements and
recommendations for a well-written labreport in the Electricity
and Magnetism course.
Please note that scientific writing is an important skill and your
peers and instructor will be
evaluating your lab report and provide you with feedback. The
report has the specific purpose of
giving a third-party (peer, instructor) an organized
communication piece of your experiment, so
that they can learn about what has been done, what was found,
what the meaning of the results are,
30. and so that they could redo the experiment themselves.
2.1 Online Lab Organization
An experiment has roughly the following sequence, which is
based on the real-world process for
scientific discovery:
1. Request for proposal (RFP), the experiment should be clear,
include a hypothesis, computa-
tion, and prediction.
2. Specify your prediction.
3. Assemble all pieces required for the experiment.
4. Perform the experiment, and note every detail in your lab
notebook.
5. Write the Lab Report
6. Submit your Lab Report
7. Receive feed-back from the instructor and peers.
8. Evaluate Lab Reports from your peers to become better
writer.
9. Reflect on the received feedback.
2.2 Report Structure
31. The lab report should have the following structure, which is
common in the scientific literature.
Many examples are available at the e-print archives
(https://arxiv.org/):
1. Title
2. Author
https://arxiv.org/
14 Chapter 2. Lab Report Guidelines
3. Affiliation, Date
4. Abstract (one paragraph)
5. Introduction (overview and purpose)
6. Experiment (explain how the experiment is performed)
7. Results (list your specific results, include a table)
8. Analysis (explain what the results mean, include a graph)
9. Summary (one paragraph), sometimes called conclusion
10. Acknowledgments (any help received)
11. Bibliography (any references)
An example for the Title is "Lab 1: Number of Electrons
32. Removed in Tape". Titles such as
"experiment 1" are not descriptive of the text. The title should
reflect the outcome of the report in
a succinct way. The author is your full name. The affiliation is
the school’s name including the
department. The date is added after the affiliation.
Important: In the scientific lab report, passive voice is generally
accepted. If active voice is used,
the royal we is used: "we", when referring to yourself. The
experiment should be conducted by
yourself, however, if you have collaborated with others, then
you need to include the names of
the collaborators in the acknowledgement along with their clear
contribution. Any work that is
not quoted and cited is assumed to be your work. If the report
contains more than 10% of work
from other’s (including wikipedia) that is not quoted or properly
cited, then the report is considered
incomplete and no points are awarded. The report should be an
original piece of work.
The Abstract is written only after the report has been finished.
You should keep a placeholder and
then come back. It is always one paragraph, or 3 – 5 sentences.
It is a brief summary, such as
?Using electrostatics, the number of electrons that can be
33. removed from a common piece of tape
was measured. Using a neutral piece of tape and a charged piece
of tape, we determined the farthest
distance of interaction to be 4(1) mm, which corresponds to a
charge of Q = -40(10) nC (or 250
billion electrons). The charge was determined from the distance
using an electrostatic model of
interaction between a charge and a neutral object.? The abstract
should include the final numbers
and be very specific. A common mistake is to confuse the
abstract with the introduction. These are
very different parts. Also, commonly, we use the notation 4(1)
to mean that the measured results
have a confidence of 67% to lie within 3 – 5 mm. So 4(1) = 4±1
mm. Make sure that you include
units. Keep the abstract succinct.
The Introduction includes an overview. It generally includes
material from the book. The relevant
information about Coulomb?s Law, interactions between a
charged and a neutral object, where the
force decays as 1/d5, where d is the separation distance.
Importantly, this is the section where you
must include your prediction.
The Experiment includes the specific procedure that you used to
make the measurement. Ideally,
34. you would include a photo of your setup and then explain it in
about two paragraphs.
The Results include a table with the measured results and a
paragraph of what the results are. "In
table 1, the distance d is listed for 5 experimental runs".
The Analysis part states your final answer and makes a
comparison with the prediction. Note
here, that if you do not have a prediction, then you cannot
analyze anything. That is the reason
it is so important to have predictions ready. Of course, the
predictions can be off from your
experimental results. It is important that you include the
original predictions. If you realized that in
the predictions you forgot to include a component, then you can
explain this.
The Summary is a one-paragraph summary of all that has been
done. It is different from the abstract
as it focuses on the analysis. The purpose of the abstract is to
interest the reader in reading the full
report. The purpose of the summary is to give a brief synopsis
of what has been found.
In the Acknowledgment section, you should include any other
persons who participated in the
experiment, or contributed in any way.
35. 2.3 Report Submission 15
Figure 2.2.1: Experiment with charged straw. When the charged
straw is (a) far from the uncharged mass,
the force to lift it is too weak. However, at a distance of 8 mm,
the attractive force overcame
the gravitational pull and sticks to the charged object (taken
into account the offset at the
bottom of the ruler). This is a sample photo for lab reports,
showing the name and date on the
post-it in the background.
In the Bibliography section, you should include any relevant
references. Some students choose to
use Zotero plugin to simplify citations and produce professional
references.
2.3 Report Submission
Your report should include a photo of the experiment (including
the date stamp and name), a
table for your results, and a graph from the analysis.
Commonly, you would use a MS Word,
36. Google Docs, OpenOffice Writer, or LaTeX
(https://www.sharelatex.com/, https://www.
overleaf.com/) to write your report. Please submit the Word
document, or if needed PDF-
converted document to the DropBox on Beachboard.
2.4 Grading Rubric
Each report is graded. The following criteria are generally
applied in grading your lab reports (100
points = 100%).
1. (10pts) Are all predictions from the lab assignments included
in the report? (not graded on
correctness, but completeness only, as predictions can be
different from experiment)
2. (10pts) Is it complete? Does it have all the structural
elements? (see section 2.2)
3. (10pts) Does the abstract convey the main results succinctly
in one paragraph?
4. (10pts) Is there a good experimental image with the date and
name of the author? (see
Fig. 2.2.1)
37. 5. (10pts) Does the report include a data table?
6. (10pts) Does the report include a graph with a long caption?
7. (10pts) Is there a summary that includes all main results?
8. (10pts) Are correct SI units used throughout the report?
9. (20pts) Do the results make sense, and was proper language
used in the report, is the report
unique, interesting, and complete?
2.5 Measuring Data
For precise measurements, images are captured with the phone
and then analyzed with software.
An easy and freely available software for multiple platforms is
NIH ImageJ at https://imagej.
https://www.sharelatex.com/
https://www.overleaf.com/
https://www.overleaf.com/
https://imagej.nih.gov/ij/
https://imagej.nih.gov/ij/
16 Chapter 2. Lab Report Guidelines
38. nih.gov/ij/. The software allows you to calibrate the image; i.e.
define a known distance on the
ruler. From the menu choose "Analyze", then "Set Scale". Apply
the units, for the report all units
should be SI units; i.e. meters, millimeters (mm), and so on.
After the calibration you can easily
read of distances in the proper units. You can also measure
areas.
2.6 Ethics
Ethical behavior is utmost important. Plagiarism is not accepted
as a policy by the University and
ramifications are listed on the University page for "Cheating
and Plagiarism" (http://web.csulb.
edu/divisions/aa/catalog/current/academic_information/cheating
_plagiarism.html).
What are some of the important things to know for this course.
Individual reports must clearly
identify the contributions of others in the acknowledgments and
throughout the text by using quotes,
references, and proper wording. During the experimental
conduct, cooperation is acceptable, ques-
tions, and support to make the experiment successful are
acceptable as long as there are significant
contributions. The lab report is an individual account
39. What is ethics in the Sciences? Ethical behavior has a long
tradition in science, mathematics,
and engineering. It is necessary for its continuation. Misconduct
in science centers around
reporting research results that are fabricated, plagiarized, and or
falsified, see http://www.aps.
org/programs/education/ethics/.[6] Proper conduct includes
• truthful, careful handling and reporting of data,
• responsible, respectful interactions with peers and
subordinates,
• adherence to journal publication guidelines, including proper
recognition of research contri-
butions.
The American Physical Society publishes the "APS Guidelines
for Professional Conduct" (https:
//www.aps.org/policy/statements/02_2.cfm) with the goal to
advance and diffuse the knowl-
edge of physics.
2.7 Experiments
Not all experiments "work", see discussion during Office Hours.
Therefore, if your experiment
does not yield results, please document the steps that you have
taken to make the experiment work
40. and the limitations that you have found. It is important to
submit your effort for partial points.
Include images of the experiment. Many scientists,
mathematicians, and engineers draw valuable
information from experiments that did not fully "work", as
lessons can still be learned. Sometimes,
experiments are designed with the purpose of showing nothing,
these are called null experiments.
2.8 Arduino
You can learn about the Arduino micro-controller at
https://www.arduino.cc/. There are
videos, resources, and tutorials available.
After installing the software on your computer, you would test
the Arduino board, generally by
running the "blinking LED" program, see Listing 15.1 on page
80. After loading the program, you
choose the Board. From the menu, select "Tools", then "Board".
The second item is that you need
to select the USB port. Go to "Tools", then select "Serial Port"
and choose your USB connection.
Next upload the program and watch for any errors.
The Arduino allows you to connect sensors, such as temperature
sensor, light sensor, and others,
but also to control devices, such as LEDs, motors, and so on.
41. The operating voltage for input and
output is generally 5 V. The input voltage is analog, so it is
converted to a digital signal using
an analog-to-digital converter (DAC). The digital signal can be
sent back to the computer and
monitored via the so-called "Serial Monitor".
https://imagej.nih.gov/ij/
https://imagej.nih.gov/ij/
http://web.csulb.edu/divisions/aa/catalog/current/academic_info
rmation/cheating_plagiarism.html
http://web.csulb.edu/divisions/aa/catalog/current/academic_info
rmation/cheating_plagiarism.html
http://www.aps.org/programs/education/ethics/
http://www.aps.org/programs/education/ethics/
https://www.aps.org/policy/statements/02_2.cfm
https://www.aps.org/policy/statements/02_2.cfm
https://www.arduino.cc/
2.9 Fitting Data 17
After you compiled the program and sent it to the Arduino. You
can open the Serial Monitor by
clicking on the top right most button in the Arduino IDE labeled
42. "Serial Monitor" and represented
by a looking glass. It will open a new window with the output
from the board. You can see an ex-
ample listed at https://learn.adafruit.com/adafruit-arduino-
lesson-5-the-serial-
monitor/overview.
2.8.1 Breadboard
The Arduino kit often comes with a breadboard and wires which
will be very helpful. If you
are unfamiliar with a breadboard for circuit compilation, then
refer to tutorials on the web, or at
https://learn.sparkfun.com/tutorials/how-to-use-a-breadboard. In
general, a bread
board has two parallel long lines for ground and positive
voltage (5 V); then it has horizontal rows
of 5 pins each. Each of the 5 pins are at the same potential, on
the back of the board, they are
connected.
2.9 Fitting Data
Scientists, mathematicians, and engineers often use models and
compare them with experimental
43. data. The model also allows the experimentalist to extract
specific information. For example, in
the lab on magnetic fields (chapter 14 on page 77) you can
determine the magnetic moment from
fitting the magnetic field data to a dipolar model. Fitting data is
certainly a useful and valuable
(think CV, resume) skill, but it is not necessarily easy.
Fortunately, there are some tricks of the trade. If you can fit a
line with the equation y = mx + b
and determine the slope m as well as the offset b, then you can
take more complex functions and
linearize them. One example of this strategy is explained on
page 14.4. In this case, a power
law can be plotted on a log-log graph and the exponent is
revealed as the slope, the pre-factor is
buried as the offset. For another type of common equation, an
exponential function, such as those
used in the RC lab (chapter 18 on page 87) would be graphed on
a semi-log plot and the slope
is proportional to the time constant. The specifics can be
derived in the same fashion as shown
page 77 for the power law.
Using brute force, the less mathematically inclined person,
would using a fitting program and
simply take the data and fit a particular function corresponding
44. to the model. Common programs
include Excel and RStudio (open source) based on R language.
The following advanced example provides code to make a fit
using R and is intended for the
enthusiastic reader and should be considered optional. In the
first part, the data is loaded from a file
generated by the Tektronix oscillator, which is in a comma-
separated format. The command to load
the data into a data frame is called read.csv.
# Loading data from Tektronix oscilloscope
data <- read.csv(’data.csv’, header=FALSE)
names(data)[4:5] = c(’time’,’V’) # label columns
data$time = data$time*1E3 # convert s to ms
q = subset(data, time < -0.1) # correct for offset
data$V = data$V - mean(q$V)
This data frame contains two columns labeled time and V,
which contains the time in units of ms
and the electric potential measured in units of V. A graph is
generated by first invoking plot to
generate the data points. A second layer is added with the
command points in order to high light
the data points that will be used for the fit.
46. )
Figure 2.9.1: Measurement of a free induction decay from
protons in glycerin. The graph is generated with R,
where data points (circle) represent voltage measured after a
90o pulse was applied to create
precession. The relaxation of the signal amplitude is modeled
and fit with an exponential
decay (see text on page 18).
plot(data$time, data$V, xlab=’time(ms)’, ylab=(’V(V)’),
ylim=c(-0.2, 1.3), xlim=c(-0.5, 3))
d <- subset(data, time>0.3) # fit subset of data
points(d$time, d$V, col=’red’)
R provides a straight-forward way to make a non-linear fit to
the data using the command nls,
which takes 3 main parameters. The first parameter is the data
frame that contains the data to be fit.
Next the model is described, which is V = A exp[−time/T ],
where A and T are fitting parameters,
and the others are variables defined in the data frame. The fit
will only work, if reasonable starting
fit parameters are provided. The starting parameters are
47. provided in the form of a list. The result of
the fit is stored in a variable called fit.
The fit line is added to the plot by using predict to compute
values along some time values. In this
case a vector with 100 elements is generated, the time running
from 0 to two times the maximum.
The fit is overlaid using blue color and line thickness of 4. The
result of this code is shown in
Fig. 2.9.1.
# do fitting, giving some reasonable starting values
nls(data = d, V ~ A*exp(-time/T), start=list(A=1, T=1)) -> fit
time.fit = seq(from =0, to =max(d$time)*2, length.out=100)
predict(fit, list(time=time.fit))->V.fit
time.fit=c(-1,0,time.fit)
V.fit = c(0,0, V.fit)
lines(time.fit, V.fit, col=’blue’, lwd=4)
It is noteworthy that plot will clear the graph, but you can still
add data later using either lines
or points for adding data with a line or data points, respectively.
The fitting parameters can be
separately listed with summary(fit)$coeff.
The same plot can also be graphed with the previously
mentioned ggplot2 package. A common
48. way to use ggplot is to make a table with three columns (using
melt package for complex data).
The first column is the x-axis, the second the y-axis, and the
third column defines the data set
for which automatically a legend is displayed. In the following
example, the NMR FID data is
2.9 Fitting Data 19
appended to the fitting data, by using the row binding function
rbind. The third column is called
label and is filled with the label for each row. The command
length returns the number of items
in a vector and nrow returns the number of rows of a data
frame. Finally, the axes are labeled and
the title of the legend, which would be "label", is hidden. The
legend.key element defines the
square around each of the items in the legend.
myData = data.frame(time = time.fit, V = V.fit)
myData = rbind(myData, cbind(time = data$time, V = data$V))
myData$label = c(rep(’fit’,length(time.fit)),
49. rep(’data’, nrow(data)))
ggplot(myData, aes(time, V, color=label, linetype = label)) +
geom_line(size=2) + theme_bw(base_size=22) +
xlab(’time (s)’) + ylab(’V (V)’) +
scale_y_continuous(limits=c(-0.2,1.4)) +
scale_x_continuous(limits=c(-0.8, 2.6),
breaks=seq(-0.5,2.5,0.5)) +
theme(legend.position = c(0.1, 0.9),
legend.title = element_text(color=NA),
legend.key = element_rect(colour = NA))
3. Practice Exams
PHYSICS is a fundamental science that stresses immutable laws
that describe nature under themost varied conditions. Therefore,
the application of these fundamental principles to diverse
problem sets in the real world is an imminent goal of the course.
It is widely recognized that
50. physics has applications in all fields of science, engineering and
beyond. The exams are guided by
the student learning outcomes defined in the syllabus and
problem solving skills, see grading in
section 1.3.2. Exam problems should be approached
strategically in order to maximize the score.
The following steps convey the logical procedure in problem
solving.
1. Understanding the problem by providing your own sketch,
diagram, and picture of the
problem, which includes variables that are relevant to the
problem.
2. Application of a principle by categorizing the problem to a
particular ummutable law that is
applicable to the problem. This are generally principles of
conservation (Node Rule, Loop
Rule, charge conservation, energy conservation, momentum
principle, . . . ) or fundamental
ideas (Faraday’s Law, Coulomb’s Law, Superposition Principle,
. . . ), and sometimes also
include definitions (I ≡ dQ/dt, . . . )
3. Execution of the problem by applying the principle to the
51. specific problem and calculating a
new result.
4. Skeptical analysis of the problem including the verification
of the units, whether the result
makes sense, whether all questions have been answered, and
how the result can be interpreted
within the broader context of the problem.
3.1 Problem with