% Three Bungee Jumpers - WorkshopEx02.m % % This program reflects what would be typed in % when solving the bungee jumper problem using % MATLAB as a matrix calculator clear clc % Set up the parameters of the Bungee Jumper problem echo on % The weights for Alex, Barry, and Carol (in pounds) wA = 225; wB = 160; wC = 105; w = [wA; wB; wC] % The lengths of the bungee cords L = [15; 15; 15] % The bungee cord spring constants c = [75; 30; 30]; C = diag(c) % Define the matrix A A = [1 1 1; 0 1 1; 0 0 1] % Calculate the vector of elongations. e = inv(C)*A*w e = C^(-1)*A*w e = C \ (A*w) % Calculate the vector of positions z = A'*(e + L) echo off