I have two polynomials in k given by f[b,d,k] and g[b,d,k]. I know that there exists a function k[u,v] such that, when we evaluate this function in the system, we get a new equation h[b,d]=0, which defines a curve. I would like to find that solution in k. The problem is that, for instance, we could have that g is a fourth-degree polynomial in k and, if we extract all the roots with
Solve[g[b,d,k]==0,k], then it could happen that some functions k=k[b,d] don't provide a solvable equation
f[b,d,k[b,d]]==0
Up until now, what I've done is the following thing:
sols = Solve[g[b,d,k] == 0, k]; For[l = 1, l <= Length[sols], l++, ktemp = sols[[l]][[1]][[2]]; tempcurve = f[b,d,k] /. k -> ktemp; tempplot = ContourPlot[tempcurve == 0, {b,0,4}, {d,0,6}]; If[ Length[Cases[Normal@tempplot, Line[x_] :> x, Infinity]] > 0, k = ktemp; Break; ] ]; However, as this code is plotting each implicit function for each k, it may take a long time. I was wondering if there is an optimal way to do this.
I'm currently just testing my code so I am not dealing with difficult functions for now but take, for example,
f[b,d,k]=d + k^2 + 0.002025 d k^2 + 0.002025 k^4 + b^2 (1 + (0.002025 - 2/(b^2 + d)) k^2) g[b,d,k]=1 + 0.002025 d + b^2 (0.002025 - 2/(b^2 + d)) + 0.00405 k^2
Of course, in that case, g can be easily solved for k^2, but I am trying to work out the general case as I stated before.




