Is there any way to solve this integration with loop?
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
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)
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)
4 件のコメント
Walter Roberson
2021 年 8 月 20 日
syms m t r positive
syms r__prime real
Pi = sym(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)
r_vec = 1:10;
t_vec = 1:10;
[R,T] = ndgrid(r_vec,t_vec);
V = subs(V_r_t, {r, t}, {R, T})
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 Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!