如何在Matlab中计算此无限和? [英] how do I compute this infinite sum in matlab?

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

问题描述

对于给定的x和tau,我想在Matlab中计算以下无限和:

I want to compute the following infinite sum in Matlab, for a given x and tau:

在x = 0.5和tau = 1的情况下,我尝试了以下代码:

I tried the following code, given x=0.5 and tau=1:

symsum((8/pi/pi)*sin(n*pi*0.5)*sin(n*pi*0.5)*exp(-n*n*pi*pi)/n/n,1,inf)

但是我明白了:

(228155022448185*sum((exp(-pi^2*n^2)*((exp(-(pi*n*i)/2)*i)/2 - (exp((pi*n*i)/2)*i)/2)^2)/n^2, n == 1..Inf))/281474976710656

假设总和收敛,我想要一个明确的值.我究竟做错了什么?当返回符号求和结果时,Matlab似乎不计算exp().如何告诉Matlab计算指数值?

I want an explicit value, assuming the sum converges. What am I doing wrong? It seems like Matlab doesn't compute exp() when returning symsum results. How do I tell Matlab to compute evaluate the exponentials?

推荐答案

转换为两倍

double(symsum(...))

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

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