Skip to main content
14 of 17
Made question a lot easier to read
Cogicero
  • 149
  • 1
  • 10

Solve / brute-force for parameters that drive a function to zero at specified points

Edit: Made question a lot easier to read.

Simple example.

  • Consider $p(x,y,z,t) = e^t(ax^2 + by^2 + cz^2)$ and I seek the values of $a,b,c$ which make $p\approx0$ at the point $(x=r\cos\theta,y=r\sin\theta,m,t)$ for all $t\ge0$ where $0 < \theta \le 2\pi$. A solution will be $(a,b,c)=\{(m/r)^2,(m/r)^2,-1\}$. How could I have found this in Mathematica?

Problem description:

  • I have 3 real-valued functions $f(x,y,z,t)$, $g(x,y,z,t)$, $h(x,y,z,t)$ which contain some parameters/coefficients $a,b,c,d,e$ .

  • At carefully selected values of those parameters, the functions are each forced to be approximately zero for all the points parametrized by $(x=r\cos\theta,y=r\sin\theta,m,t)$, where $0 \le t$ with $0 < r \le R$ and $0 < \theta \le 2\pi$. How do I brute-force or solve for the parameters which drive those functions to zero?

Sample functions (the actual functions are much longer and complicated):

Find $a,b,d$ such that at all the parametrized points as defined above, then $f\approx0$ && $g\approx0$ && $\textrm{Norm}[h]\approx0$ where

f = 1/2 a^2 E^(-2 d^2 t) (E^(2 a x)+E^(2 a y)+E^(2 a z)+2 E^(a (y+z)) Cos[d x+a z] Sin[a x+d y]+2 E^(a (x+y)) Cos[a y+d z] Sin[d x+a z]+2 E^(a (x+z)) Cos[a x+d y] Sin[a y+d z]);
g = (a^2+b^2+ab)*Exp[2*(a^2+b^2+(a+b)^2)*t]*(Exp[a*(x-y)+b*(x-z)] + Exp[a*(y-z)+b*(y-x)] + Exp[a*(z-x)+b*(z-y)]);
h = {a E^(-d^2 t) (E^(a z) Cos[a x+d y]+E^(a x) Sin[a y+d z]),a E^(-d^2 t) (E^(a x) Cos[a y+d z]+E^(a y) Sin[d x+a z]),a E^(-d^2 t) (E^(a y) Cos[d x+a z]+E^(a z) Sin[a x+d y])};

What I have tried:

  1. ReplaceAll for the variables $(x,y)=(r\cos\theta,r\sin\theta)$, enforce constraints on $z,\theta,r$ and $t$ then use Minimize. This doesn't work, Mathematica simply returns the input command. I have also asked this on another question. e.g.

    points = {x^2+y^2->r^2,x->r*Cos[\[Theta]],y->r*Sin[\[Theta]]}; Minimize[{f /. points, 0 < z <= 200 && 0 <= \[Theta] < 2\[Pi] && t > 0}, {a,d}]

  2. ReplaceAll for the variables, and then SolveAlways for $z,r,\theta$ and $t$ in the constraints. I also tried Reduce. Neither worked e.g. for SolveAlways,

    fpoints = Simplify[f, {x^2 + y^2 -> r^2, x->r*Cos[theta], y->r*Sin[theta]}]; gpoints = Simplify[g, {x^2 + y^2 -> r^2, x->r*Cos[theta], y->r*Sin[theta]}]; hpoints = Simplify[h, {x^2 + y^2 -> r^2, x->r*Cos[theta], y->r*Sin[theta]}]; SolveAlways[fpoints==0 && gpoints == 0 && hpoints == 0 && t >= 0 && 0 < theta <= 2*Pi && m >= z > 0,{theta,r,z,t}]

  3. Manual brute-force process. I tried fixing some parameters (my random guesses), evaluating the functions and using FindMinValue and FindMaxValue for all theta, t and z e.g. fpoints = Simplify[f, {x^2 + y^2 -> r^2, x->r*Cos[theta], y->r*Sin[theta]}]; FindMinValue[{fpoints /.{r->1,a->1,b->1,c->1/10,d->-1/100,e->25}, {0 <= z < m && 0 <= theta < 2*Pi}}, {theta,t,z} FindMaxValue[{fpoints /.{r->1,a->1,b->1,c->1/10,d->-1/100,e->25}, {0 <= z < m && 0 <= theta < 2*Pi}}, {theta,t,z}

(For ℎ I did the FindMinValue on Norm[hpoints] after the ReplaceAll). By randomly changing the parameters manually, I can occasionally obtain cases in which FindMinValue and FindMaxValue give me numerical zeros e.g. FindMinValue gives −6.07768∗10−7 and FindMaxValue gives me 5.52429∗10−8. Then I move on to the other functions and see if I get numerical zero for $g$ and $h$ as well at those same parameters. This isn't always working out so far. Since I am changing parameters manually I am sure I am definitely missing the sweet spot in between the parameter values.

Cogicero
  • 149
  • 1
  • 10