Undergraduate Physics Education | Things to Try

Make edits and run any piece of code by clicking inside the code and pressing
+
.

Solve a Mass-Spring System

The governing equation of motion is derived from Newton's second law
2
d
x
d
2
t
=-
2
ω
x(t)
, where
ω=
k/m
is the angular frequency.
Solve the equation, subject to initial conditions:
In[]:=
eqn=x''[t]==-
2
ω
x[t];​​sol=DSolveValue[{eqn,x[0]==x0,x'[0]==v0},x[t],t]
Out[]=
x0ωCos[tω]+v0Sin[tω]
ω
Rewrite the solution in terms of amplitude
A
and phase angle ϕ:
In[]:=
x[t_]=Simplify[sol/.{x0->ACos[ϕ],v0->-ωASin[ϕ]}];x[t]
Out[]=
ACos[ϕ+tω]
Get the velocity and acceleration as the first and second derivatives of position with respect to time:
In[]:=
v[t_]=D[x[t],{t,1}];v[t]
Out[]=
-AωSin[ϕ+tω]
In[]:=
a[t_]=D[x[t],{t,2}];a[t]
Out[]=
-A
2
ω
Cos[ϕ+tω]

Plot the electric field lines of a dielectric ball in an electric field

The formula for the electric field near a dielectric ball can be obtained through
EntityValue
:
In[]:=
field=
dielectric ball in an electric field
PHYSICAL SYSTEM

electric field

Out[]=
0,0,
3
E
0
2+
1
/
ε
0

ϵ

Rational[1,2]
(
2
x
+
2
y
+
2
z
)
≤
R

3
3
R
x
z
Rational[-5,2]
(
2
x
+
2
y
+
2
z
)
-1+
1
/
ε
0

ϵ

E
0
2+
1
/
ε
0

ϵ
,
3
3
R
y
z
Rational[-5,2]
(
2
x
+
2
y
+
2
z
)
-1+
1
/
ε
0

ϵ

E
0
2+
1
/
ε
0

ϵ
,1-
3
R
Rational[-3,2]
(
2
x
+
2
y
+
2
z
)
1-
3
2
z
2
x
+
2
y
+
2
z
-1+
1
/
ε
0

ϵ

2+
1
/
ε
0

ϵ
E
0

True
Substitute in values for all
QuantityVariable
expressions in the result above:
In[]:=
elecField[x_,y_,z_]:=field/.QuantityVariable["R","Radius"]->1,QuantityVariable[Subscript["E",0],"ElectricFieldStrength"]->2,
ϵ
->4
ε
0
,QuantityVariable["x","Length"]->x,QuantityVariable["y","Length"]->y,QuantityVariable["z","Length"]->z
Use
StreamPlot
to visualize the electric field lines for this physical scenario:
In[]:=
StreamPlot[elecField[x,0,z][[{1,3}]]//N,{x,-2,2},{z,-2,2},StreamMarkers->None,Epilog->Circle[],StreamColorFunctionScaling->True]
Out[]=

Solve the Schrödinger Equation for the Linear Harmonic Oscillator

The Schrödinger equation for the linear harmonic oscillator is given by:​​
-
2
ℏ
2m
ψ"(x)
+
k
2
2
x
ψ(x)=ϵψ(x)
For simplicity scale the variables such that
ℏ=m=k=1
:
In[]:=
ℒ=-
1
2
ψ''[x]+
1
2
2
x
ψ[x];
Use the
NDEigensystem
algorithm to get the first five eigenvalues and eigenfunctions:
In[]:=
{evals,efns}=NDEigensystem[ℒ,ψ[x],{x,-5,5},5];
List the eigenvalues (the exact values are known to be
ϵ=
1
2
,
3
2
,
5
2
, …):
In[]:=
evals
Out[]=
{0.500079,1.50054,2.5019,3.5047,4.50941}
Plot the first four eigenfunctions:
In[]:=
Table[Plot[Evaluate[-efns[[n]]],{x,-3,3},GridLines->Automatic],{n,1,4}]
Out[]=

,
,
,


Interactive demonstrations

Find demonstrations based on keywords:
In[]:=
EntityList[FilteredEntityClass["WolframDemonstration",EntityFunction[c,MemberQ[c["Keywords"],"force"]]]]
Out[]=

Acceleration of a Wheel
,
Analysis of Forces on a Truss
,
Car on a Banked Road
,
Clumping by Surface Tension
,
Conic Pendulum
,
Controlling Airplane Flight
,
Deformation of a Tennis Ball and Racket Strings
,
Double Atwood Machine
,
Electrostatic Force between Charged Conducting Spheres
,
Equilibrium of a Rigid Bar
,
Forces on a Bouncing Ball
,
Forces on a Pendulum
,
Forces on Massive Parallel Wires Carrying Equal Currents
,
Frictional Force on a Car in a Turn
,
Gravitational Force between Two Spheres
,
Hammering a Nail into a Board
,
Hooke's Law
,
Impulse Acting on a Pendulum
,
Joule's Experiment
,
Law of Moments for Lever with Two Weights
,
Mechanical Work
,
Mechanics of the Chameleon Tongue
,
Moment of a Force about a Point
,
Multi-Force Newtonian Particle Simulator
,
Power versus Work
,
Pressure
,
Proton Moving along the Axis of a Charged Ring
,
Resultant of a Sum of Forces
,
Standing on a Beam Supported by a Cable
,
Static Equilibrium and Triangle of Forces
,
Static Friction
,
Tension of a Rope with a Hanging Mass
,
Tensions between a Chain of Blocks
,
The Hydraulic Press
,
Torque Exerted Opening a Door
,
Weight of a Person Riding in an Elevator
,
Work in an Attractive Inverse-Square Field
,
Work Is Independent of Path in a Conservative Field

Get a list of all demonstration classes and display a random sample of 10:
In[]:=
ecl=EntityClassList["WolframDemonstration"];​​RandomSample[ecl,10]
Out[]=

elementary school k-2 science demonstrations
,
analytic geometry demonstrations
,
inequalities demonstrations
,
numerical analysis demonstrations
,
high school advanced calculus and linear algebra demonstrations
,
electromagnetism demonstrations
,
molecular biology demonstrations
,
projective geometry demonstrations
,
higher-dimensional geometry demonstrations
,
elementary school 3-5 science demonstrations

List all demonstrations in the class of interest:
In[]:=
el=EntityList
electromagnetism demonstrations
WOLFRAM DEMONSTRATIONS
;​​RandomSample[el,10]
Out[]=

Electromagnetic Ring Toss
,
Magnetic Field of a Cylindrical Bar Magnet
,
Circular and Elliptic Polarization of Light Waves
,
Current-Carrying Coil in an External Magnetic Field
,
Laue's Method for 2D Lattices Using Ewald's Circle
,
Electromagnetic Doorbell
,
Electric Field Generated by Two Point Charges
,
Reading Hertz's Own Dipole Theory
,
Two Charged Conducting Pendulums
,
Compass Needle in Uniform and Rotating Magnetic Fields

Interact with a particular demonstration: