18bme0095_vl2018195000637_ast07

  • Uploaded by: Karun Kumar DK
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 18bme0095_vl2018195000637_ast07 as PDF for free.

More details

  • Words: 116
  • Pages: 5
EXPERIMENT 1A TITLE: FOURIER SERIES AIM: TO FIND THE FOURIER SERIES clc; clear all; syms x; f=input('enter the function f(x):'); I=input('enter the interval [a,b]:'); a=I(1);b=I(2); m=input('enter number of harmonics:') L=(b-a)/2; a0=(1/L)*int(f,a,b); Fx=a0/2; for n=1:m figure; an(n)=(1/L)*int(f*cos(n*pi*x/L),a,b); bn(n)=(1/L)*int(f*sin(n*pi*x/L),a,b); Fx=Fx+an(n)*cos(n*pi*x/L)+bn(n)*sin(n*pi*x/L); Fx=vpa(Fx,4); ezplot(Fx,[a,b]) hold on ezplot(f,[a,b]) end title('Fourier series',num2str(n),'Hormonics') legend('Fourier series','given function')

INPUT: enter the function f(x):x-x^2 enter the interval [a,b]:[-pi,pi] enter number of harmonics:3

m=

3

FIGURE 1:

FIGURE 2:

ANALYTIC SOLUTION

enter the function f(x):x-x^2 enter the interval [a,b]:[-pi,pi] enter number of harmonics:3

m=

3

Fx =

(5734161139222659*pi*cos(x))/4503599627370496 + (5734161139222659*pi*sin(x))/9007199254740992 - (1911387046407553*pi^3)/18014398509481984

Fx =

4.0*cos(x) + 2.0*sin(x) - (5734161139222659*pi*cos(2*x))/18014398509481984 (5734161139222659*pi*sin(2*x))/18014398509481984 - 3.289868133710115216672420501709

Fx =

4.0*cos(x) - 1.0*sin(2.0*x) - 1.0*cos(2.0*x) + 2.0*sin(x) + (1911387046407553*pi*cos(3*x))/13510798882111488 + (1911387046407553*pi*sin(3*x))/9007199254740992 - 3.289868133710115216672420501709

More Documents from "Karun Kumar DK"

Spss Basics
December 2019 18
My Marriage Invitation.pdf
October 2019 29
Use Of Rdw Sd In B Thal
October 2019 19
Modi Ke Char Saal.pdf
October 2019 18