# Solving a system of non-linear equations to find relationship between arguments

I have a program that implements a multivariate function, call it $$f = \mathcal{Q}(Z,v)$$ that I can compute given $$Z,v$$. The $$v$$ variable is related to the $$f$$ variable by another relation, call it $$v = \mathcal{L}(f)$$ (so given $$f$$ I have a program that can compute $$v$$). I would like to use this to obtain how $$v$$ varies with $$Z$$.

My present approach is to evaluate $$\mathcal{L}(f)$$ for a bunch of $$f$$, and store the $$v$$ against $$f$$. Then, I would input different values of $$Z$$ (held constant) and $$v$$ to compute $$f$$, and compare these $$f$$ and $$v$$ with those from the earlier evaluation. The closest pair would be selected and I have my $$v$$ for a certain $$Z$$.

Is there a better way than this ad hoc method? I use Python, so using any associated libraries to solve the task is allowed.

• If you recast this as a nonlinear system $f - \mathcal{Q}(Z,\mathcal{L}(f)) = 0$, then this is a pretty standard numerical continuation problem and you can just look at $v$ evaluated along this $f$ curve Feb 5 at 17:43
• Are $v,Z,f$ all scalars, or what are their dimensions? Feb 5 at 18:22
• @whpowell96 Thanks! Apologies if it was obvious, I've never heard of this method. Could you suggest any up to date Python tools for computing these level sets? Most of what I could find (pycont, pacopy) are outdated and are no longer supported. Feb 7 at 14:22
• @WolfgangBangerth $v,f$ are vectors in 3D, Z is a scalar. Feb 7 at 14:23
• I think there are a few Python packages out there purpose-built for continuation but for simple problems it's pretty easy to build your own tool around an existing nonlinear solver using, e.g., arc length continuation Feb 7 at 14:24