matlab - 比较具有不同积分网格大小的数值结果 (MATLAB)

标签 matlab grid integration

我正在尝试使用 Matlab 的 integral 比较复数积分的数值结果。

特别是,我想使用

检查结果的准确性
  • 一个固定的积分区间[0,T],
  • 但不同的稀疏度或积分网格大小。

在使用 Matlab 的 integral 时,有没有办法指定积分网格大小(即:等距网格点的数量)?还是我应该寻找其他选择?

最佳答案

Is there a way to specify integration grid sizes (i.e.: number of equally spaced grid points) when using MATLAB's integral?

简短回答:否。

documentation说你只能输入:

q = integral(fun,xmin,xmax,Name,Value) specifies additional options with one or more Name,Value pair arguments. For example, specify 'WayPoints' followed by a vector of real or complex numbers to indicate specific points for the integrator to use.

因此,我们向下滚动一点并读取允许的名称/值对并找到:

  • 'AbsTol',绝对容错
  • 'RelTol', 相对误差容限
  • 'ArrayValued',数组值函数标志
  • 'Waypoints',整合航点

MATLAB 会自动优化积分并进行数值计算(当然),这会因给定错误而结束,错误由 'AbsTol''RelTol' 定义。我会同意的。

如果您确实想要指定积分步长,您可以检查如果将 'Waypoints' 指定为 [0:1/(100*T):T] 会发生什么情况。不过,我会自己集成它,使用一个简单的黎曼求和实现。

关于matlab - 比较具有不同积分网格大小的数值结果 (MATLAB),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33646965/

相关文章:

matlab - 使用 Ransac 的仿射模型

matlab - 创建两个不同随机整数的优雅方式

forms - Yii2 保存多种模型的表单

eclipse - Gradle Integration for Eclipse 守护程序启动失败

mercurial - 是否有与Mercurial集成的错误/问题跟踪系统?

matlab - 尝试将脚本作为函数执行

matlab - 我们可以拥有比 MATLAB 内核数量更多的 worker 吗?

java - 更改列名称 - Vaadin 7.8.4

javascript - 为什么 Meteor 会这样渲染 grid html?

grails - "Could not find ApplicationContext, configure Grails correctly first"