function [B] = diverforces(diverweight, n)

% creates the B vector (h^4/(E*I) * f(x) for a wood beam under its own weight
% plus that of a diver standing on the unclamped edge
gravity = -9.81;
density = 480;
h = 2 / n;        % 2 meter board cut up into n pieces
width = 0.3;      % 30cm
thickness = 0.03; %  3cm
E = 1.3e10;
I = width * thickness^3 / 12;
diverwidth = 0.2;
%diverweight = 70;

diver = (h:h:2 >= 1.8) * gravity * diverweight / diverwidth;

B = h^4/(E*I) * (ones(n, 1) * gravity*density*width*thickness + diver');
