function [f] = solutions_Final_p2e(t, theta1)

    % Intial guess
    c = [1;1];
    
    % Initial residual
    r = solutions_Final_p2e_Residual(c, t, theta1);
    
    diff = 1;
    
    while diff>1E-8
        J = solutions_Final_p2e_Jacobian(c, t);
        delta = J\r;
        diff = norm(delta, 2);
        c = c - delta;
        r = solutions_Final_p2e_Residual(c, t, theta1);
    end
    f = solutions_Final_p2e_Fit(c, t);
end

function [f] = solutions_Final_p2e_Fit(c, t)
    f = c(1)*t./(t + c(2));
end

function [r] = solutions_Final_p2e_Residual(c, t, theta1)
    f = solutions_Final_p2e_Fit(c, t);
    r = theta1 - f;
end

function [J] = solutions_Final_p2e_Jacobian(c, t)
    J = zeros(length(t), 2);
    J(:, 1) = -t./(t + c(2));
    J(:, 2) = c(1)*t./((t + c(2)).^2);
end