Error with function, no methods matching

In systeme!, you call f with two arguments, the returned values of the inner calls.

Written like this it’s more clear where you’re going wrong:

function systeme!(S,x)
    a = f(x[1],x[2],x[3],x[4])
    b = g(x[1],x[2],x[3],x[4])
    S[1]=f(a,b)-x[1]
    S[2]=g(a,b)-x[2]
end

Since you only defined f and g with four arguments, calling them with only two naturally won’t work.

3 Likes