'Matlab: How to solve an equation which contains an integral and 2 parameters
this is an example of a system of equations which I would like to solve. equations
a and b must be selected in such a way that the results of these integrals are 0. But I don't know
- how to integrate with parameters
- how to solve a system of equations if I can't write it like Ax=b. If so I could solve it with x = A\b
Thank you very much.
Solution 1:[1]
Assuming you can't solve the integrals analytically, you can use int with syms to get an expression of the integrals.
syms x a b;
f = a*(x-8)^3 + b*(x-6)^5;
F = int(f, 0, 1);
which you can find the roots of by solve
solve(F, [a b])
Comparing the roots for each equation would tell you if there is an a and b that solves the equations.
Solution 2:[2]
Integration is linear, so the parameters can immediately just be pulled out. You have a * I1 + b * I2 = 0 and a * I3 + b * I4 = 0 in your example, where I1 is the integral from 0 to 1 of (x-8)^3, etc.
The integrands in this case are trivial polynomials (monomials even after u-substitution). You can easily evaluate the integrals by hand, though it's simple here to just observe that all must be nonzero. Hence you've got a general linear system of the form A * [a, b]' = 0 with all the entries in A nonzero. Aside from a degenerate system (which this case isn't), then the only solution is a = b = 0.
In general, assuming you have the possibility of a nonzero right-hand side, you'll use the same idea. Distribute the integration over the parameters, getting a system of equations with parameters being multiplied by constants that are the values of the non-parameterized integrals. Evaluate the integrals, either analytically or numerically. Solve the resulting system of equations in the usual way, with just A \ rhs if the system is always linear in the parameters.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | bg2b |
