Excercise sheet 7
Competion between populations
1. Study the solutions of equation dN(t)/dt=ε N(t)-β
by varying the values of the parameters ε (birth-rate) and β (shadowing), and the initial populations N(t=0). Plot the population as a function of time.
2. Study the behaviour of the equations describing the life of the hares and foxes and of spruces and pines by using different values for the parameters. Plot the populations of foxes as a function of the hare population, and also the spruce population as a function of the number of pines. Using the figures, find the stable solutions where the populations stay constant in time.
More complicated oscillators
1. Nonlinear oscillator. Consider a body attached to a spring again. If the amplitude of the oscillations is not small, the force excerted by the spring will not follow Hooke's law,
=-k x. Instead, in general higher powers of x appear. Suppose the force is given by the function
=-k x-ε
. Solve the equations of motion without friction for m=1kg, k=0.5N/m and
(i) ε=0
(ii) ε=0.1N/m ![]()
Plot the solutions of (i) and (ii) in the same figure. Study the effect of changing the initial displacement, x(t=0).
2. Coupled oscillators. Consider two mass points of masses
and
. The first is connected to a ceiling with a spring
and the second is connected to the first by a spring
. Let
and
be the displacements from the equilibrium positions of the two masspoints. We can write the equations of motion
![]()
Solve numerically the above equations and plot the solutions. Set initial conditions to your liking and try different values of
,
,
and
.
Piecewise functions, conditional evaluation
1. Define a function f as
f(x)= {
0, x≤0
1, x>0
Use both the /; method and the If command.
2. Define a piecewise function that gets as its value
when x<3, x+5 when 3≤x<7 and 14 when x≥7. Plot the function f. How could you redefine the function so that it would be continuous?
Programming
1. Write a program that defines a function f(x)=sin(10 cos(x)) and plots it.
2. Make a program that solves the equation of a damped harmonic oscillator
m
+γ
+k x=0, x(0)=s,
(0)=0.
Write the program into a separate file. The program should set values for m, γ, k and s, then solve the equation and finally plot the solution.
| Created by Mathematica (April 10, 2007) |