0
$\begingroup$

Total beginner here. I am chaining 4 quadratic equations $f_i(x)$ at 4 knots $k_i$ (where $0 < k_i < 1$ and $k_{i+1} > k_i$) on a wrapped unit interval (i.e. $0 \leq x \leq 1$):

$$ f_i(x) = a_i x^2 + b_i x + c_i, \quad k_i < x \leq k_{i+1}, \quad i = 0 \dots 3, $$

with connectivity and phase-wrapping constraints:

$$ f_i(k_{i+1}) = f_{i+1}(k_{i+1})\ \ \textrm{for }\ i = 0 \dots 2 \ \textrm{and}\ f_3(k_0+1)=f_0(k_0). $$

Given that I have 12 coefficients ($a_0 \dots a_3, b_0 \dots b_3, c_0 \dots c_3$) and 4 constraints, I'd like to compute expressions for (any) 8 independent coefficients, say $a_0 \dots a_3,$ $b_0 \dots b_2$ and $c_0$. I thought that Mathematica's Reduce would do the trick, but it just keeps running indefinitely. Any suggestions on how I'd approach this?

Here's my feeble attempt:

f0[x_] = a0 x^2 + b0 x + c0
f1[x_] = a1 x^2 + b1 x + c1
f2[x_] = a2 x^2 + b2 x + c2
f3[x_] = a3 x^2 + b3 x + c3
Reduce[f0[k1] == f1[k1] && f1[k2] == f2[k2] && f2[k3] == f3[k3] && 
  f3[k0 + 1] == f0[k0] && k1 != 0 && k2 != 0 && k3 != 0 && 
  k4 != 0, {a0, b0, c0, a1, b1, a2, b2, a3}]
$\endgroup$
3
  • 2
    $\begingroup$ Include the actual code that you used. $\endgroup$
    – bbgodfrey
    Jul 1 at 3:42
  • $\begingroup$ You can not solve 4 equations for 8 unknowns. Further, the solution set seems pretty complicated and it may be, that only implicit solutions are possible, that is not var=.., but fun[vars]==0. $\endgroup$ Jul 1 at 15:58
  • $\begingroup$ I'm not looking for a unique solution -- I'm looking for /a/ solution; that is certainly possible and I can work it out by hand. I'd just like to have mathematica do that for me instead of spending 45 min to write it out myself. $\endgroup$
    – aprsa
    Jul 1 at 16:05
1
$\begingroup$

Turns out I just needed to expand the list of coefficients to a full list:

f0[x_] = a0 x^2 + b0 x + c0
f1[x_] = a1 x^2 + b1 x + c1
f2[x_] = a2 x^2 + b2 x + c2
f3[x_] = a3 x^2 + b3 x + c3
Reduce[f0[k1] == f1[k1] && f1[k2] == f2[k2] && f2[k3] == f3[k3] && 
  f3[k0 + 1] == f0[k0] && k1 != 0 && k2 != 0 && k3 != 0 && 
  k4 != 0, {a0, b0, c0, a1, b1, c1, a2, b2, c2, a3, b3, c3}]

With that change I got what I needed.

$\endgroup$
1
  • $\begingroup$ Specifying the domain Reals in your original Reduce yields a result, too. $\endgroup$
    – Michael E2
    Jul 2 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.