Exercises lecture 4

ClearAll["Global`*"];SetDirectory[NotebookDirectory[]]

Exercise 1: Consider this list of points on a plane: points= {{1,6},{4,1.5},{0.5,2.5},{3,3},{1,5}}. Find by trying out systematically all permutations (use command “Permutations”) of the points the minimal path that starts from the origin, touches all the points once and comes back to the origin.
Check your result by using the built-in function  FindShortestTour. Plot the resulting path through the points.

Exercise 2: Solve numerically a differential equation for the motion of a spring with friction and plot the solution; you might use the constant below, or define them as you prefer

(*Define the constants*)
m=1;         (*Mass*)
k=2;         (*Spring constant*)
c=0.5;       (*Friction coefficient*)
x0=1;        (*Initial displacement*)
v0=0;        (*Initial velocity*)
tmax=10;     (*Maximum time*)