MATLAB Code:
close all
clear
clc
t = linspace(0, 2*pi, 200)';
b = exp(sin(t-1));
fprintf('Part
(a)\n-----------------------------------------------\n')
T = [ones(size(t)) t t.^2 t.^3 t.^4 t.^5 t.^6 t.^7];
CA = T\b;
fprintf('f(t) ~ %f + %f*t + %f*t^2 + %f*t^3 + %f*t^4 + %f*t^5 +
%f*t^6 + %f*t^7\n', CA)
fprintf('\nPart
(b)\n-----------------------------------------------\n')
T = [ones(size(t)) cos(t) sin(t) cos(2*t) sin(2*t)];
CB = T\b;
fprintf('f(t) ~ %f + %f*cos(t) + %f*sin(t) + %f*cos(2*t) +
%f*sin(2*t)\n', CB)
plot(t, b), hold on
plot(t, CA(1) + CA(2)*t + CA(3)*t.^2 + CA(4)*t.^3 + CA(5)*t.^4 +
CA(6)*t.^5 + CA(7)*t.^6 + CA(8)*t.^7)
plot(t, CB(1) + CB(2)*cos(t) + CB(3)*sin(t) + CB(4)*cos(2*t) +
CB(5)*sin(2*t))
xlabel('t'), ylabel('f(t)')
legend('Original Function', 'Part (a)', 'Part (b)')
Output:
Part (a)
-----------------------------------------------
f(t) ~ 0.326349 + 1.644306*t + -3.880251*t^2 + 4.701695*t^3 +
-2.320595*t^4 + 0.540292*t^5 + -0.060086*t^6 + 0.002586*t^7
Part (b)
-----------------------------------------------
f(t) ~ 1.266081 + -0.951099*cos(t) + 0.610714*sin(t) +
0.113013*cos(2*t) + -0.246870*sin(2*t)
Plot:
PLEASE USE MATLAB this problem you are trying to find an approximation to the periodic function /(t) esint-1) over one period, o <t < 2π. In t-linspace(0,2*pi,200)' and let b be a column ve...
(a) (b) Find the least squares approximation of f(x) = x2 + 3 over the interval [0, 1] by a function of the form y = ae? + bx, where a, b E R. You should write the coefficients a, b as decimal approximations, rounded to two decimal places. Let g(x) be the least squares approximation you found in the pre- vious problem. So g(x) = ae” + bx for some scalars a, b. Find the least squares approximation of...
Let f(t) be periodic function with period T = 1 defined over 1 period as f(t) = {t -1/2 < t < 1/2} (a) Plot f(t) and find its Fourier series representation. (b) Find the first four terms of the fourier series.
5. (a) (6) Carefully sketch the odd periodic extension, of period 2m, of the function f(x)1, 0 < x < π. (Only sketch over the interval z E [-2π, 2π). (b) (10) Find the Fourier sine series of the function in part (a) 5. (a) (6) Carefully sketch the odd periodic extension, of period 2m, of the function f(x)1, 0
The sketch of the following periodic function f (t) given in one period f(t) t2 -1, 0s t s 2 is given as follows f(t) 2 -1 We proceed as follows to find the Fourier series representation of f (t) (Note:Jt2 cos at dt = 2t as at + (a--)sina:Jt2 sin at dt = 2t sin at + sin at. Г t2 sin at dt-tsi. )cos at.) Please scroll to the bottom of page for END of question a) The...
[EUM 114 1. Let f(x) be a function of period 2 (a) over the interval 0<x<2 such that f(x) = - f(x)pada selang Diberikan f(x) sebagai fungsi dengan tempoh 2t yang mana 0<x<2m Sketch a graph of f (x) in the interval of 0 <x< 4 (1 marks/markah) Demonstrate that the Fourier Series for f(x) in the interval 0<x< 2n is (ii) 1 2x+-sin 3x + 1 sin x + (6 marks/markah) Determine the half range cosine Fourier series expansion...
1. If Ea) 2. The Fourier series expansion of the function f() which is defined over one period by , 1<zc2 is f(z) = ao + Find the coefficients an and simplify you answer. 1 z sin ax cos ar Jzcos az dz = Hint: f(x) cos(n") dz and a.-Th 3. The propagation of waves along a particular string is governed by the following bound- ary value problem u(0,t) 0 ue(8,t)0 u(x,0) = f(x) u(x,0) g(x) Use the separation of...
please answer all prelab questions, 1-4. This is the prelab manual, just in case you need background information to answer the questions. The prelab questions are in the 3rd photo. this where we put in the answers, just to give you an idea. Lab Manual Lab 9: Simple Harmonic Oscillation Before the lab, read the theory in Sections 1-3 and answer questions on Pre-lab Submit your Pre-lab at the beginning of the lab. During the lab, read Section 4 and...