I have the following simple nonlinear equations with two unknowns only:
$$\left\{ \begin{array}{c} \int_1^2{\dfrac{ e^{{a_1} x+{a_2} x^3}}{1+x^2}} \, dx=1 \\[13pt] \int_1^2{ x^2 e^{{a_1} x+{a_2} x^3}} \, dx=\dfrac{1}3 \\ \end{array} \right.$$
I understand it is almost impossible to obtain all the possible numerical solutions in the complex field $\mathbb{C}$. So any numerical complex solution per a specific given initial value with good enough accuracy would be OK.
By symbolic-numerical computation, it is easy to obtain one solution:
$$\left\{\quad \begin{array}{ccrcr} {a_1}&= & 2.083619981922075 &-& 2.163052112144277\; i \\ {a_2}&= & -0.144311264409679 &+& 1.206590594556891\; i \\ \end{array} \right.$$
However, I found it difficult to handle such a problem using the built-in integral functions in Matlab since such integral
and quadgk
functions as accept function handle
-form only integrands.
My try is first composing the nonlinear equations into user defined functions, then solve it per iteration algorithm (e.g. Newton's method) with a specific initial value), but when I tried to pass symbolic variables or global variables $a_1$, $a_2$, problems (error messages) would happen.
Though symbolic computation is possible to obtain a solution, it is too slow especially for more general nonlinear equations. Since the solution I need is only numerical one, I wonder:
Is it possible to solve such a problem by Matlab without using the symbolic computation? If the integral function has to accept symbolics $a_1$, $a_2$, how to handle it in Matlab (or C++)?
integral
and/orquadgk
without composing my own, but it seems impossible.integral
does not accept integrand with arguments to be determined. $\endgroup$ – user6043040 May 1 '16 at 5:32