How would you write this equation in Matlab?
1 次查看(过去 30 天)
显示 更早的评论
This is a Heat Transfer Equation, but I'm not sure how to make it work in Matlab. I need to obtain at least 8 values from theta.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1308100/image.png)
0 个评论
回答(1 个)
Walter Roberson
2023-2-26
Pi = sym(pi);
syms L x y W
syms n integer
syms UpperBound
assume(n >= 1);
part1 = ((-1)^(n+1) + 1)/n;
part2 = sin(n*Pi*x/L);
part3 = sinh(n*Pi*y/L) / sinh(n*Pi*W/L);
theta(x,y) = 2/Pi * symsum(part1 * part2 * part3, n, 1, UpperBound)
%example
example = simplify(subs(theta, {L, W, UpperBound}, {10, 3, 15}), 'steps', 10)
vpa(example, 5)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Number Theory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!