cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

3-Visitor

## RC Circuit Odesolve Issue

I am trying to simulate RC Circuit with Pulsed Input. I am getting small notch at the transition, Which goes away at high tau values.

Regards,

Shiv

1 ACCEPTED SOLUTION

Accepted Solutions
23-Emerald III
(To:Shivas)

It may help to set the step size of Odesolve,  using the extra parameter to the Odesolve function.

If that works, I think that is a better way than to strip off data...

Success!

Luc

7 REPLIES 7
23-Emerald III
(To:Shivas)

Odesolve uses a numeric approximation algorithm where the output value at every next time step is calculated on the basis of previous output values and the input. Now your input is an ideal square wave, so it jumps instantaneously. This may cause an overshoot in the next time value. This overshoot will be damped as the tau value increases.

Success!
Luc

3-Visitor
(To:LucMeekes)

What do you recommend to remove this overshoot. Some hint would be enough.

Thanks for the help.

23-Emerald III
(To:Shivas)

It may help to set the step size of Odesolve,  using the extra parameter to the Odesolve function.

If that works, I think that is a better way than to strip off data...

Success!

Luc

3-Visitor
(To:LucMeekes)

Thanks for the help.

24-Ruby V
(To:Shivas)

First of all let me say that in Prime (on contrary to Mathcad 15 and below) you are allowed to use units in a solve block with "odesolve". Therefore its not necessary to strip the units as you did. See screenshot and attached Prime 6 worksheet.

I don't think that you can get rid of those overshoots which stem from the numeric methods used (unfortunately Prime is not able to solve an ODE symbolically).

You can use some cheats to avoid those overshoots showing in the plot, though.

1) You may setup a larger step width in your range for t. You'll have to experiment which value fits best. The drawback is that the vertical lines are not vertical but have a slight visible slope now and that you get rounded corners.

2) You may define a function (I called it x2) based on the results of the solve block function which simply cuts off those overshoots.

24-Ruby V
(To:Werner_E)

Luc is perfectly right with his suggestion to increase the step width in "odesolve". In case  you don't know - its an optional fourth argument of "odesolve". The default value is 10^3.

3-Visitor
(To:Werner_E)

Yeah, I also Tried it. Thanks for the help.

Announcements
Top Tags