UFunTest

Top  Previous  Next

{ UFUNTEST.PDE }

 

{******************************************************

This example illustrates the unit step, unit pulse,

and unit ramp functions ustep(arg1), upulse(arg1,arg2),

and uramp(arg1,arg2)

*******************************************************}

 

title

"unit functions"

 

select

elevationgrid=500

 

{no variables}

 

definitions

x1 = 0.2

x2 = 0.4

 

{no equations}

 

{plot domain required}

boundaries

region 1

   start (-1,0)

   line to (1,0) to (1,1) to (-1,1) to close

 

plots

elevation(ustep(x-x1)) from (0,0) to (1,0)

elevation(dx(ustep(x-x1))) from (0,0) to (1,0)

elevation(upulse(x-x1,x-x2)) from (0,0) to (1,0)

elevation(dx(upulse(x-x1,x-x2))) from (0,0) to (1,0)

elevation(uramp(x-x1,x-x2)) from (0,0) to (1,0)

elevation(dx(uramp(x-x1,x-x2))) from (0,0) to (1,0)

elevation(ustep(cos(4*pi*x))) from (-1,0) to (1,0) {four cycle square wave}

elevation(dx(ustep(cos(4*pi*x)))) from (-1,0) to (1,0) {four cycle square wave}

 

end