The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Integrating piecewise functions.
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List

Posts: 2
Registered: 10/27/12
Integrating piecewise functions.
Posted: Mar 5, 2013 4:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have been trying to get a meaningful solution to the differential eqn. for the voltage and current in an inductor:
V[t] == -L i'[t]. For smooth voltage waveforms, the current function is well-behaved and a reasonable solution. But when V[t] is a piecewise function, either my own, or one of the built-in ones, such as SquareWave, the solutions obtained are unreasonable. They may satisfy the differential equation, but they increase in magnitude without limit. I tried integrating the SquareWave[t] Mathematica function, and I could see why DSolve was probably having a problem. The square wave has values +1 or -1 on each half-cycle. Integrate[] sees these constants in the Piecewise statement and simple-mindedly replaces them with +t and -t. So as t gets larger or smaller, the integral(s) yield ramp functions that alternate in sign during every half-cycle of the square wave. What Integrate should yield is a positive-going ramp on the + half-cycle, and a decreasing positive-valued ramp on the - half-cycle of the square wave. The correct function should be the sum of SquareWave[t]*dt over t. The integrals created over each (continuous, differentiable) half-cycle should then be added to create a new function. I can't figure out how to implement Integrate on piecewise functions like this. Does anyone know how?

P.S. I couldn't find a way to search MathGroup postings from the group's pages, so I may be posting an already solved problem. If so, please let me know how I can use the group more efficiently.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.