Introduction, vectors and functions

advertisement
Physics for informatics
Lecture 1
Introduction, vector calculus,
functions of more variables,
differential equations
Ing. Jaroslav Jíra, CSc.
Introduction
Lecturers: prof. Ing. Stanislav Pekárek, CSc., pekarek@fel.cvut.cz , room 49A
Ing. Jaroslav Jíra, CSc., jira@fel.cvut.cz , room 42
Source of information: http://aldebaran.feld.cvut.cz/ , section Physics for OI
Textbooks:
Physics I, Pekárek S., Murla M.
Physics I - seminars, Pekárek S., Murla M.
Scoring system of the Physics for OI
The maximum reachable amount of points from semester is 100. Points from
semester go with each student to the exam, where they create a part of the final
grade according to the exam rules.
Conditions for assessment:
- to gain at least 40 points,
- to measure specified number of laboratory works,
- to submit specified number of partial problems,
- to submit semester work
Points can be gained by:
- written tests, max. 50 points. Two tests by 25 points max. (8th and 13th week)
- semester work for max. 30 points
- activity on exercises, partial problems solving, max. 20 points
Examination – first part:
Every student must solve certain number of problems according to his/her
points from the semester.
Number of problems to solve
Points from the semester
1
90 and more
2
75 – 89
3
65 – 74
4
55 – 64
5
less than 55
Examination - second part:
Student answers questions in written form during the written exam. The
answers are marked and the total of 30 points can be gained in this way.
Then follows oral part of the exam and each student defends a mark according
to the table below. The column resulting in better mark is taken into account.
written exam
semester + written exam
A
excellent
1
25
120
B
very good
1-
23
110
C
good
2
20
100
D
satisfactory
2-
18
90
E
sufficient
3
15
80
Vector calculus - basics
A vector – standard notation
for three dimensions




A  ( Ax , Ay , Az )  Ax i  Ay j  Az k
Unit vectors i,j,k are vectors of magnitude 1 in directions of the x,y,z
axes.



i  (1,0,0)
Magnitude of a vector
j  (0,1,0) k  (0,0,1)

2
2
2
A  A  Ax  Ay  Az
Position vector is a vector r from
the origin to the current position




r  ( x, y, z)  x i  y j  z k
where x,y,z, are projections of r
to the coordinate axes.
Adding and subtracting vectors
 
A  B  ( Ax  Bx , Ay  By , Az  Bz ),
 
A  B  ( Ax  Bx , Ay  By , Az  Bz ),

A  ( Ax , Ay , Az )

B  ( Bx , B y , Bz )
Multiplying a vector by a scalar

k  A  (k Ax , k Ay , k Az ),
Example of multiplying of a vector by a scalar in a plane

u  (2,1)


v  2  u  2  (2,1)  (4,2)
Multiplication of a vector by a scalar in the Mathematica
Example of addition of three vectors in a plane
The vectors are given:



u  (2,1); v  (2,3); w  (2,0)
Numerical addition gives us
   
z  u  v  w  (2  2  (2),1  3  0)  (2,4)
Graphical solution:
Addition of three vectors in the Mathematica
Example of subtraction of two vectors a plane
The vectors are given:


u  (2,3); v  (1,2)
Numerical subtraction gives us
  
z  u  v  (2  (1),3  2)  (3,1)
Graphical solution:
Subtraction of two vectors in the Mathematica
Time derivation and time integration of a vector function




V (t )  (Vx ,Vy ,Vz )  Vx (t )i  Vy (t ) j  Vz (t )k

dVx dVy dVz
dVx  dVy  dVz 
dV (t )
(
,
,
)
i
j
k
dt
dt dt dt
dt
dt
dt
 t2

 t2
 t2
 V (t )dt  i  Vx (t )dt  j  Vy (t )dt  k  Vz (t )dt
t2
t1
t1
t1
t1
t2
t2
 t2


 V (t )dt, V (t )dt, V (t )dt 
V
(
t
)
dt

t
t y
t z 
 t x
1
1
1
1

t2
Example of the time derivation of a vector
The motion of a particle is
described by the vector equation
 2 1 3

r (t )  (2t  5)i  t j  t k
3


r (t ), v (t ), v(t ), a (t ), a(t )
Determine for any time t: a)
b) the tangential and the radial accelerations
1
r (t )  x 2  y 2  z 2  (2t  5) 2  t 4  t 6 [m]
9 




 2

dv

dr
 2 j  2t k [m / s ]
v (t ) 
 2i  2t j  t k [m / s ] a (t ) 
dt
dt
v(t )  vx  v y  vz  4  4t 2  t 4  2  t 2 [m / s]
2
2
2
a(t )  ax  a y  az  4  4t 2  2 1  t 2 [m / s 2 ]
2
2
2
dv
at (t ) 
 2t [m / s 2 ]
dt
an  a 2  at  4  4t 2  4t 2  2 [m / s 2 ]
2
Time derivation of a vector in the Mathematica
Time derivation of a vector in the Mathematica -continued
What would happen without
Assuming and Refine
What would happen without
Simplify
Graphical output of the

r (t )
Example of the time integration of a vector
Evaluate the time dependence of the velocity and the position vector for the
projectile motion. Initial velocity v0=(10,20) m/s and g=(0,-9.81) m/s2.


v   g (t )dt  (  g x dt ,  g y dt )  (  0  dt ,  g y  dt )  (v0 x , g y t  v0 y ) [m / s]

v (t )  (10, 20  9.81t ) [m / s]
t2
r (t )   v (t )dt  (  v0 x dt ,  ( g yt  v0 y )dt )  (v0 xt , g y  v0 yt ) [m]
2
r (t )  (10t, 20t  4.905t 2 ) [m]
Time integration of a vector in the Mathematica
Study of balistic projectile motion, when components of initial velocity are given
Projectile motion - trajectory:
Scalar product
Scalar product (dot product) – is defined as
Where Θ is a smaller angle between vectors
a and b and S is a resulting scalar.
   
a  b  a  b  cos  S
  n
a  b   ai bi  S
i 1
For three component vectors we can write
 
S  a  b  ax  bx  a y  by  az  bz  ab  cos
Geometric interpretation – scalar product is
equal to the area of rectangle having a and
b.cosΘ as sides. Blue and red arrows
represent original vectors a and b.
Basic properties of the scalar product
   
a b  b  a
 
 
a  b  a b  0
   
a b a  b  ab
Vector product
Vector product (cross product) – is defined as
Where Θ is the smaller angle between vectors
a and b and n is unit vector perpendicular to the
plane containing a and b.
Geometric interpretation - the magnitude of the
cross product can be interpreted as the positive
area A of the parallelogram having a and b as
sides
 

a  b  ab sin   n
 
A  a  b  ab  sin 
Component notation

i

j

k
  
c  a  b  ax
ay
az 
bx
by
bz



 (a y bz  a z by )i  (a z bx  a x bz ) j  (a x by  a y bx )k
Basic properties of
the vector product
 
 
a  b  b  a
 
 
a  b  a  b  ab
   
a b a b  0
Scalar product and vector product in the Mathematica
Direction of the resulting vector of the vector product
can be determined either by the right hand rule or by the screw rule
Vector triple product
        
a  (b  c )  b (a  c )  c (a  b )
Scalar triple product
        
a  (b  c )  b  (c  a)  c  (a  b )
ax
  
a  (b  c )  bx
ay
az
by
bz  V
cx
cy
cz
Geometric interpretation of
the scalar triple product is a
volume of a paralellepiped V
Scalar field and gradient
Scalar field associates a scalar quantity to every point in a space. This
association can be described by a scalar function f and can be also time
dependent. (for instance temperature, density or pressure distribution).


S (r , t )  f (r , t )
The gradient of a scalar field is a vector field that points in the direction of the
greatest rate of increase of the scalar field, and whose magnitude is that rate
of increase.
 S  S  S
grad S  S  i
j
k
x
y
z
Example: the gradient of the function
f(x,y) = −(cos2x + cos2y)2 depicted as
a projected vector field on the bottom
plane.
Example 2 – finding extremes of the scalar field
Find extremes of the function:
Extremes can be found by assuming:
h( x, y)  xe

grad(h)  0
( x 2  y 2 )
In this case :
h h 
grad(h)  ( , )  0
x y
h
( x 2  y 2 )
2 ( x 2  y 2 )
e
 2x e
0
x
h
( x 2  y 2 )
 2 xye
0
y
e
( x 2  y 2 )
2 ( x 2  y 2 )
 2x e
y0
1
1  2x  x  
2
2
Answer: there are two extremes
1
1
h1  (
,0); h2  (
,0)
2
 2
Extremes of the scalar field in the Mathematica
Vector operators
Gradient
(Nabla operator)
Divergence
Curl
 S  S  S
grad S  S  i
j
k
x
y
z

  Ax  Ay  Az
div A    A  i
j
k
x
y
z



i
j
k

 

   Az Ay 
 
curl A    A 
 i 

x y z
z 
 y
Ax Ay Az
  Ax Az    Ay Ax 

 j


  k 
x   x
y 
 z
Laplacian
2S 2S 2S
S   S  div grad S  2  2  2
x
y
z
2
Differential equations
The most simple
differential equation:
y '  f ( x)
dy
y' 
dx
where
We are looking for the function
y (x)
Solution of such equation is
y   f ( x)dx  C
Example:
y'  2 x 
y  x2  C
Where x2+C is general solution of the differential equation
Sometimes an additional condition is given like
y(2)  3
that means the function y(x) must pass through a point
3  2  C  C  1 
2
We have obtained a particular solution
y ( x)  x 2  1
y(x)=x2 -1
x0  [2, 3]
First order homogenous linear differential equation
with constant coefficients
The general formula for such equation is
ay'by  0
To solve this equation we assume the
solution in the form of exponential
function.
y  e x
If
ye
x
y'   e
then
and the equation will change into
y ( x)  ?
x
a e x  be x  0
e x (a  b)  0
after dividing by the
the solution is
eλx
we obtain
y  Ce
b
x
a
a  b 0 
b
 
a
aλ+b is the characteristic equation
Where C is a constant resulting from the initial condition
Example of the first order LDE – RC circuit
Find the time dependence of the electric current i(t) in the given circuit.
1
idt.

C
Now we take the first derivative of the right
equation with respect to time
di 1
di
1
0R  i


i0
dt C
dt RC
u  uR  uC
u  Ri 
characteristic equation is

1
0
RC
 
1
RC
Constant K can be calculated from
initial conditions. We know that
0

u
u
u
RC
i(0) 

 Ke
 K
R
R
R
general solution is
i  Ke

1
t
RC
1
particular solution is
u  RC t
i e
R
Solution of the RC circuit in the Mathematica
Given values are R=1 kΩ; C=100 μF; u=10 V
Second order homogenous linear differential equation
with constant coefficients
The general formula for such equation is
To solve this equation we assume the
solution in the form of exponential function:
If
y  e x
then
y'   e
and the equation will change into
x
ay' 'by'cy  0
ye
x
y' '  2 e x
and
a2 e x  b e x  ce x  0
x
e (a  b  c)  0
after dividing by the eλx we obtain
We obtained a quadratic
characteristic equation.
The roots are
y ( x)  ?
2
a 2  b  c 0
 b  b 2  4ac
12 
2a
There exist three solutions
according to the discriminant D
D b 2  4ac
1) If D>0, the roots λ1, λ2 are
real and different
y  C1e1x  C2e2 x
2) If D=0, the roots are real
and identical λ12 =λ
y  C1ex  C2 xex
3) If D<0, the roots are complex
conjugate λ1, λ2 where α and ω
are real and imaginary parts of
the root
1    i
 2    i
y  K1e1x  K2e2 x  K1e xi x  K2e xi x
 ix
x
i x
i x
e
 cosx  i sin x
y  e ( K1e  K2e )
Eulers form ula
x
y e [(K1  K2 ) cosx  i( K1  K2 ) sin x]
If we substitute
we obtain
C1  ( K1  K2 ); C2  i(K1  K2 )
y( x)  ex [C1 cosx  C2 sin x]
This is the solution in some cases, but …
Further substitution
is sometimes used
C1  Asin ; C2  A cos
and then
y( x)  e x [ A sin  cosx  A cos sin x]
considering formula
sin(   )  sin  cos   cos sin 
we finally obtain
y( x) e x A sin(x   )
where amplitude A and phase φ are constants which can be
obtained from the initial conditions and ω is angular frequency.
This example leads to an oscillatory motion.
Example of the second order LDE – a simple harmonic oscillator
Evaluate the displacement x(t) of a
body of mass m on a horizontal
spring with spring constant k.
There are no passive resistances.
If the body is displaced from its equilibrium position (x=0), it
experiences a restoring force F, proportional to the
displacement x:
From the second Newtons
law of motion we know
m x  kx

x 
F  k x
d 2x
F  m a  m 2  m x
dt
k
x0
m
We have two complex conjugate
roots with no real part
Characteristic
equation is
12  i
k
m
k
  0
m
2
The general solution for
our symbols is
x(t )  e t A sin(t   )
No real part of λ means α=0, and omega in our case
The final general solution of this example is
k

m
x(t )  A sin(t   )
Answer: the body performs simple harmonic motion with amplitude A
and phase φ. We need two initial conditions for determination of
these constants.
x (0)  0 x(0)  2

From the first
A cos( 0   )  0  cos   0   
condition
2

From the second A sin( 0  )  2  A  2
2
condition

The particular
x(t )  2 cos( t )
x (t )  2 sin( t  )
2
solution is
These conditions can be for example
Example 2 of the second order LDE – a damped harmonic oscillator
The basic theory is the same like in
case of the simple harmonic
oscillator, but this time we take into
account also damping.
The damping is represented by the frictional
force Ff, which is proportional to the velocity v.
The total force acting on the body is
F  m a  m x
x 
c
k
x  x  0
m
m
x  2 x   2 x  0
F f  c v   c
dx
 cx
dt
F  kx  Ff  kx  c x
mx  kx  cx  mx  cx  kx  0
The following substitutions
are commonly used
Characteristic
equation is
k
c

; 2 
m
m
2  2   2  0
2
2

2


4


4

2
2
Solution of the characteristic  







12
equation
2
where δ is damping constant and ω is angular frequency
There are three basic solutions according to the δ and ω.
1) δ>ω. Overdamped oscillator. The roots
are real and different
x(t )  C1e1t  C2e2t
2) δ=ω. Critical damping. The roots are real
and identical.
1     2   2
2     2   2
12    
x(t )  C1e t  C2te t
3) δ<ω. Underdamped oscillator. The roots
are complex conjugate.
x(t )  Ae t sin(' t   )
1    i  2   2    i '
2    i  2   2    i '
Damped harmonic oscillator in the Mathematica
Damping constant δ=1 [s-1], angular frequency ω=10 [s-1]
Damped harmonic oscillator in the Mathematica
All three basic solutions together for ω=10 s-1
Overdamped oscillator, δ=20 s-1
Critically damped oscillator, δ=10 s-1
Underdamped oscillator, δ=1 s-1
Download