circuitjs1 icon indicating copy to clipboard operation
circuitjs1 copied to clipboard

Feature Request: Loss free resistor

Open EmergencyTemporalShift opened this issue 1 year ago • 10 comments

https://en.wikipedia.org/wiki/Loss_free_resistor Loss free resistors are a type of resistor that feed power back into their source instead of dissipating it as heat. An example circuit and internals would also be nice to have.

EmergencyTemporalShift avatar Dec 20 '24 17:12 EmergencyTemporalShift

You filed an issue about this already: https://github.com/sharpie7/circuitjs1/issues/555

I used a VCCS to model it: https://tinyurl.com/yanxq2z5

pfalstad avatar Dec 20 '24 19:12 pfalstad

My bad, I thought I did, but forgot there were two forks when I didn't find it.

EmergencyTemporalShift avatar Dec 20 '24 23:12 EmergencyTemporalShift

I still think it deserves a place in the index with a little blurb though, it's educational.

EmergencyTemporalShift avatar Dec 20 '24 23:12 EmergencyTemporalShift

I used a VCCS to model it: https://tinyurl.com/yanxq2z5 Is the capacitor supposed to gain more charge over time? Is it because there is no real load? I might just not understand the concept well enough.

EmergencyTemporalShift avatar Dec 20 '24 23:12 EmergencyTemporalShift

I think so. The capacitor stores all the energy that was drained from the source.

pfalstad avatar Dec 20 '24 23:12 pfalstad

And how do you tune the "resistance"?

EmergencyTemporalShift avatar Dec 20 '24 23:12 EmergencyTemporalShift

The output function of each controlled source includes a 1000 in the formula.. Change this to the resistance you want

pfalstad avatar Dec 21 '24 01:12 pfalstad

I'm trying to make the resistance adjustable, but I just get a singularity error. https://tinyurl.com/2alykrwt Is this a problem with the implementation or my circuit?

EmergencyTemporalShift avatar Dec 21 '24 04:12 EmergencyTemporalShift

replace c with max(c, 1) in the first controlled source and replace e with max(e, 1) in the second. The problem is that c/e are zero in the first iteration, so the current is infinite.

pfalstad avatar Dec 21 '24 04:12 pfalstad

It looks like you're trying to use the energy in the cap for something, which won't work with a VCVS output. This works better:

https://tinyurl.com/25hw4gt5

pfalstad avatar Dec 21 '24 05:12 pfalstad