Is there any way to solve this integration with loop?

1 次查看(过去 30 天)
r = 1:10
t= 1: 10

采纳的回答

Walter Roberson
Walter Roberson 2021-8-19
Yes, you could replace the following symsum() with a loop that totaled over m
syms m t r positive
syms r__prime real
Pi = sym(pi)
Pi = 
π
V_r_t = symsum(exp(m*Pi*t)*sin(m*Pi*r)*int(r__prime*sin(m*Pi*r),r__prime,0,1),m,1,10)
V_r_t = 
  4 个评论
Walter Roberson
Walter Roberson 2021-8-20
syms m t r positive
syms r__prime real
Pi = sym(pi)
Pi = 
π
V_r_t = symsum(exp(m*Pi*t)*sin(m*Pi*r)*int(r__prime*sin(m*Pi*r),r__prime,0,1),m,1,10)
V_r_t = 
r_vec = 1:10;
t_vec = 1:10;
[R,T] = ndgrid(r_vec,t_vec);
V = subs(V_r_t, {r, t}, {R, T})
V = 
Reminder: sin(INTEGER*pi) is 0, and all of the terms of V_r_t have INTEGER*pi*r and all of your r are integer.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by