How can I find the closest possible answer to a system of equations?

70 Views Asked by At

Say I have two equations, $$\frac{y}{1+e^{-.6x}}=6.9$$ and $$\frac{y}{1+e^{-.1x}}=4$$ These two equations don't have a direct solution for $x$ and $y$. Is it possible for me to find which values for $x$ and $y$ would be closest to a correct answer? Thanks for your help!

1

There are 1 best solutions below

0
On BEST ANSWER

First, let $x=-10 \log(t)$ and consider the norm $$\Phi=\Bigg[\frac{y}{t^6+1}-\frac {69}{10}\Bigg]^2+\Bigg[\frac{y}{t+1}-4\Bigg]^2$$ that you want to minimize to have the "most probable" values of $(t,y)$. Compute the partial derivatives $$\frac{\partial \Phi}{\partial t}=-\frac{12 t^5 y \left(\frac{y}{t^6+1}-\frac{69}{10}\right)}{\left(t^6+1\right)^2}-\frac{2 y \left(\frac{y}{t+1}-4\right)}{(t+1)^2}=0\tag1$$ $$\frac{\partial \Phi}{\partial y}=\frac{2 \left(\frac{y}{t^6+1}-\frac{69}{10}\right)}{t^6+1}+\frac{2 \left(\frac{y}{t+1}-4\right)}{t+1}=0\tag 2$$

From $(2)$ $$y=\frac{\frac{69}{5 \left(t^6+1\right)}+\frac{8}{t+1}}{\frac{2}{\left(t^6+1\right)^2}+\frac{2}{(t+1)^2}}=\frac{(t+1) \left(t^6+1\right) \left(40 t^6+69 t+109\right)}{10 \left(t^{12}+2 t^6+t^2+2 t+2\right)}\tag 3$$ Plug $y$ in $(1)$ and simplify. You will obtain $$\frac{\left(5 t^6+6 t^5-1\right) \left(40 t^6+69 t+109\right) \left(69 t^6-40 t+29\right)}{50 \left(t^{12}+2 t^6+t^2+2 t+2\right)^2}=0$$

  • no real root for the denominator.
  • $5 t^6+6 t^5-1=0$ shows two real roots but one will need to be discarded since negative
  • $40 t^6+69 t+109=0$ does not show any real root.
  • $69 t^6-40 t+29=0$ does not show any real root.

So, the only solution is $$t=0.641465469828846632566048\cdots$$ from which $$x=4.4399992361 \qquad \text{and} \qquad y=7.1378283305$$

This would give for the rhs $6.673$ instead of $6.9$ and $4.348$ instead of $4$.

Warning

Take care that the result depends on the manner the equations are written. For example, writing

$$\frac 1{6.9}\frac{y}{1+e^{-0.6x}}=1\qquad \text{and} \qquad \frac 1{4}\frac{y}{1+e^{-0.1x}}=1$$ (what I would prefer) would lead to $$x=4.4399992361 \qquad \text{and} \qquad y=6.9258416709$$

which, in turn, will give for the rhs $6.475$ instead of $6.9$ and $4.219$ instead of $4$. Better distribution of the errors.

Edit

The sextic equation $$5 t^6+6 t^5-1=0$$ is very simple to solve since, for $0 < t <1$ $$11t^6-1< 5 t^6+6 t^5-1 \lt 11t^5-1$$ which makes $$\frac{1}{\sqrt[5]{11}} < t <\frac{1}{\sqrt[6]{11}}$$

Taking into account Darboux theorem, start Newton iterations at the upper bound and obtain the following iterates $$\left( \begin{array}{cc} n & t_n \\ 0 & 0.67055522742173084177 \\ 1 & 0.64410762356249574439 \\ 2 & 0.64148915743444376281 \\ 3 & 0.64146547174905324637 \end{array} \right)$$