Non-linear (trigonometric) equation having 1 unknown variable

160 Views Asked by At

I want to solve following equation for "a".

$$ X= \nu \bigg[\frac{\sin{\big(\pi(1+a) \frac{\Delta N}{\lambda}\big)}} {\sin{\big(\pi (1+a)\frac{\Delta N}{\lambda N}\big)}}\bigg] $$

I tried MATLAB 'solve', but unable to find symbolic solution for this in MATLAB.

syms X a Delta_N N L
eqn = X==sin(pi*(1+a)*Delta_N/L)/sin(pi*(1+a)*Delta_N/(L*N));
sol_a=solve(eqn, a, 'ReturnConditions', true)
pretty(sol_a.a)

The result is 'Warning: Cannot find explicit solution.'

The conditions for $X$ is values between $0-1$. $\lambda$ can take value between $2-8$, $N=1024$, $\Delta N=10$ or $\Delta N=20$ and $\nu = 1$. The value of $a$ is very small.

I tried to make changes in the equation using different $N$ in MATLAB.

eqn = X==sin(pi*(1+a)*Delta_N/L)/sin(pi*(1+a)*Delta_N/(L*15));

I got this result:

(15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[1]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[2]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[3]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[4]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[5]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[6]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[7]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[8]))/(Delta_N*pi) - 1
  (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[9]))/(Delta_N*pi) - 1
 (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[10]))/(Delta_N*pi) - 1
 (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[11]))/(Delta_N*pi) - 1
 (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[12]))/(Delta_N*pi) - 1
 (15*L*acos(RootOf(z^14 - (13*z^12)/4 + (33*z^10)/8 - (165*z^8)/64 + (105*z^6)/128 - (63*z^4)/512 + (7*z^2)/1024 - X/16384 - 1/16384, z)[13]))/(Delta_N*pi) - 1
1

There are 1 best solutions below

4
On

For a simpler way to write your equations, define $$n := N \qquad x = \frac{X}{\nu}\quad y := \frac{Y}{\nu}\quad z := \frac{Z}{\nu} \qquad t:=\frac{\pi(1+a)}{n\lambda} \quad u := t\;\Delta N$$ Then we have $$\begin{align} x \sin( u )\phantom{-t\;} &= \sin( n\,u ) \\ y \sin( u - t ) &= \sin( n\,( u - t ) ) \\ z \sin( u + t ) &= \sin( n\,( u + t ) ) \end{align}\tag{1}$$ For integer $n$, we know that $$\sin(n\theta) = \sin\theta\;\sum_{k\;\text{odd}}(-1)^{(k-1)/2}\binom{n}{k}\cos^{n-k}\theta \left(1-\cos^2\theta\right)^{(k-1)/2} = \sin\theta\;p_n(\cos\theta)$$ That is, $\sin(n\theta)$ is the product of $\sin\theta$ and some polynomial, $p_n$, in $\cos\theta$. Thus, we get some cancellation in our system: $$\begin{align} x &= p_n(\;\cos(u)\;)\\ y &= p_n(\;\cos(u-t)\;)\\ z &= p_n(\;\cos(u+t)\;)\\ \end{align}\tag{2}$$

Solving for $a$ requires only the first equation. The idea is straightforward enough:

  • Calculate the roots, $r$, of $p_n(r) - x = 0$, restricting attention to real values that fall between $-1$ and $1$ (since they're supposed to be cosines). For $n=1024$, these roots are highly unlikely to be "nice". MATLAB should be able to provide floating-point approximations easily enough; alternatively, you can explicitly invoke Newton's Method or something similar.
  • Then, for each $r$, there is a corresponding $a$, via $$a = \frac{n\lambda\;\arccos{r}}{\pi\;\Delta N}-1 \tag{3}$$

Note that the other equations aren't helpful here. However, it's theoretically possible to eliminate $t$ and $u$, leaving a relation involving $x$, $y$, $z$ alone. For $n$ on the order of $1024$, however, I don't recommend trying to generate that relation; it doesn't help the problem at hand, anyway.


FYI, Mathematica tells me that

$$\begin{align} p_{1024}(r) &= - 1024 r ( 1 - 2 r^2 ) \\ &\qquad\cdot (1 - 8 r^2 + 2^3 r^4) \\ &\qquad\cdot (1 - 32 r^2 + 160 r^4 - 256 r^6 + 2^7 r^8) \\ &\qquad\cdot (1 - 128 r^2 + \cdots + 2^{15} r^{16}) \\ &\qquad\cdot (1 - 512 r^2 + \cdots + 2^{31} r^{32}) \\ &\qquad\cdot (1 - 2048 r^2 + \cdots + 2^{63} r^{64}) \\ &\qquad\cdot (1 - 8192 r^2 + \cdots + 2^{127} r^{128}) \\ &\qquad\cdot (1 - 32768 r^2 + \cdots + 2^{255} r^{256}) \\ &\qquad\cdot (1 - 131072 r^2 + \cdots + 2^{511} r^{512}) \end{align}$$ ... not that the factorization helps, since you need to subtract $x$ before solving.

Given a polynomial of such high degree, with such enormous coefficients, I would expect a great deal of round-off error in any root calculation. (Defining, say, $s=2r$, and re-writing in terms of $s$, reduces coefficient bloat dramatically. However, the coefficients still get quite large in the midst of all those "$\cdots$"s.)


Here's an example taking $n = 15$ and $x = 0.5$.

To get $p_{16}$, I enter the following into Mathematica:

Factor[TrigExpand[Sin[15 m]/Sin[m]] /. {Sin[m] -> Sqrt[1 - Cos[m]^2]} /. {Cos[m] -> r}]

This calculates $p_{15}$ as $\sin(15 m)/\sin(m)$, expands the multiple-angle sine, re-writes resulting $\sin(m)$ factors in terms of $\cos(m)$, but then replaces those $\cos(m)$s with $r$s. This gives

$$\begin{align} p_{15}(r) &= (-1 + 4 r^2)(1 - 12 r^2 + 16 r^4)(1 - 96 r^2 + 416 r^4 - 576 r^6 + 256 r^8) \end{align}$$

As described above, I want to solve $p_{16}(r) - x = 0$. I'll let Mathematica do this numerically with NSolve:

NSolve[% == 0.5, r]

The resulting roots, the values of $r$, are:

$$\pm 0.979523, \pm 0.907724, \pm 0.820231, \pm 0.649587, \pm 0.525157, \pm 0.277076, \pm 0.138805$$

From here, we just use $(3)$ with some arbitrary constants $\lambda = 3$, $\Delta N = 5$ to get these values of $a$: $$7.41926, 6.75963, 6.2554, 5.52552, 5.08394, 4.30429, 3.89893 $$ $$3.10107, 2.69571, 1.91606, 1.47448, 0.744601, 0.240366, -0.419258$$ These are nowhere near the expected tiny values of $a$ that OP mentions in the comments. Perhaps I chose a bad $x$; perhaps I made some egregious error in my analysis; perhaps something else. I'll leave that to the reader to determine.


A hand-wavy observation: With $n$ (OP's $N$) being a couple of orders of magnitude larger than $\Delta N$ (OP states $1024$ vs $10$ or $20$), and with $a$ being tiny ($10^{-3}$ to $10^{-7}$), the denominator of OP's $X$ expression is the sine of very-nearly-zero; hence, the denominator itself is very-nearly-zero. For the value of $X$ to be constrained between $0$ and $1$ (or any reasonably-modest value), the numerator must also be comparably small; this requires that $\pi(1+a)\Delta N/\lambda$ must be very-nearly an integer multiple of $\pi$. That is, $(1+a)\Delta N/\lambda$ must be very-nearly an integer. Either $\Delta N/\lambda$ is so large as to overcome $a$'s tiny-ness, or else $\Delta N/\lambda$ is itself an integer. OP's suggested values of $\Delta N$, and the range for $\lambda$, seem to rule-out the first option; so: $\lambda$ must divide $\Delta N$. I suspect that OP doesn't intend this kind of dependency in those parameters. So, maybe the expectation that $a$ is tiny, or that $X$ is modest, needs to be dropped. Or maybe my hand-waving got a little too wavy. (I probably shouldn't be doing this kind of analysis when I'm tired.)