trying to define a periodic function with the (if then) command
Subject: trying to define a periodic function with the (if then) command
From: Leo Butler
Date: Sat, 3 Apr 2010 15:04:36 +0100 (BST)
On Fri, 2 Apr 2010, Pedro Ferreira wrote:
< Hi, I'm doing a work for school and I'm failing to represent the function properly.
<
< Here's the problem:
< I want to determine the Fourier series of a signal vi(t) = va(t) + vb(t)
<
< vb(t) is given, but va(t) is only given half of the period and it's said that va(t) is a pair function(symmetry towards the y axis).
<
< va(t) is represented:
< 3*sin(%pi/2*t)???????? for ??? 0<t<1
< 3-3*sin(%pi/4(t-1))?? for ?? 1<t<3/2
<
< What i think i need, is to represent va(t) as a periodic function. In the file I attached va(t) isn't working at the part:
< "if t>-3/2 and t<-1 then -va2(t)"? the graph of the function doesn't represent that part.
<
< Then it's the problem of making that function a periodic one.
To make a function periodic, you need mod.
Here is a 'saw-tooth' function:
f(t) := if mod(t,1)<1/2 then t-floor(t) else -t+ceiling(t);
And here is an odd function that is f(2*t) on [0,1/2]:
g(t):=if mod(t,1)<1/2 then f(2*t) else -f(2*t);
Leo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.