


Some more useful functions in MathCAD 




So far, functions have been continuous &
‘smooth’ 

Real world has ‘abrupt’ changes 

MathCAD has functions which can model these
changes 




The impulse given by a hammer. 

The magnetic field due to a current in a
circular conductor has different equation inside and outside of the
conductor. 

A rocket motor produces a constant thrust until
the fuel runs out, then it produces zero thrust. 

A potential well has abrupt changes in potential
at its edges. 




3 arguments 

1 boolean expression (condition) 

‘True’ value 

‘False’ value 

Condition evaluated 

if ‘true’ (nonzero) return true value else
return false value 




Use relation operators (evaluation
palette)
=,>,<,³,£,¹ 

True=1 (anything nonzero) 

False=0 

Can use multiply & add for AND/OR 







Provides an impulse. 

Returns 1 if x=y, 0 otherwise 

Equivalent to if(x=y,1,0) 




Provides a step at x=0 

Equivalent to if(x>0,1,0) 





All functions take real & convert to integer 

trunc ® 0 

floor ® ¥ 

ceil ® ¥ 





Useful for: 

Modelling statistical processes 

Monte Carlo simulation 

2 methods of generation: 

rnd(x) – returns 1 number in range 0<x
(Uniform distribution) 

All others return vector of numbers with
specified distribution 






Create 2 column matrix 

Column 0 = 1..42 

Column 1 = random numbers 

Sort matrix by column 1 

Take top 6 items from column 0 

All different 

Still not guaranteed to win 



