User Tools

Site Tools


math121a-f23:blog

Homework 8

1. Sine and Cosine decomposition.

Suppose you are given a function on an interval, f(x):[0,1]Rf(x): [0, 1] \to \R. Such function f(x)f(x) can be expressed as a sum of 'sine waves' and cosine waves and constant

f(x)=a0+n=1ancos(2nπx)+bnsin(2nπx). f(x) = a_0 + \sum_{n=1}^\infty a_n \cos(2n \pi x) + b_n \sin(2n \pi x).

Can you figure out a way to determine the coefficients ana_n and bnb_n?

Test out your method for the following function f(x)={10<x<1/201/2x1 f(x) = \begin{cases} 1 & 0 < x < 1/2 \cr 0 & 1/2 \leq x \leq 1 \end{cases}

find a0,a1,b1a_0, a_1, b_1 and plot the truncated Fourier series a0+a1cos(2πx)+b1sin(2πx). a_0 + a_1 \cos(2 \pi x) + b_1 \sin(2 \pi x). How does this resemble your original given function?

2. Consider the following equation, for t>0t>0, f(t)+f(t)=0 f'(t) + f(t) = 0 And suppose f(0)=1f(0) = 1. Can you solve f(t)f(t) for t>0t > 0?

3. Consider the following equation, for t>0t>0, (d/dt+1)(d/dt+2)f(t)=0 (d/dt + 1) (d/dt + 2) f(t) = 0 And suppose f(0)=1,f(0)=0f(0) = 1, f'(0)=0. Can you solve f(t)f(t) for t>0t > 0?

4. Consider the following equation, for t>0t>0, [(d/dt)2+1]f(t)=0 [(d/dt)^2 + 1] f(t) = 0 And suppose f(0)=1,f(0)=0f(0) = 1, f'(0)=0. Can you solve f(t)f(t) for t>0t > 0?

5 (bonus, optional). Consider the following equation, for t>0t>0, (d/dt+1)(d/dt+1)f(t)=0 (d/dt + 1) (d/dt + 1) f(t) = 0 And suppose f(0)=1,f(0)=0f(0) = 1, f'(0)=0. Can you solve f(t)f(t) for t>0t > 0?

2023/10/20 21:57 · pzhou

Oct 20. Exercise Day!

So far, we have learned many transformations and inverse transformation. Conceptually, we are just trying to decompose a given function f(x)f(x) as a linear combination of eaxe^{ax} for various aa. Because it is an eigenfunction of (d/dx)(d/dx): (d/dx)eax=aeax (d/dx) e^{ax} = a e^{ax}

Ex 1

Decomposition of a standing wave with Dirichlet condition. When we pluck a string on a violin, the string vibrate with the endpoints fixed.

Suppose the string's length is LL, and you took a snapshot of the string and obtained the vertical displacement as a function f:[0,L]Rf: [0,L] \to \R (yes, it is R\R valued, not C\C valued).

Design a way to do Fourier decomposition of ff.

If you like, pick L=2L = 2 and f(x)=1x1. f(x) = 1 - |x-1|. (just a linear peak).

Ex 2

Damped oscillation, reverse engineering.

Suppose you observe some damped oscillation that goes like f(t)=Aeatsin(bt),t>0 f(t) = A e^{-a t} sin(b t), \quad t > 0 Can you find the second order equation that f(t)f(t) satisfies? Namely, for what constant A,BA,B does f(t)f(t) satisfies the equation?

f(t)+Af(t)+Bf(t)=0. f“(t) + A f'(t) + B f(t) = 0.

If you like, pick a=1,b=2a=1, b= 2.

Ex 3

Tuning the friction.

Consider the pure oscillation equation: f(t)+ω2f(t)=0 f”(t) + \omega^2 f(t) = 0 it has solution like f(t)=asin(ωt)+bcos(ωt).f(t) = a \sin(\omega t) + b \cos(\omega t).

What happens if we add some friction term? f(t)+af(t)+ω2f(t)=0 f“(t) + a f'(t) + \omega^2 f(t) = 0

  • does it matter if aa is positive or negative?
  • does it matter if aa is small or large?

Make a guess first. Then solve it explicitly, for ω=1\omega = 1, and try various aa.

Hint: Is there a 'planewave' that solves the equation, i.e. somethign like ecte^{ct} for some cc?

Ex 4: Discrete Fourier transformation

You received the following a periodic sequence of numbers,

  • sequence of period 9: 0 0 1 0 0 2 0 0 3

Use discrete Fourier transformation to analyse it.

  • You can use this input number to as values of f(x)f(x) for x=0,1,,8x=0,1, \cdots, 8.
  • you know f(x)f(x) can be written as

f(x)=p=08F(p)e2πi(xp/9) f(x) = \sum_{p=0}^8 F(p) e^{2\pi i (xp/9)} Can you find F(p)F(p)?

  • These f(x)f(x) are all real valued, what does that say about F(p)F(p)? (try to take complex conjugate of the equation)
  • Can you guess, which F(p)|F(p)|s are largest?

If you have done the above exercise, try this one

  • sequence of period 10: 2 5 3 8 2 7 1 9 0 4
2023/10/19 23:10 · pzhou

Homework 7

(Due next Wednesday)

We will use the Boas convention for Fourier transformation (or see Friday's note).

1. Discrete Fourier Transformation for N=3N=3. Suppose f(x)f(x) is given by f(x)=δx,0 f(x) = \delta_{x,0} where δi,j=0\delta_{i,j} = 0 is iji\neq j and =1=1 if i=ji=j.

Find the Fourier transformation F(p)F(p). (You discovered that 'peak function' in xx space is sent to 'planewave' in pp space. )

What function f(x)f(x) will have Fourier transformation F(p)=δp,0F(p) = \delta_{p,0}?

2. Recall that if f(x)=1/(1+x2)f(x) = 1/(1+x^2), then its Fourier transformation is F(p)=(1/2)epF(p) = (1/2) e^{-|p|}. Can you verify Parseval's Equality in this case?

3. Let f(x)=1f(x) = 1 for x[0,1]x \in [0,1]. Compute the convolution (ff)(x)(f\star f)(x). Can you plot it? What's the Fourier transformation of ff and fff \star f? (The one for ff is already done in HW6).

2023/10/14 01:12 · pzhou

October 13, Friday

Parseval Equality says, Fourier transformation, as a linear map from one function space (function on x), to another function space (function on p), preserves 'norm'. Norm is just a fancy way of saying 'length of a vector'.

What do we mean by the length of a function?

FT Conventions

Continuous Fourier transformation (OK, I switched to Boas convention) f(x)=RF(p)eipxdp. f(x) = \int_\R F(p) e^{ipx} dp. F(p)=(1/2π)Rf(x)eipxdx. F(p) = (1/2\pi) \int_\R f(x) e^{-ipx} dx.

Discrete Fourier transformation

Fix a positive integer NN. x,px,p are valued in the 'discretized circle' Z/NZ{0,1,,N1}. \Z / N\Z \cong \{0,1,\cdots, N-1\}.

f(x)=pZ/NZF(p)e2πipx/N. f(x) = \sum_{p \in \Z / N\Z} F(p) e^{2\pi i \cdot px/N}. F(p)=(1/N)xZ/NZf(x)e2πipx/N. F(p) = (1/N) \sum_{x \in \Z / N\Z} f(x) e^{-2\pi i \cdot px/N}.

Norm in the Continous Fourier transformation

Let f(x)f(x) be a complex valued function on xRx \in \R, we define fx2:=(1/2π)Rf(x)2dx \| f\|_x^2 := (1/2\pi) \int_\R |f(x)|^2 dx

Let F(p)F(p) be a complex valued function on pRp \in \R, we define Fp2:=RF(p)2dp \| F\|_p^2 := \int_\R |F(p)|^2 dp

Norm in the Discrete Fourier transformation

fx2:=(1/N)x=0N1f(x)2 \| f\|_x^2 := (1/N) \sum_{x=0}^{N-1} |f(x)|^2

Let F(p)F(p) be a complex valued function on pRp \in \R, we define Fp2:=p=0N1F(p)2 \| F\|_p^2 := \sum_{p=0}^{N-1} |F(p)|^2

Parseval Equality

If F(p)F(p) is the Fourier transformation of f(x)f(x), then Fp2=fx2.\|F\|^2_p = \|f\|^2_x. We proved in class the discrete case. The continuous case is similar in spirit, but harder to prove.

Convolution

Consider two people, call them Alice and Bob, they each say an integer number, call it a and b. Suppose aa and bb both have equal probability of taking value within {1,2,,6}\{1,2,\cdots, 6\}, we can ask what is the probabity distribution of a+ba+b?

We know P(a=i)=1/6P(a=i) = 1/6, P(b=i)=1/6P(b=i) = 1/6 for any i=1,,6i=1,\cdots, 6, otherwise the probabilit is 0. Then P(a+b=k)=i+j=kP(a=i)P(b=j). P(a+b = k) = \sum_{i+j=k} P(a=i) P(b=j).

This is an instance of convolution.

convlution in xx space

Convolution is usually denoted as \star.

If ff and gg are functions on the xx space, then we define (fg)(x)=x1f(x1)g(xx1)dx1 (f \star g)(x) = \int_{x_1} f(x_1) g(x-x_1) dx_1 If FF and GG are functions on the pp space, then we define (FG)(p)=p1F(p1)G(pp1)dp1 (F \star G)(p) = \int_{p_1} F(p_1) G(p-p_1) dp_1

Fourier transformation sends convolution of functions on one side to simply multiplication on the other side. (1/2π)FT(fg)=FG. (1/2\pi) FT(f \star g) = F \cdot G. FT(fg)=FG. FT(f \cdot g) = F \star G.

2023/10/14 00:25 · pzhou

October 16 (Monday)

  • What is Laplace transform?
  • What's the difference between that and Fourier transform?
  • When to use it?

Definition

Given a function f(t)f(t) on the positive real line t>0t>0, we can define the following function of pp: F(p)=t=0f(t)eptdt. F(p) = \int_{t=0}^\infty f(t) e^{-pt} dt. Again, we require the function f(t)f(t) to have moderate growth at tt \to \infty for the integral to be well-defined.

Examples

  • f(t)=1f(t) = 1, F(p)=1/p,F(p) = 1/p, valid for Re(p)>0Re(p) > 0
  • f(t)=eatf(t) = e^{a t}, F(p)=1/(pa),F(p) = 1/(p-a), valid for Re(pa)>0Re(p-a) > 0.
  • f(t)=cos(at)f(t) = \cos(at), F(p)=(1/2)[1/(pia)+1/(p+ia)]=p/(p2+a2).F(p) = (1/2)[1/(p-ia) + 1/(p+ia)] = p/(p^2 + a^2). valid for Re(p)>0Re(p)>0 if aa is real.

That was about function with (linear) exponential decay or growth at infinty

How about Gaussian?

  • If f(t)=et2f(t) = e^{-t^2}, then

F(p)=0et2eptdt=0e(t+p/2)2+p2/4dt=ep2/4p/2et2dt. F(p) = \int_0^\infty e^{-t^2} e^{-pt} dt = \int_0^\infty e^{-(t+p/2)^2 + p^2/4} dt = e^{p^2/4} \int_{p/2}^\infty e^{-t^2} dt. OK, that's not nice, you can express the result using Gaussian error function, which is about 0aet2dt\int_0^a e^{-t^2} dt, but let's not worry about it.

How about rational function?

  • If f(t)=1/(1+t)f(t) = 1/(1+t), we know F(p)F(p) exists, and it is holomorphic (at least) for Re(p)>0Re(p)>0.

properties

Suppose we know the Laplace transform of f(t)f(t), let's denote F=LT(f)F = LT(f) (note we just write the name of the function ff, not including its input variables t). What can we say about LT(f)LT(f')?

We can do integration by part LT(f)=0eptdfdtdt=t=0t=eptdf=t=0t=d[eptf]d[ept]f=eptf(t)0+0peptf(t)dt=f(0)+pF(p). LT(f') = \int_0^\infty e^{-pt} \frac{df}{dt} dt = \int_{t=0}^{t=\infty} e^{-pt} df = \int_{t=0}^{t=\infty} d[e^{-pt} f] - d[e^{-pt}] f= e^{-pt} f(t)|_0^\infty + \int_0^\infty p e^{-pt} f(t) dt = -f(0) + pF(p).

inverse?

f(t)=12πicic+ieptF(p)dp.c0 f(t) = \frac{1}{2\pi i} \int_{c - i\infty}^{c+i \infty} e^{pt} F(p) dp. \quad c \gg 0 We want to take cc large enough so that there is no singularity of F(p)F(p) for Re(p)>cRe(p) > c.

For example, if F(p)=1/pF(p) = 1/p, or 1/(pa)1/(p-a), we can get f(t)=1f(t) = 1 and f(t)=eatf(t)=e^{at} respectively.

What's Laplace transformation good for?

If you have a differential equation about f(t)f(t) on some domain t>0t > 0, and you know the initial conditions, say f(t=0)f(t=0) etc, then you can use it to compute the Laplace transform of ff. We have

Example f(t)+f(t)=3,f(0)=1 f'(t) + f(t) = 3, \quad f(0) = 1 We apply Laplace transform to the equation, we get pF(p)f(0)+F(p)=3/p. pF(p) - f(0) + F(p) = 3 / p. Then, we get F(p)(p+1)=(3/p+1)F(p)=3+pp(p+1) F(p) (p+1) = (3/p + 1) \Rightarrow F(p) = \frac{3+p} {p (p+1)}

Then, we may apply the inverse Laplace transformation, to get f(t)=Resp=0(ept3+pp(p+1))+Resp=1(ept3+pp(p+1))=e0t(3+0)0+1+e1t311=2et+3. f(t) = Res_{p=0} (e^{pt} \frac{3+p} {p (p+1)}) + Res_{p=-1} (e^{pt} \frac{3+p} {p (p+1)}) = \frac{e^{0t} (3+0)}{0+1} + e^{1t} \frac{3-1} {-1} = -2 e^{-t} + 3. Double check f(t)+f(t)=2et+(2et+3)=3,f(0)=1. f'(t) + f(t) = 2 e^{-t} + (-2 e^{-t} + 3)=3, \quad f(0) = 1. yeah.

2023/10/13 09:04 · pzhou

<< Newer entries | Older entries >>

math121a-f23/blog.txt · Last modified: 2023/10/04 09:31 by pzhou