HW1, EECS 207A, FALL 207A.

UCI.

 

By Nasser Abbasi

 

HW1 questions are here.

 

Problem 1

 

For first problem in HW1, I solved it by writing a program in MAPLE and also in Mathematica.

I show here the solution and the output. I picked N (number of terms as some arbitrary number, since the problem did not specify the number of terms for the fourier series coefficients.

The output shows as N increases we get better approximation to f(x), which is the function are are trying to represent in terms of sums of fourier series expansion.

 

Mathematica solution

 

The Mathematica notebook is here. The HTML output of running the Mathematica program is here.

 

Maple solution

 

The MAPLE worksheet is here. The HTML output of running the Maple program is here.

 

 

Problem 2

I worte a small prodcedures in Mathematica and in Maple to solve this.

 

Maple solution:

The maple worksheet is here.

The HTML output showing the values is here.

 

Mathematica solution

Notebook is here.

HTML output in here.

 

Matlab solution

Here is a solution using matlab as well. This is the m file.

 

Put the m file in your matlab path, and run as below. This below shows the output.

 

>> nma_HW1

x                               f(x)

1.500000,       0.785643

5.900000,       -0.784740

6.300000,       0.793942

-0.600000,      -0.784957

>>