How can I plot this complex summation to infinity ?
7 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I'm new to Matlab but am trying to plot a curve in accordance with the following equation:

Where E_n and D_n are solved as follows:


If someone was able to suggest how I might go about achieving this, or point me in the direction of a good resource so I may learn, that would be brilliant. Thank you!
0 个评论
回答(1 个)
Star Strider
2019-7-25
You can’t.
Use meshgrid or ndgrid to calculate the ‘x’ and ‘t’ matrices. (You will have to have them as matrices for your function to work.)
You don’t need to do an infinite sum. Instead, use a while loop to stop when the value of ‘T(x,t)’ is no longer changing between iterations.
Example (sine series):
x = pi/9;
n = 0;
S = 0;
Sp = Inf;
err = 1;
while err > 1E-8
S = S + ((-1)^n)/factorial(2*n+1) * x^(2*n+1)
err = abs(S - Sp);
Sp = S;
n = n + 1;
end
That produces a decent approximation, and converges in a few iterations (depending on the threshold set for ‘err’). Since your function will return a matrix, you will have to write your loop to recognise that, and calculate ‘err’ (in this example, call it what you like in your code) correctly.
8 个评论
Star Strider
2019-7-25
Tom Coates’s Answer moved here —
I didn’t realise such a program existed, I’ve been trying to solve it analytically myself. I’ll check that out, thanks :)
Star Strider
2019-7-25
My pleasure.
Examples —
How To Solve a Partial Differential Equation (Wolfram Alpha)
That is the only online symbolic solver I can find. I don’t know if Maple has that capability.
A MATLAB numeric approach: Partial Differential Equations as well as the Partial Differential Equation Toolbox, although none give symbolic solutions. Again, if yur PDE is amenable to using Laplace transforms, the Symbolic Math Toolbox can do that (although you will need to help it along if you use Laplace transforms).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Eigenvalue Problems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!