MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Triangle function

  • To: mathgroup at
  • Subject: [mg14451] RE: [mg14410] Triangle function
  • From: "Ersek, Ted R" <ErsekTR at>
  • Date: Wed, 21 Oct 1998 03:32:48 -0400
  • Sender: owner-wri-mathgroup at

Andrew Strobel 
>Has Mathematica got a triangle function where I can choose the frequency
>and the amplitude?
>The function is necessary to describe a voltage source. It must be an
>analytical function. 
>like this:
>  /\    /\
>/    \/    \

I don't think so, but you can write a program for a function that will
do what you want.  For example the program below defines a piecewise
linear function f[x].  I am not going to program the triangle wave for
you because it may very well be a homework assignment.

f[x_?NumericQ]:=If[x<2,3, x-4]/;(Im[x]==0)&&(0<=x<5)


(* Plot of a periodic function not shown. *)

If you need to work with the Laplace transform of Fourier Series you
have to define the function in terms of the UnitStep function since
those operations do not deal with definitions like those above.

The UnitStep function is in the standard package Calculus`DiracDelta`.

Ted Ersek

  • Prev by Date: RE: FactorInteger
  • Next by Date: ODE
  • Previous by thread: Triangle function
  • Next by thread: Re: Triangle function