Computer Projects 2 - Linear Algebra | MATH 2270, Study Guides, Projects, Research of Linear Algebra

Material Type: Project; Class: Linear Algebra; Subject: Mathematics; University: University of Utah; Term: Spring 2002;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 08/31/2009

koofers-user-wy5
koofers-user-wy5 ๐Ÿ‡บ๐Ÿ‡ธ

5

(3)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Computer Project II๎˜Š
Math 2270-1, April 2002๎˜Š
๎˜Š
In the first part of this project, you will compute have MAPLE (or whichever computing environment
you prefer) compute some Fourier coefficients for various functions. This could be quite useful, for
instance, if you ever want to do some signal proccessing. Below I have the an inner product suited to
Fourier series and some of the appropriate functions typed in. You should fill in the blanks where they
occur.
> restart:with(plots):๎˜Š
dotprod := (f,g) -> int(f(t) * g(t), t = -Pi..Pi);
Warning, the name changecoords has been redefined๎˜Š
:= dotprod โ†’( ),f g d
โŒ 
โŒก
๏ฃต
๏ฃต
โˆ’ฯ€
ฯ€
( )f t ( )g t t
> f_1 := t ->(1/sqrt (Pi)) * cos (t): ๎˜Š
f_2 := t ->(1/sqrt (Pi)) * cos (2*t):๎˜Š
f_3 := t ->(1/sqrt (Pi)) * cos (3*t):๎˜Š
f_4 := t ->(1/sqrt (Pi)) * cos (4*t):๎˜Š
f_5 := t ->(1/sqrt (Pi)) * cos (5*t):๎˜Š
f_0 := t ->1/sqrt(2*Pi):
> g_1 := t ->(1/sqrt(Pi)) * sin (t):๎˜Š
g_2 := t ->(1/sqrt(Pi)) * sin (2*t):๎˜Š
g_3 := t ->(1/sqrt(Pi)) * sin (3*t):๎˜Š
g_4 := t ->(1/sqrt(Pi)) * sin (4*t):๎˜Š
g_5 := t ->(1/sqrt(Pi)) * sin (5*t):
These functions above are the first 11 elements of the orthonormal basis we found for this inner
product we are using. ๎˜Š
๎˜Š
(1) Have MAPLE (or whichever program you are using) verify that f_1 and g_1 are perpendicular.๎˜Š
๎˜Š
(2) Have MAPLE (or whatever) verify that f_1 and f_2 are perpendicular.๎˜Š
๎˜Š
(3) Have MAPLE (or whatever) verify that f_1 and g_1 are unit length.๎˜Š
๎˜Š
(4) Have MAPLE (or whatever) plot f_1, f_2, g_1 and g_2 on the same set of axes so you can look at
them.
> h := t -> t^2;
:= hโ†’t t2
> ๎˜Š
Now we will compute a truncated Fourier series for this function h. Below you will do the same
thing for other functions.
> a_0 := dotprod (f_0,h);๎˜Š
a_1 := dotprod (f_1,h);๎˜Š
a_2 := dotprod (f_2, h);๎˜Š
a_3 := dotprod (f_3,h);๎˜Š
a_4 := dotprod (f_4,h);๎˜Š
a_5 := dotprod (f_5, h);
pf3

Partial preview of the text

Download Computer Projects 2 - Linear Algebra | MATH 2270 and more Study Guides, Projects, Research Linear Algebra in PDF only on Docsity!

Computer Project II Math 2270-1, April 2002

In the first part of this project, you will compute have MAPLE (or whichever computing environment you prefer) compute some Fourier coefficients for various functions. This could be quite useful, for instance, if you ever want to do some signal proccessing. Below I have the an inner product suited to Fourier series and some of the appropriate functions typed in. You should fill in the blanks where they occur.

restart:with(plots): dotprod := (f,g) -> int(f(t) * g(t), t = -Pi..Pi); Warning, the name changecoords has been redefined

dotprod :=( f g , )โ†’ d

โˆ’ฯ€

ฯ€ f t ( ) g t ( ) t

f_1 := t ->(1/sqrt (Pi)) * cos (t): f_2 := t ->(1/sqrt (Pi)) * cos (2t): f_3 := t ->(1/sqrt (Pi)) * cos (3t): f_4 := t ->(1/sqrt (Pi)) * cos (4t): f_5 := t ->(1/sqrt (Pi)) * cos (5t): f_0 := t ->1/sqrt(2Pi): g_1 := t ->(1/sqrt(Pi)) * sin (t): g_2 := t ->(1/sqrt(Pi)) * sin (2t): g_3 := t ->(1/sqrt(Pi)) * sin (3t): g_4 := t ->(1/sqrt(Pi)) * sin (4t): g_5 := t ->(1/sqrt(Pi)) * sin (5*t): These functions above are the first 11 elements of the orthonormal basis we found for this inner product we are using.

(1) Have MAPLE (or whichever program you are using) verify that f_1 and g_1 are perpendicular.

(2) Have MAPLE (or whatever) verify that f_1 and f_2 are perpendicular.

(3) Have MAPLE (or whatever) verify that f_1 and g_1 are unit length.

(4) Have MAPLE (or whatever) plot f_1, f_2, g_1 and g_2 on the same set of axes so you can look at them.

h := t -> t^2;

h := t โ†’ t^2

Now we will compute a truncated Fourier series for this function h. Below you will do the same thing for other functions.

a_0 := dotprod (f_0,h); a_1 := dotprod (f_1,h); a_2 := dotprod (f_2, h); a_3 := dotprod (f_3,h); a_4 := dotprod (f_4,h); a_5 := dotprod (f_5, h);

a_0 :=

2 ฯ€

( 5 / 2 )

a_1 :=โˆ’ 4 ฯ€ a_2 := ฯ€

a_3 :=โˆ’

ฯ€

a_4 :=

ฯ€

a_5 :=โˆ’

ฯ€

These are the first six even Fourier coefficients for h.

b_1 := dotprod (g_1,h); b_2 := dotprod (g_2,h); b_3 := dotprod(g_3,h); b_4 := dotprod (g_4,h); b_5 := dotprod (g_5,h); b_1 := 0 b_2 := 0 b_3 := 0 b_4 := 0 b_5 := 0 These are the first five odd Fourier coefficients for h. You could have predicted that they would all be zero (why?). H := t -> a_0* f_0(t) + a_1f_1(t) + a_2f_2(t) + a_3f_3(t) + a_4f_4(t) + a_5f_5(t) + b_1g_1(t) + b_2g_2(t) + b_3g_3(t) + b_4g_4(t) + b_5g_5(t) ;

H := t โ†’ a_0 f_0( ) t + a_1 f_1( ) t + a_2 f_2( ) t + a_3 f_3( ) t + a_4 f_4( ) t + a_5 f_5( ) t + b_1 g_1( ) t

  • b_2 g_2( ) t + b_3 g_3( ) t + b_4 g_4( ) t + b_5 g_5( ) t

plot1 := plot (h(t), t = -Pi..Pi, color = black): plot2 := plot (H(t), t = -Pi..Pi, color = red): display ({plot1,plot2});