Excercise sheet 7

Competion between populations

1. Study the solutions of equation dN(
              t)/dt = ϵ N(
              t) - β ((N(t))^2) 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 spruces. 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, (Subscript[F, spring]) = -k x. Instead, in general higher powers of x appear. Suppose the force is given by the function (Subscript[F, spring]) = -k x - ϵ (x^3). Solve the equations of motion without friction for m = 1kg, k = 0.5N/m and
	 (i) ϵ = 0
	 (ii) ϵ = 0.1N/m\(TraditionalForm\`\(\( \)\(\^3\)\)\)
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 (Subscript[m, 1]) and (Subscript[m, 2]). The first is connected to a ceiling with a spring (Subscript[k, 1])and the second is connected to the first by a spring (Subscript[k, 2]). Let (Subscript[x, 1])and (Subscript[x, 2]) be the displacements from the equilibrium positions of the two masspoints. We can write the equations of motion
	\(TraditionalForm\`m\_1\ \(x\& .. \)\_1 = \(-k\_1\) x\_1 - \(k\_2\)(
            x\_1 - x\_2)\)
\(TraditionalForm\`\(m\_2\) \(x\& .. \)\_2 = \(-\(\(k\_2\)(
            x\_2 - x\_1)\)\)\)
Solve numerically the above equations and plot the solutions. Set initial conditions to your liking and try different values of (Subscript[m, 1]), (Subscript[m, 2]), (Subscript[k, 1]) and (Subscript[k, 2]).

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 (x^2) 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
	\(TraditionalForm\`m\ \(x\& .. \) + γ\ x\& .  + k\ x = 0, \ 
      x(0) = s, \ \(x\& . \)(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.