function [] = nonlin_truss(y)

global a1 a2 a3 x theta alpha E L D W1 W2

% Performs nonlinear analysis of truss

E = 29e3;% kips/sq. in.
L = 60; % ft
D = 120;% ft
W1 = 100;% kips
W2 = 1000; %kips

a1 = y(1); a2 = y(2); a3 = y(3); 
x = y(4); %in ft

% Find theta and alpha

theta = acot(x/L);
alpha = acot((D-x)/L);

% Start at linear analysis solution

u_linear = truss_analysis(y)

options(1) = 1;

u = fsolve('nonlin_trussFUN', u_linear, options)
