How to make a surface plot involving an infinite series

In summary, to create a surface plot involving an infinite series in Matlab, you need to find the margin of error you are comfortable with, find the value of n that you need to get sums below that margin of error, sum up to for your chosen range of x values to get your chosen degree of error, and put the partial sum into a computer algebra system or write a program to get the function's approximate values and plot them.
  • #1
pr0me7heu2
14
2
How to make a surface plot involving an infinite series in Matlab

Solving Laplace's equation for electric potential for a 2D surface yields:

V(x,y) = 4 Vo/pi * Ʃ (n=1,3,5,...) (1/n e^(-npi*x/a) sin(n*pi*y/a)

,where a is and Vo are constants

...it's convoluted, but basically, I need to plat the value V over the x,y plane and V is defined by an infinite series
 
Last edited:
Physics news on Phys.org
  • #2
Infinite series, when they converge, are calculated from their partial sums. What you would do is first choose the margin of error you are comfortable with, then find the value of n that you need to get sums below that margin of error. You can find bounds for your error by using various comparisons.
For example, the value of sine is between -1 and 1, so the magnitude of each term of the sum is bounded by 1/(ne^(npix/a)) independently of the value of y. The ratio test on this comparison series shows that this series is guaranteed to converge only when x/a is positive, so the original series does as well. Borrowing from the integral test, since this series is monotone decreasing, we know its partial sum up to n = m is bounded by
[tex]4 \frac{V_0}{\pi e^{\pi \frac{x}{a}}} + \int_1^m \frac{dt}{t e^{t \pi \frac{x}{a}}}[/tex]
The error of the partial sum is then bounded by the partial sum of absolute values minus this term, since the true value of the series lies between. You will, of course, want a computer to do these calculations. You may also have better ideas for tighter comparisons.
Once you have the value of n you need to sum up to for your chosen range of x values to get your chosen degree of error, you would then put the partial sum into a computer algebra system or write a program to get the function's approximate values and plot them. If you have Mathematica, for example, here is an example of plotting a 1-dimensional series.
 
  • #3
If you can use the symbolic tools in Matlab you might find the following:

(note: the following is using Mathematica notation so you will have to translate it)

In[1]:= Simplify[4Vo/Pi Sum[1/(2n+1)E^-((2n+1)Pi x/a)Sin[(2n+1)Pi y/a],{n,0,Infinity}]]

Out[1]= ((2*I)*Vo*(-ArcTanh[E^(-((Pi*(x - I*y))/a))] + ArcTanh[E^(-((Pi*(x + I*y))/a))]))/Pi

If you choose constant values for Vo and a and discard the very tiny complex component left over after doing that calculation for particular x and y and handle the places where this goes to infinity then you should be able to get yourself a plot.

Test all this carefully before you depend on it.
 
  • #4
I didn't know Mathematica was that powerful of a symbolic simplifier. Very nice! =D Although you must still check for possible errors: there is an entire newsgroup that constantly comes up with oddball bugs in Mathematica's algorithms.
 
  • #5
I thought it would be as simple as:

>> syms V0 n x y a
>> for i=1:2:inf;
i=n;
s=1/n*exp(-n*pi*x/a)*sin(n*pi*y/a);
end
f=4*V0/pi*s;
ezsurf(f)

but this returns nothing; no error nothing.

This is more for personal enrichment, rather than a class... unless someone else comes by and posts some suggestions, I'll give an update when I figure this out over the next few days.
 
Last edited:
  • #6
The easiest way to do it is:

syms x y n
v=4/pi*symsum(1/(2*n+1)*exp(-(2*n+1)*pi*x)*sin((2*n+1)*pi*y),n,0,100);
ezsurf(v)

https://docs.google.com/file/d/0B56mzK7jKc5ebE9nYlNVMUhuWVk/edit?usp=sharing



...still trying to work out complex errors if I try to do this without symbolic toolbox.
 

Related to How to make a surface plot involving an infinite series

1. What is a surface plot involving an infinite series?

A surface plot involving an infinite series is a visual representation of an infinite series of numbers on a three-dimensional surface. It is used to illustrate the behavior and patterns of the series as it approaches infinity.

2. How do I create a surface plot involving an infinite series?

To create a surface plot involving an infinite series, you will need to use a mathematical graphing software or programming language. First, define the formula for the series and then input the values into the software to generate the surface plot.

3. What are some common applications of surface plots involving infinite series?

Surface plots involving infinite series have various applications in mathematics, engineering, and physics. They can be used to analyze and predict the behavior of complex systems, such as electric fields, fluid dynamics, and financial markets.

4. How can I interpret a surface plot involving an infinite series?

Interpreting a surface plot involving an infinite series requires understanding the behavior of the series. A steep slope indicates a large change in the series, while a flatter slope indicates a smaller change. The direction of the slope can also indicate whether the series is increasing or decreasing.

5. Are there any limitations to using surface plots involving infinite series?

While surface plots involving infinite series can be a useful tool for visualizing and understanding complex data, they are limited by their ability to accurately represent an infinite number of data points. Additionally, they may not be suitable for series with irregular or non-convergent patterns.

Similar threads

  • General Math
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
310
  • Calculus and Beyond Homework Help
Replies
3
Views
339
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
4K
  • Advanced Physics Homework Help
Replies
3
Views
1K
  • Topology and Analysis
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
Back
Top