Is there any way to solve this integration with loop?
1 view (last 30 days)
Show older comments
Bajdar Nouredine
on 19 Aug 2021
Commented: Bajdar Nouredine
on 23 Aug 2021
r = 1:10
t= 1: 10
0 Comments
Accepted Answer
Walter Roberson
on 19 Aug 2021
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 Comments
Walter Roberson
on 20 Aug 2021
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.
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!