% Student exercise 1

clear all
syms L fe fa
eqn1 = L==1-((fe^5)/(0.5^5+fe^5));
eqn2 = fe==0.6*L*exp(0.5*L);
eqn3 = fe==fa;
[L,fe,fa] = vpasolve([eqn1,eqn2,eqn3],[L,fe,fa])

%
% Quick plot check

clear all;
fe=0:0.01:1;
L=1-((fe.^5)./(0.5^5+fe.^5));
plot(fe,L)
hold on
clear fe;
L=0:0.1:1;
fe=0.6.*L.*exp(0.5.*L);
plot(fe,L)
xlabel("fe");
ylabel("L")
legend(["muscle","spindle"])