import java.util.Scanner;
public class Blocky cfw_
public static void main(String[] args)cfw_
Scanner scan= new Scanner(System.in);
System.out.print("What is your total distance?:");
int totalDistance = scan.nextInt();
System.out.print("What is your block
AP COMP SCI
August 19th =
-format for variables: dataType variableName = value
-Rule #1: Names must be alphanumeric
-has to start with a letter
-Rule #2: Names are case sensitive
-big is totally different with big
-Rule #3: No reserved words for variable
public class IntDivisioncfw_
public static void main(String[]args)cfw_
/Ints only hold whole numbers
/doubles can hold decimals
System.out.println(27/4);
/when we do division with ints, we chop off the decimal (no rounding)
/called truncation
System.out.p
public class BooleanIntrocfw_
public static void main(String[] args)cfw_
boolean test = true;
/just assigning a variable to "true"
System.out.println(test);
boolean greater = 5 > 10;
System.out.println(greater);
/we can use >, <, =(is equal to), !=(is not
import java.util.Scanner;
public class Change cfw_
public static void main(String[] args)cfw_
Scanner epicscan = new Scanner(System.in);
/ask the user for the snack total (how much the snack costs)
System.out.print("How much did your snack cost?$");
doubl
Applications of Capacitors
V E
q C V
0 A V
d
V E
q C V
0 A V
d
Suppose d is decreased. Then q is increased:
there will be a flow of charge through the circuit.
This flow of charge is an electric current and it
can be made to do useful work.
V E
q C V
Think of the electric current as due to the motion of small
particles, called charge carriers. The average particle has
charge q and the particles are distributed uniformly
throughout the conducting volume.
Think of the electric current as due to the moti
Sources of the Magnetic Field
A magnetic north pole, placed in an external
magnetic field, is attracted in the direction of
that field.
A magnetic south pole, placed in an external
magnetic field, is attracted in the opposite
direction of that field.
What
The Hall Effect
Can we use magnetic fields to tell us what is the
sign of the charge carriers in ordinary conductors?
Suppose the charge carriers are positively charged
FB q v B
Suppose the charge carriers are positively charged
FB q v B
Suppose the charg
The Electric Field
9 10 Nm
9
F3
33.75 N
i
2
2 10 C 3 10 C
i
4 10 m
/C
6
2
2
2
6
F6 2F3 67.5 N
i
F1 1 F3 11.25 N 11.25 N
i
i
3
In all these cases, the force on a point charge
is proportional to the charge. For charges
placed at P, F / q in indep
The Flux Concept
Total current through the disk
J dA
disk
Total current through the hemisphere
hemisphere
J dA
For a closed surface, the convention is to choose
the areal vector outwards, away from the enclosed
volume.
You can define the flux of any ot
The Electric Dipole
Find the electric field at P
E
ke q
x a
,
i
2
E
ke q
x a
2
i
1
1
k q
E E E
i
i e
i
2
2
2
2
x a x a
x a x a
x 2 2ax a 2 x 2 2ax a 2
x a 2 x a 2
k q
ke q
i e
i
2
2
2
2
x a x a
x a x a
4ax
ke q
i
2
2
x a x a
ke
Maxwells Electrodynamics
Electromagnetism as Maxwell found it
E dA q
enclosed
/ 0
S
B dA 0
S
d
E ds d t B d A
C
S
B ds J d A
0
C
S
Magnetic field on the perpendicular bisector of a thin straight
wire of length L carrying current I.
Compute B usinf the
Some important results from
chapter 24
Suppose we are handed a spherical but not necessarily
uniform distribution of electric charge on an insulating
ball. Is there a way to figure out what the distribution is
solely by performing experiments outside the
RC Circuits
Initially uncharged capacitor. Throw switch to a.
Capacitor begins to charge. Positive charge accumulates
on the upper plate, negative charge on the lower plate.
Capacitor begins to charge. Positive charge accumulates
on the upper plate, negat
More on Electric Charge
charge polarization of conductors
charge polarization of insulators
The atoms of most materials have a
regular arrangement.
Quantization of electric charge
Quantization of electric charge
Cannot continue the process indefinitely
Qu
Magnetic Forces and Torques on
Currents
What will be the direction of the force on the wire if
current flows up the page?
Let a current flow in a wire and consider a small piece of wire
of length ds. Define a vector d s whose magnitude is the length of
th
Induced Electric Fields
Whenever the surface enclosed by a conducting loop experiences a
changing magnetic flux, there is always an emf around the loop associated
with this changing flux.
B B dA
S
E
d B
dt
E N
d B
dt
Faraday's law for a single turn of wi
Inductance
An inductor is an arrangement of wires or other conductors used to
produce a magnetic field.
Circuit theory symbol:
Consider an inductor composed of N turns of wire.
When a current I flows through the inductor, a magnetic field B I
is produced.
Induction motor
Direction of torque on rotating magnet?
Conservation of angular momentum
A
C
Four solenoids, shown at
time t 0, driven by
ac currents at the same
frequency but with 90
phase differences.
B
D
A
Four solenoids, shown at
time t
C
1
4
B
T , d
Inductance problems
The switch in the above circuit is closed and kept closed for a long time. Eventually,
the emf across the inductors becomes zero. The switch is then opened
A. After the switch is opened, find the maximum charge on the capacitor.
B. Aft
General DC Circuits
series connections of resistors: Req R j
j
parallel connections of resistors: 1/Req 1/ R j
j
Simplifying a simple circuit
I bat
3V
0.169A
17.769
In particular, the current through
the 2.769 Ohm resistor is 0.169 A.
The current throug
Induced Currents
Current increasing in primary circuit
Current decreasing in primary circuit
Phenomenon: Whenever the surface enclosed by a
conducting loop experiences a change in magnetic flux,
an induced current appears in the loop.
Lenz's law: The magn
Free Electrical Oscillations
K 1 mv 2 ,
2
U S 1 k x2
2
Etotal K U 1 mv 2 1 k x 2
2
2
dx
v
dt
d Etotal
d v2 1 d x2
1
0 2m
2k
dt
dt
dt
0 mv
dv
dx
dv
kx
mv k x v
dt
dt
dt
dv
dv
d dx
0 vm
kx m
kx 0 m
kx 0
dt
dt dt
dt
d2 x
m 2 kx 0
dt
d2 x k
x0
2
dt
m
Electric Potential
WF
F d F d cos
F, d
WF
F d F d cos
F, d
Displacement of weight d y
j
WF
F d F d cos
F, d
Displacement of weight d y
j
Wg Fg d mg y cos
WA FA d mg y cos
180 mg y
0 mg y
E E
i
FE qE
FA FE qE
E E
i
FE qE
FA FE qE
180 qEd
WA FA d q
Electromagnetic Plane Waves
Properties of electromagnetic waves in vacuum
1. E and B are perpendicular to one another and to the
direction of wave motion.
2. The direction of E B is parallel to the direction of wave
motion.
3. The waves move with the same
Energy Stored in a Charged
Capacitor
q
V
C
How much work must you do to move a small
amount of positive charge q from the negatively
charged plate and put it onto the positively charged one?
q
V
C
How much work must you do to move a small
amount of posi
Electric Potential Functions
Procedure:
1. Choose an arbitrary location P and set V 0 there.
2. At any other location P
Work you have to do to move a charge q from P to P
V P
q
For example, consider a uniform electric field
E E .
i
The below graph shows