Author Topic: RC time constant  (Read 5804 times)

0 Members and 1 Guest are viewing this topic.

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3925
  • Country: de
Re: RC time constant
« Reply #25 on: August 25, 2019, 11:45:45 am »
Word of advice, stay away any symbolic math packages in python, they're garbage.

Care to elaborate?

Do you mean Sympy? I dare to say that it does more than most will need. It is certainly not Mathematica, but it also doesn't cost arm and leg and your firstborn. I have used it to derive some complicated jacobians involving quaternions for a SLAM system and it certainly was able to deal with that. The kind of stuff that has been posted earlier in that Mathematica example is certainly possible with it with no issues.

If Sympy isn't enough, there is also the older Sage project (http://www.sagemath.org/) that is more powerful than Sympy (it is used for mathematical research, such as number theory, so I dare to say its symbolic capabilities are decent).

If neither of that works, there are Python (or JupyterLab) frontends to Maple, Maxima (Sage uses Maxima under the hood), even Mathematica and the now free (as in beer) Mathematica kernel/Wolfram Engine (basically Mathematica meant for embedding in other things, no UI and a restrictive license)

What python lacks is a good symbolic engine and Simulink, both of which Matlab has. Simulink is still the preferred method of designing controllers in commercial industries.

Simulink yes, but then Python is a general purpose programming language + libraries, not a specialized tool (where the programming bit is mostly a messy afterthought - ehm Matlab ...). However, we were talking about plotting graphs and doing basic math, not designing controllers (or similar activities) where one benefits from one of the many specialized (and expensive) Matlab/Simulink toolboxes.
« Last Edit: August 25, 2019, 11:54:38 am by janoc »
 

Offline Mattjd

  • Regular Contributor
  • *
  • Posts: 230
  • Country: us
Re: RC time constant
« Reply #26 on: August 25, 2019, 01:25:02 pm »
Idk about magma but sympy is notoriously bad. From first hand experience performance is poor and its limitations are large.

This can be backed up by the large amounts of quora and stack posts.

Honestly, I'd tell OP to get a ti nspire Cas but if they can afford that then they can afford a Mathematica student license.
« Last Edit: August 25, 2019, 01:43:27 pm by Mattjd »
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3925
  • Country: de
Re: RC time constant
« Reply #27 on: August 25, 2019, 03:09:33 pm »
Idk about magma but sympy is notoriously bad. From first hand experience performance is poor and its limitations are large.

This can be backed up by the large amounts of quora and stack posts.

That was not my experience (and seriously, Stack Overflow and Quora posts are hardly an indicator of anything except that the software in question is popular and being used ...)

Honestly, I'd tell OP to get a ti nspire Cas but if they can afford that then they can afford a Mathematica student license.

Hum, Mathematica is 160 EUR (+ VAT if applicable) for a student license and you need to provide a proof of university enrollment (no idea whether the OP is eligible for that, plus he is in India, so that price is certainly no peanuts). Seriously, buying that only for solving a system of equations?

I had a personal (non-student) Mathematica license and while that software is very powerful, it is an enormous overkill unless you need its capabilities every day. I have ended up not renewing the license because most of my work required fast and easy to use numerical math - and that's where Mathematica actually  sucks because it is very clunky for such use (or I can't wrap my head around the weird syntax sufficiently to not get triggered by the messy code - and I have no issues with Lisp and parentheses normally!)
« Last Edit: August 25, 2019, 03:11:49 pm by janoc »
 

Offline GerryR

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: us
Re: RC time constant
« Reply #28 on: August 25, 2019, 11:58:23 pm »
How about just getting a "Math for Electronics" book and learn how to do the transfer functions and Bode plots etc.  I have several; of course I realize an analysis program makes it easier, but it is good foundation learning.  ;)  Happy to make some recommendations for you, if you are interested.
Still learning; good judgment comes from experience, which comes from bad judgment!!
 

Offline Mattjd

  • Regular Contributor
  • *
  • Posts: 230
  • Country: us
Re: RC time constant
« Reply #29 on: August 26, 2019, 12:11:26 am »
That's probably the best suggestion. At the end of the day these mathes arnt hard.

Whats the general method?

Parts are considered linear, therefore superposition applies. Take laplace transform of each individual component(applicable bc parts are linear and the laplace transform is a linear operator) and create a transfer function. Perform partial fraction decomposition, then take the inverse laplace transform. Done.


Or you could go the long way, derive ode, find forced and natural response

Or its a steady state circuit(as opposed to transient) , use phasors (aka natural response)

 

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 747
  • Country: us
Re: RC time constant
« Reply #30 on: August 26, 2019, 07:30:34 am »
If you do need an analytic solution, the URL I provided above has everything you need.
It doesn't have everything; an analytic solution is provided for the frequency response but not for the time response.

An expression for the time response of the low pass topology shown here: http://sim.okawa-denshi.jp/en/CRCRkeisan.htm
can be derived with the help of Mathematica:



The numerical values shown on this page: http://sim.okawa-denshi.jp/en/CRCRtool.php

can be used with the derived expression to produce a plot of the time response of the circuit shown:



A time response plot with the two sections reversed (R2/C2 first, R1/C1 second) is as shown:

« Last Edit: August 26, 2019, 07:34:05 am by The Electrician »
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: RC time constant
« Reply #31 on: August 27, 2019, 12:40:15 pm »
It doesn't have everything; an analytic solution is provided for the frequency response but not for the time response.
A boatload of exponents doesn't seem mighty helpful, IMO.
Manually doing inverse Laplace transforms only makes sense when expressions are simple enough to even make sense doing it (learning mathematics, for example). For anything more complex you'd use a computer anyhow.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 
The following users thanked this post: Nitrousoxide

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 747
  • Country: us
Re: RC time constant
« Reply #32 on: August 27, 2019, 07:21:11 pm »
It doesn't have everything; an analytic solution is provided for the frequency response but not for the time response.
A boatload of exponents doesn't seem mighty helpful, IMO.

I suppose that if one isn't interested in an analytical solution for the time response, exponents aren't helpful.  But, if an analytical solution is of interest, exponents are inevitable.

Manually doing inverse Laplace transforms only makes sense when expressions are simple enough to even make sense doing it (learning mathematics, for example). For anything more complex you'd use a computer anyhow.

I did use a computer to obtain the expression shown.  You don't think I came up with all those exponents by hand, do you?
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: RC time constant
« Reply #33 on: August 28, 2019, 01:49:20 am »
Pick the node of interest and use Elmore's approximation.
 

Offline The Electrician

  • Frequent Contributor
  • **
  • Posts: 747
  • Country: us
Re: RC time constant
« Reply #34 on: August 29, 2019, 03:22:40 pm »
Pick the node of interest and use Elmore's approximation.

Before software packages such as Mathematica or Maple were available, the calculations involved in obtaining an Elmore approximation were less than those for finding the exact time response:

https://ieeexplore.ieee.org/document/545648 (This is a 22 year old paper.  Mathematical software has become much more powerful in the intervening years.)

and

https://en.wikipedia.org/wiki/Elmore_delay  (moments or Pade approxmations are needed)

But now with the availability of software like Mathematica with built-in Inverse Laplace transforms, and fast computers to go along with the software, it's quicker to get the analytical expression for the time response than to calculate the Elmore delay.

Here is the calculation and plot of the time response of the twin tee filter shown here: http://sim.okawa-denshi.jp/en/TwinTCRtool.php

It took Mathematica about 1 second to find the Inverse Laplace transform.  The full transform expression isn't shown because it's several pages long.

 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: RC time constant
« Reply #35 on: August 29, 2019, 03:38:46 pm »
Quote

But now with the availability of software like Mathematica with built-in Inverse Laplace transforms, and fast computers to go along with the software, it's quicker to get the analytical expression for the time response than to calculate the Elmore delay.


To be fair, I think Pileggi's work was not simply to analyze an RC network.  IMHO, his work was to develop a fast method to calculate delays in large-scale timing analyzers (for integrated circuit design).
 

Offline schratterulrich

  • Regular Contributor
  • *
  • Posts: 50
  • Country: at
    • Elektronik & Layout
Re: RC time constant
« Reply #36 on: August 31, 2019, 04:02:47 pm »
In general for second order systems there exists three cases:
Critically damped
Underdamped
Overdamped

if we assume that this circuit always generates an overdamped case, there is a simpler analytic solution in the time domain:

proof:


I have derived the formula using this document:
https://www.eal.ei.tum.de/fileadmin/tueieal/www/courses/AESACA/5__Responce_first_and_second.pdf


« Last Edit: August 31, 2019, 04:08:13 pm by schratterulrich »
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: us
Re: RC time constant
« Reply #37 on: September 01, 2019, 03:07:51 am »
if we assume that this circuit always generates an overdamped case, there is a simpler analytic solution in the time domain:

This condition always holds.

It follows from the inequality a^2 + b^2 >= 2*a*b. Use a = sqrt(R1*C1), b = sqrt(R2*C2).

It follows from the inequality \$a^2 + b^2 \ge 2ab\$. Use \$a = \sqrt{R_1C_1}\$, \$b = \sqrt{R_2C_2}\$.

« Last Edit: September 05, 2019, 04:05:18 pm by ledtester »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf