Hi Cesium,
You need to modify the continuation_combined function to call the nlsolver function correctly. Instead of passing continuation_side as the first argument to nlsolver, we should pass the equation_f function, which calculates the residuals based on the nonlinear equation.
Here's the corrected code for the continuation_combined function:
function q_val = continuation_combined(q, N)
q_val = q; for n = 1:N xguess = 2 * q_val(:, end) - q_val(:, end-1); % Extrapolate a new guess for the solution
xguess = nlsolver(equation_f, xguess, q_val(end), 10e-10); % Solve using the extrapolated guess
q_val = [q_val, xguess]; % Append the new solution end end
With this modification, the nlsolver function will correctly solve the nonlinear equation using the provided extrapolated guess.