COMPUTING FOURIER COEFFICIENTS AND FOURIER SERIES WITH MATHEMATICA

Similar documents
Lecture 2 Mathcad Basics

CGN Computer Methods

LAYOUT OF THE KEYBOARD

xn. x must be written as x^(2n) and NOT as x^2n. Writing x^2n means 4x y would be written as 4 x^2 y^3 or with the multiplication mark as 4*x^2*y^3.

Overview. Essential Questions. Precalculus, Quarter 4, Unit 4.5 Build Arithmetic and Geometric Sequences and Series

4.1. Title: data analysis (systems analysis) Annotation of educational discipline: educational discipline includes in itself the mastery of the

By Clicking on the Worksheet you are in an active Math Region. In order to insert a text region either go to INSERT -TEXT REGION or simply

Click on the links below to jump directly to the relevant section

Updates to Graphing with Excel

Microsoft Excel Tutorial

0 Introduction to Data Analysis Using an Excel Spreadsheet

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes

Part 1: Background - Graphing

Section IV.1: Recursive Algorithms and Recursion Trees

Quick Tour of Mathcad and Examples

PLOTTING DATA AND INTERPRETING GRAPHS

Integrating with Mathematica

Using the Equation Editor

Scientific Graphing in Excel 2010

Euler s Method and Functions

Creating tables of contents and figures in Word 2013

Graphic Designing with Transformed Functions

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

CSC 120: Computer Science for the Sciences (R section)

Select the Crow s Foot entity relationship diagram (ERD) option. Create the entities and define their components.

Gerrit Stols

Step 2: Headings and Subheadings

Graphic Designing with Transformed Functions

MATH 140 Lab 4: Probability and the Standard Normal Distribution

Excel Basics By Tom Peters & Laura Spielman

Working with Tables: How to use tables in OpenOffice.org Writer

GeoGebra. 10 lessons. Gerrit Stols

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions.

Solving simultaneous equations using the inverse matrix

Person Inquiry Screen

Creating, Solving, and Graphing Systems of Linear Equations and Linear Inequalities

Convolution. The Delta Function and Impulse Response

Irrational Numbers. A. Rational Numbers 1. Before we discuss irrational numbers, it would probably be a good idea to define rational numbers.

CATIA Basic Concepts TABLE OF CONTENTS


Instructions for Formatting APA Style Papers in Microsoft Word 2010

DRAFT. Further mathematics. GCE AS and A level subject content

Excel Level Two. Introduction. Contents. Exploring Formulas. Entering Formulas

Excel & Visual Basic for Applications (VBA)

Curve fitting How to. Least squares and linear regression. by W. Garrett Mitchener

Using Formulas, Functions, and Data Analysis Tools Excel 2010 Tutorial

Draw pie charts in Excel

Formatting Text in Microsoft Word

ab = c a If the coefficients a,b and c are real then either α and β are real or α and β are complex conjugates

2. Select Point B and rotate it by 15 degrees. A new Point B' appears. 3. Drag each of the three points in turn.

The one dimensional heat equation: Neumann and Robin boundary conditions

1 Solving LPs: The Simplex Algorithm of George Dantzig

USING EXCEL ON THE COMPUTER TO FIND THE MEAN AND STANDARD DEVIATION AND TO DO LINEAR REGRESSION ANALYSIS AND GRAPHING TABLE OF CONTENTS

The following is an overview of lessons included in the tutorial.

Computational Mathematics with Python

2 Session Two - Complex Numbers and Vectors

Math Journal HMH Mega Math. itools Number

28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. v x. u y v z u z v y u y u z. v y v z

Maple Quick Start. Introduction. Talking to Maple. Using [ENTER] 3 (2.1)

Chapter 7: Additional Topics

Imaging Systems Laboratory II. Laboratory 4: Basic Lens Design in OSLO April 2 & 4, 2002

Gestation Period as a function of Lifespan

Microsoft Excel Basics

Formulas, Functions and Charts

The Heat Equation. Lectures INF2320 p. 1/88

Microsoft Excel 2010 Charts and Graphs

Getting Started with Excel Table of Contents

Doing Multiple Regression with SPSS. In this case, we are interested in the Analyze options so we choose that menu. If gives us a number of choices:

Microsoft Excel 2010 Part 3: Advanced Excel

Commonly Used Excel Functions. Supplement to Excel for Budget Analysts

Session 7 Fractions and Decimals

The right edge of the box is the third quartile, Q 3, which is the median of the data values above the median. Maximum Median

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

Intermediate PowerPoint

Excel 2007: Basics Learning Guide

Review of Fundamental Mathematics

MATH 60 NOTEBOOK CERTIFICATIONS

What is a piper plot?

A Guide to Using Excel in Physics Lab

F.IF.7b: Graph Root, Piecewise, Step, & Absolute Value Functions

VHDL Test Bench Tutorial

MATH2210 Notebook 1 Fall Semester 2016/ MATH2210 Notebook Solving Systems of Linear Equations... 3

Scatter Plots with Error Bars

Computational Mathematics with Python

Grade 6 Mathematics Performance Level Descriptors

Measurement with Ratios

Client Search. Searching For Clients With or Without Addresses

Excel Formulas & Graphs

A Concrete Introduction. to the Abstract Concepts. of Integers and Algebra using Algebra Tiles

Computational Mathematics with Python

2. A tutorial on notebooks

VIDEO SCRIPT: Data Management

An Introduction to Mathcad

PGR Computing Programming Skills

Curve Fitting, Loglog Plots, and Semilog Plots 1

Bar Charts, Histograms, Line Graphs & Pie Charts

Petrel TIPS&TRICKS from SCM

Introduction to Microsoft Excel 2010

Adding and Subtracting Positive and Negative Numbers

Trigonometry Review with the Unit Circle: All the trig. you ll ever need to know in Calculus

Transcription:

COMPUTING FOURIER COEFFICIENTS AND FOURIER SERIES WITH MATHEMATICA Below is a short Mathematica program that computes Fourier coefficients and series for any function that is 2 L periodic and satisfies the Dirichlet conditions. Please go through this program carefully; it will help you learn many useful Mathematica and programming tools. I will imbed some comments in the program. Also, please remember Mathematica has a very good Documentation Center that you can access by clicking on "Help" on the Mathematica toolbar. The program below computes the Fourier series and Fourier coefficients for the step wise function used in Example 1, p. 353 of Boas. The program :

2 phys301fouriercomputations.nb In[58]:= Clear function, limits, a0, a, b, fourierseries, variable, lowerlimit, upperlimit limits variable, lowerlimit, upperlimit ; The statement above allows me to define the array used in the 'Integrate' command. variable x; upperlimit ; lowerlimit ; I define the piecewise function, f x,using the 'Which' command: function x_ : Which x 0, 0, 0 x,1 The next three statements compute the Fourier coefficients. I can make evaluation of the coefficients easier indicating we are interested only in integer values of n. Refer to the Documentation Center to read about the 'Assumptions' command. Please see section after the output to learn how to make special symbols like. a0 Integrate function x, limits ; a n_ : a n Integrate function x Cos n x, limits, Assumptions n Integers b n_ : b n Integrate function x Sin n x, limits, Assumptions n Integers Notice that I defined a n and b n as functions of n. Having had some experience with programs like this, I knew it would be important to make use of the 'trick' we learned in lab while investigating Fibonacci numbers. We have now computed the Fourier coefficients. The statement below uses the computed coefficients to produce a Fourier series. fourierseries a0 2 Sum a n Cos n x b n Sin n x, n, 1, 21 ; Now we produce output. The first output line will print out the explicit terms in the Fourier series out to n 21. Expand fourierseries Next, we plot two curves on the same set of axes. I define the curves as the variables g1 and g2. The first curve is the plot of the Fourier series. The second curve is the plot of the original function defined via a 'Which' statement. In order to distinguish the two overlapping curves, I use 'PlotStyle' to draw the piecewise function in a different font format. Refer to the Documentation Center for more information on 'Tooltip'. g1 Plot Tooltip a0 2 Sum a n Cos n z b n Sin n z, n, 1, 21, z,, ; g2 Plot Tooltip function x, x,,, PlotStyle Thick, Red, Dashed ; Show g1, g2

phys301fouriercomputations.nb 3 Out[66]= 1 2 2 Sin x 2 Sin 3 x 2 Sin 5 x 2 Sin 7 x 2 Sin 9 x 3 5 7 9 2 Sin 11 x 2 Sin 13 x 2 Sin 15 x 2 Sin 17 x 2 Sin 19 x 2 Sin 21 x 11 13 15 17 19 21 1.0 0.8 Out[69]= 0.6 0.4 0.2-3 -2-1 1 2 3

4 phys301fouriercomputations.nb Notes on creating special characters with Mathematica : You would expect that a mathematical software platform would provide a fairly easy way to write the array of special symbols used in math and physics. Find the  key on your computer. You will be using it a lot. One common pattern for most of these special symbols is Âcode When you hit the  key on your computer, Mathematica will produce three vertical dots : Ç (That might be hard to see, but just hit the  key and see what happens.) Now if you want to type Greek letters, try typing ÂaÂ. You should get lower case Greek a. You can experiment with both upper and lower cases. Below are the codes for some of the mathematical symbols we will use frequently this semester : Integration sign : Âint Partial derivative : ÂpdÂ Ø Del operator : Âdel Ø! Infinity : ÂinfÂ Ø Summation : Âsum Pi : ÂpÂ Ø p Element : ÂelÂ Ø œ Escape key :  escâ Ø Â (Make sure that you leave a space between the first Ç and the ' e') Contour Integral : Âcint From physics : ÂhbÂ Ø Ñ (hbar from quantum mechanics) ÂAngÂ Ø Þ (the Þngstrom unit of length) Logical operators Or : Â Â Ø And :  && Â Ø For all : ÂfaÂ Ø " Exists : ÂexÂ Ø $ Another technique to produce these characters uses the format : \[code] If you type in ' Euro' in the place of code you get : Yen : And finally, some silly stuff : Ã Õ Œ œ Ł

phys301fouriercomputations.nb 5 If you type ' special characters' into the search bar on the documentation center, you will find many links to hundreds if not thousands of these symbols.