Matlab无法计算无限积分? [英] Matlab cannot compute an infinite integral?

查看:533
本文介绍了Matlab无法计算无限积分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究随机演算,有时我们需要为一些复杂的分布计算一个积分(从-无穷大到+无穷大).在这种情况下,是

I am studying Stochastic calculus, and occasionally we need to compute an integral (from -infinity to +infinity) for some complex distribution. In this case, it was

,答案在右侧.这是我放入Matlab中的代码(并且我有符号数学工具箱),而Matlab根本无法处理:

with the answer on the right. This is the code I put into Matlab (and I have the symbolic math toolbox), which Matlab simply cannot process:

>> syms x t
>> f = exp(1+2*x)*(1/((2*pi*t)^0.5))*exp(-(x^2)/(2*t))
>> int(f,-inf,inf)

ans =

-((2^(1/2)*pi^(1/2)*exp(2*t + 1)*limit(erf((2^(1/2)*((x*1i)/t - 2i))/(2*(-1/t)^(1/2))), x, -Inf)*1i)/(2*(-1/t)^(1/2)) - (2^(1/2)*pi^(1/2)*exp(2*t + 1)*limit(erf((2^(1/2)*((x*1i)/t - 2i))/(2*(-1/t)^(1/2))), x, Inf)*1i)/(2*(-1/t)^(1/2)))/(2*pi*t)^(1/2)

最后的答案似乎是胡说八道,而Wolfram(通过他们的免费工具)给了我上图所示的答案.我是否缺少在Matlab中进行此类基本的MathWorks页面无法涵盖的集成的基本知识?我在哪里进行错误的操作?

This answer at the end looks like nonsense, while Wolfram (via their free tool), gives me the answer that the picture above has. Am I missing something fundamental about doing such integrations in Matlab that the basic Mathworks pages don't cover? Where am I proceeding incorrectly?

推荐答案

为了解释正在发生的事情,我们需要一些理论:

In order to explain what is happening, we need some theory:

Matlab或Mathematica之类的符号系统通过 Risch算法来象征性地计算积分.就像导数一样,有一种机械地计算积分的方法.

Symbolic systems such as Matlab or Mathematica calculate integrals symbolically by the Risch algorithm (yes, there is a method to mechanically calculate integrals, just like derivatives).

但是,Risch算法的工作原理不同于使用推导规则.严格说来,它不是算法,而是半算法.这不是确定性的(就像算法一样).

However, the Risch algorithms works differently than using derivation rules. Strictly spoken, it is not an algorithm but a semi-algorithm. This is, it is not deterministic one (as algorithms are).

此(半)算法对输入表达式(要积分的一个)进行一系列转换,在特定点上,它需要询问转换后的表达式是否等于零,因为如果它为零,它无法继续(输入不能使用有限的一组术语进行积分).

This (semi) algorithm makes a series of transformations on the input expression (the one to be integrated), and in a specific point, it requires to ask if the transformed expression is equals to zero, because if it were zero, it cannot continue (the input is not integrable using a finite set of terms).

问题(以及半算法"的原因)是(显然简单的)方程:

The problem (and the reason of the "semi-algoritmicity") is that, the (apparently simple) equation:

E = 0

不可思议的(也称为

Is indecidable (it is also called the constant problem). It means that there cannot exist a formal method to solve the constant problem, for any expression E. Of course, we know to solve the constant problem for specific forms of the expression E (i.e. polynomials), but it is impossible to solve the problem for the general case.

这也意味着Risch算法不是完美的(能够求解有限积分中的任何积分).换句话说,Risch算法将具有与我们一样的能力,能够尽可能多地解决表达式E的形式常数问题,但是却没有解决一般情况的希望.

It also means that the Risch algorithm cannot be perfect (being able to solve any integral -integrable in finite terms-). In other words, the Risch algorithm will be as powerful as our ability to solve the constant problem for as many forms of the expression E as we can, but losing any hope of solving for the general case.

不同的符号系统具有相似但不同的方法来尝试求解方程式(因此也解决了常数问题),这解释了为什么其中某些符号系统可以求解"不同的积分集的原因.

Different symbolic systems have similar, but different methods to try to solve equations (and therefore the constant problem), it explains why some of them can "solve" different sets of integrals than others.

并且概括地说,因为没有符号系统永远无法解决一般情况下的常数问题,所以它也无法解决任何积分(有限项可积分).

And generalizing, because no symbolic system will never be able to solve the constant problem for the general case, it will neither be able to solve any integral (integrable in finite terms).

这篇关于Matlab无法计算无限积分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆