How can I plot this complex summation to infinity ?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Star Strider
am 25 Jul. 2019
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 Kommentare
Star Strider
am 25 Jul. 2019
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
am 25 Jul. 2019
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).
Siehe auch
Kategorien
Mehr zu Eigenvalue Problems finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!