function [n5, err] = mydissfuniii(c, h, o, temp, feq, airs, press)
    % Initialize variables
    tol = 1e-6; 
    max_iter = 100; 
    iter_count = 0; 
    n5_guess = 1;

    % Define the function to find the root of
    gibs_free_energy = @(n5) calculate_gibs(c, h, o, temp, feq, airs, press, n5);

  
    [n5, iter_count] = secant(gibs_free_energy, n5_guess, n5_guess + 0.1, tol, max_iter);

    % Calculate error (difference from zero)
    err = abs(gibs_free_energy(n5));

    % Display results for debugging
    fprintf('n5: %.6f, Iterations: %d, Error: %.6e\n', n5, iter_count, err);
end

function g = calculate_gibs(c, h, o, temp, feq, airs, press, n5)
  
    g = c + h + o + temp - n5^2 + feq * airs - press; 
end
