Question

Use MATLAB to plot the function of Problem 2: (Advanced engineering mathematics 7th edition textbook - chapter 13 section 13.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

close all
clear
clc

syms t k L n
evalin(symengine, 'assume(k, Type::Integer)');
a = @(f,t,k,L) int(f*cos(k*pi*t/L)/L, t, -L, L);
b = @(f,t,k,L) int(f*sin(k*pi*t/L)/L, t, -L, L);
fs = @(f,t,n,L) a(f,t,0,L)/2 + symsum(a(f,t,k,L)*cos(k*pi*t/L) + b(f,t,k,L)*sin(k*pi*t/L), k, 1, n); % Fourier series summation

f = cosh(pi*t)*(heaviside(t + 1) - heaviside(t - 1)); % Interval [-1, 1]

figure, hold on
xlabel('t'), ylabel('f(t) & Fourier Series'), title('Fourier Series Representation')

L = 1;
t_vals = linspace(-L, L, 500); % 500 samples from -L to L
plot(t_vals, subs(f, t_vals)) % Plot f(t)

n = 2; % Number of terms
g = fs(f,t,n,L);
plot(t_vals, subs(g, t_vals))

n = 5;
g = fs(f,t,n,L);
plot(t_vals, subs(g, t_vals))

n = 20;
g = fs(f,t,n,L);
plot(t_vals, subs(g, t_vals))

legend('f(t)', 'Fourier Series (n = 2)', 'Fourier Series (n = 5)', 'Fourier Series (n = 20)', 'Location', 'north')
hold off

Plot:

Fourier Series Representation f(t) Fourier Series (n = 2) Fourier Series (n = 5) Fourier Series (n = 20) f(t) & Fourier Serie

Add a comment
Know the answer?
Add Answer to:
Use MATLAB to plot the function of Problem 2: (Advanced engineering mathematics 7th edition textbook -...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Kreyszig, Advanced Engineering Mathematics, 10th Edition Technolog e Assignment Gradebook Downloadable eTextbook ent Chapter 11, Section...

    Kreyszig, Advanced Engineering Mathematics, 10th Edition Technolog e Assignment Gradebook Downloadable eTextbook ent Chapter 11, Section 11.1, Question 15 x Your answer is incorrect. Try again. Find the Fourier series of the given function f (2), which is assumed to have the period 2. f (x) = x2 (0< < 2) Enter the first three non-zero terms of the Fourier series. Enclose arguments of functions in parentheses. For example, sin (2 * x). se an asterisk, to indicate multiplication. For...

  • edugen wileyplus.com 을 Return to Blackboard Advanced Engineering Mathematics, 10th Edition Chapter 8, Section 8.3, Additional Question 01 Incorrect. Is the following matrix symmetric, skew-symme...

    edugen wileyplus.com 을 Return to Blackboard Advanced Engineering Mathematics, 10th Edition Chapter 8, Section 8.3, Additional Question 01 Incorrect. Is the following matrix symmetric, skew-symmetric, or orthogonal? Find its spectrum, including any repeated values. A-Г941 -4 1 Enter the eigenvalues in increasing order The given matrix is orthogonal The spectrum is λ 1 Click if you would like to Show Work for this question: Open Show Work SHOW HINT Question Attempts 嘱MapleNet 2 powered by edugen wileyplus.com 을 Return to...

  • Hello! i need help with a problem in this textbook, Essential MATLAB, 6th edition. Question 8.11:...

    Hello! i need help with a problem in this textbook, Essential MATLAB, 6th edition. Question 8.11: Use the Taylor Series, cosx=1- (x2/2!)+(x4/4!)-(x6/6!)+......... To write a program to compute cosx correct to 4 decimal places )x is in radians). see how many terms are needed to get 4 figure agreement with the MATLAB function cos. Dont make x too large; that could cause rounding errors. I can get an out put correct up to about only 10 radians, but then it...

  • Discrete Mathematics and Its Applications |(7th Edition See this solution in the app :5 Chapter 5.3,...

    Discrete Mathematics and Its Applications |(7th Edition See this solution in the app :5 Chapter 5.3, Problem 6E 13 Bookmarks Show all steps: ON Problem Determine whether each of these proposed definitions is a valid recursive definition of a function f from the set of nonnegative integers to the set of integers. Iff is well defined, find a formula for f(n) when n is a nonnegative integer and prove that your formula is valid. a) f(0) = 1, f(n) =...

  • Problem 2: A periodic signalxit) is shown below A =10, T-4 sec. -T Write a MATLAB script to plot ...

    Problem 2: A periodic signalxit) is shown below A =10, T-4 sec. -T Write a MATLAB script to plot the signal, using enough points to get a smooth curve. Compute the Fourier series coefficients for the signal (if you can find them in the text, that is ok). Plot the single-sided or double-sided spectra for each signal. Include enough frequencies in the plots to adequately represent the frequency content of the signals. Plot partial sums of the Fourier series for...

  • 4. Consider the following partial information about a function f(x): S.x2, 0<x<I, (2-x), 1<x<2. Given that...

    4. Consider the following partial information about a function f(x): S.x2, 0<x<I, (2-x), 1<x<2. Given that the function can be extended and modelled as a Fourier cosine-series: (a) Sketch this extended function in the interval that satisfies: x <4 (b) State the minimum period of this extended function. (C) The general Fourier series is defined as follows: [1 marks] [1 marks] F(x) = 4 + ] Ancos ("E") + ] B, sin("E") [1 marks] State the value of L. (d)...

  • hegg Study TEXTBOOK SOLUTIONS EXPERT ORA PRACTICE NEW affic Engineering (4th Edition) Bookmark Chapter 15, Problem...

    hegg Study TEXTBOOK SOLUTIONS EXPERT ORA PRACTICE NEW affic Engineering (4th Edition) Bookmark Chapter 15, Problem 3P Show all steps ON Problem Consider the on-ramp shown in Figure Figure: Segment for Problem Freeway 4,200 veh/h 8 % trucks Level terrairn FFS- 65 mil/h PHF 0.92 Ramp 700 veh/h 5% trucks Level terrain RFFS 40 m/h PHF-0.92 (a) At what LOS would the merge area be expected to operate? (b) A new development nearby opens and increases the on-ramp volume to...

  • Problem (8) MATLAB Problem) Write a Matlab Function that plots the of the following signal in...

    Problem (8) MATLAB Problem) Write a Matlab Function that plots the of the following signal in the discrete time domain for any value of the shift k and for any range of it: nak *(1 – k) = fccm (c(n - keink 0. n<R Problem (9) MATLAB Problem) Subplot the following signals in the same figure choose an appropriate range for : x(n) = b cos (0.1bana ym) = 2"sin (0.1b mn + ) וחו

  • Seems long but it's not too bad. the book used in class is: Advanced Engineering Mathematics by E...

    Seems long but it's not too bad. the book used in class is: Advanced Engineering Mathematics by Erwin Kreyszig i will give thumbs up Thank you Problem 3 (Frequency Response Testing) A common application for Fourier in mechanical design relates to the concept of resonance that we discussed earlier in the semester. Recall that resonance occurs when you drive a mechanical or electrical system at or near its natural frequency, whích then causes large amplitude oscillations. For relatively simple systems...

  • You are given a finite step function xt=-1  0<t<4 1  4<t<8.           Hand calculate the FS coefficients of...

    You are given a finite step function xt=-1  0<t<4 1  4<t<8.           Hand calculate the FS coefficients of x(t) by assuming half- range expansion, for each case below. Modify the code below to approximate x(t) by cosine series only (This is even-half range expansion). Modify the below code and plot the approximation showing its steps changing by included number of FS terms in the approximation. Modify the code below to approximate x(t) by sine series only (This is odd-half range expansion).. Modify...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT