Integration with if function
- November 22, 2016
- 2 replies
- 2047 views
I am trying to do some simple math to integrate a step change function using Mathcad 15.
The problem as simple as a capacitor has two values, at a threshold voltage.
When the voltage is below one value, say 20V, the capacitor is large, say 40pF
When the voltage is above the threshold, 20V, the capacitor is small, say 20pF.
To calculate the charge in the cap as a function of capacitor voltage, I can do it two ways.
1, Define the capacitor value as a function of voltage and describe it as if function. Then integrate the capacitor with voltage to get charge.
2. directly integrated capacitor with voltage and put the if function in the integration equation.
The two results are very similar, however, the method one has significant error comparing with second method. See the attachment.
Is there any thing wrong with the algorithms inside the Mathcad that having trouble to handling the if function inside integration? I am using the integration with if function a lot and really concerning on the accuracy of the math.
Thanks.
Bing

