필터 지우기
필터 지우기

need halp with simbolic summation?

조회 수: 1 (최근 30일)
d
d 2016년 12월 6일
댓글: Karan Gill 2016년 12월 8일
I solved the laplace equation and I got a discrete vector of coefficients (A_n) with 100 coefs (n=100)
now the solution is looking like this:
U(i,j)=sum(An.*cosh((pi/b*(1/2+n))*z(j)).*sin((pi/b*(1/2+n))*(x(i)-b)));
where x,z are the coordinates and n is the index
now I need to plot it. the straight forward method would be to calculate the sum in each coordinate, using two for loops
for i=1:length(x)
for j=1:length(z)
U(i,j)=sum(An.*cosh(Ln*z(j)).*sin(Ln*(x(i)-b)));
end
end
I dont want to use repmat tools because x,z can get very large and I also want to check for larger n (n=1000, n=10000) so it will consume too much memory.
Is there a different way to do it? I thought maybe to use symbolic? but I dont know how to use symbolic symsum when A_n is a vector and not an expression.
I tried this:
syms x z b
b=0.3;
U=symsum(An(n).*cosh((pi/b*(1/2+n))*z).*sin((pi/b*(1/2+n))*(x-b)), i, 1, 10);
but it didn't work. any suggestions?
  댓글 수: 1
Karan Gill
Karan Gill 2016년 12월 8일
You already have numeric data. Why are you going to symbolic? You are supposed to go the other way. I'd recommend finding a way to optimize your numeric calculations.

댓글을 달려면 로그인하십시오.

답변 (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