Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Integrating a Piecewise Cont. function' topicStudent Support Forum > General > "Integrating a Piecewise Cont. function"

Next Comment >Help | Reply To Topic
Author Comment/Response
Rich Lindenberg
12/03/00 3:14pm

I am trying to do some simplified finite elements that simply requires the
integration of some roof functions (i.e. piecewise continous functions that
are 0 everywhere except where they ramp up and then down in a specified
domain). I was hoping that I could do everything symbolically, but
Mathemtica refuses to integrate every conditional I give it. I can get it to
do the numerically, but it comes with baggage. This is what I have right
now:

These are roof functions differentiated

Piecewise continuous
b'[x_, n_] :=
Which[x < n, 0, n <= x <= n + 1, 1, n + 1 < x < n + 2, -1, x >= n + 2, 0]

Another way to look at it
v'[x_, n_] := 0 /; x < n
v'[x_, n_] := 1 /; n <= x <= n + 1
v'[x_, n_] := -1 /; n + 1 < x < n + 2
v'[x_, n_] := 0 /; x >= n + 2

I want to simply do this...

Integrate[v'[x,m] v'[x,n]] for m=n=1...5 (or something)

(If you copy the below item into Mathematica you will see exactly, I
think...)

Essentially I am trying to make a matrix full of the these functions. The
numerical integrate seems to work, but keeps spitting up after trying to
integrate integrands of zero. I suppose if I could turn this off that would
be good. The other stuff in the table function just makes it a tridiagonal.

\!\(Table[
Switch[i - j, \(-1\),
N[\[Integral]\_0\%5\((\(v'\)[x, i]\ \(v'\)[x, j])\)
\[DifferentialD]x],
0, N[\[Integral]\_0\%5\((\(v'\)[x, i]\ \(v'\)[x,
j])\) \[DifferentialD]x], 1,
N[\[Integral]\_0\%5\((\(v'\)[x, i]\ \(v'\)[x,
j])\) \[DifferentialD]x], _, 0], {i, 5}, {j, 5}]\)

I was wondering about a unit step, but my next step is with quadratic functions, which will have linear derivatives.

Appreciate any help/ideas...

Thanks,
Rich Lindenberg
UIUC

URL: ,

Subject (listing for 'Integrating a Piecewise Cont. function')
Author Date Posted
Integrating a Piecewise Cont. function Rich Lindenb... 12/03/00 3:14pm
Re: Integrating a Piecewise Cont. function Rich Lindenb... 12/04/00 04:58am
Next Comment >Help | Reply To Topic