如何求解包含一个积分和 2 个参数的方程

发布于 2025-01-10 18:54:27 字数 224 浏览 0 评论 0原文

这是我想要求解的方程组的一个例子。 方程

a 和 b 的选择方式必须使这些积分的结果为 0。 但如果我不能像 Ax=b 这样写的话,我不知道

  • 如何与参数集成
  • 如何求解方程组。如果是这样我可以用 x = A\b 解决它

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挥剑断情 2025-01-17 18:54:27

假设您无法解析求解积分,则可以将 intsyms 结合使用来获取积分的表达式。

syms x a b;
f = a*(x-8)^3 + b*(x-6)^5;
F = int(f, 0, 1);

您可以通过 solve 找到其根

solve(F, [a b])

比较每个方程的根会告诉您是否存在可以求解方程的 ab

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.

西瑶 2025-01-17 18:54:27

积分是线性的,因此可以立即提取参数。您的示例中有 a * I1 + b * I2 = 0a * I3 + b * I4 = 0,其中 I1 是(x-8)^3 的从 0 到 1 的积分等。

这种情况下的被积函数是平凡多项式(即使在 u 替换后也是单项式)。您可以轻松地手动计算积分,尽管这里很简单,只需观察所有积分都必须非零。因此,您得到了 A * [a, b]' = 0 形式的一般线性系统,其中 A 中的所有条目均非零。除了退化系统(本例不是)之外,唯一的解决方案是a = b = 0

一般来说,假设右侧有可能非零,您将使用相同的想法。将积分分布在参数上,得到一个方程组,其中参数乘以常数(非参数化积分的值)。通过分析或数值方式评估积分。如果方程组的参数始终是线性的,则以通常的方式求解所得方程组,只需使用 A \ rhs 即可。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文