LTspice differentiation

Hello,

I have a resistor R5 with some current flowing through it. It is possible to plot I(R5) by simply selecting the resistor. But is it possible to plot dI(R5)/dt? If yes, then how? An example circuit:

Version 4 SHEET 1 916 680 WIRE 256 16 144 16 WIRE 464 16 336 16 WIRE 592 16 464 16 WIRE 720 16 592 16 WIRE 848 16 720 16 WIRE 464 48 464 16 WIRE 592 48 592 16 WIRE 720 48 720 16 WIRE 848 48 848 16 WIRE 848 64 848 48 WIRE 144 112 144 16 WIRE 416 112 384 112 WIRE 800 112 768 112 WIRE 384 144 384 112 WIRE 464 144 464 128 WIRE 464 144 384 144 WIRE 544 144 544 112 WIRE 592 144 592 128 WIRE 592 144 544 144 WIRE 672 144 672 112 WIRE 720 144 720 128 WIRE 720 144 672 144 WIRE 768 160 768 112 WIRE 848 160 848 144 WIRE 848 160 768 160 WIRE 464 176 464 144 WIRE 592 176 592 144 WIRE 720 176 720 144 WIRE 848 176 848 160 FLAG 144 192 0 FLAG 464 240 0 FLAG 592 240 0 FLAG 720 240 0 FLAG 848 240 0 SYMBOL voltage 144 96 R0 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value PWL(0 0 1 3 2 6 3 9) SYMBOL zener 480 240 R180 WINDOW 0 24 64 Left 2 WINDOW 3 0 -35 Left 2 SYMATTR InstName D2 SYMATTR Value 1N750 SYMATTR Description Diode SYMATTR Type diode SYMBOL zener 608 240 R180 WINDOW 0 24 64 Left 2 WINDOW 3 -42 -32 Left 2 SYMATTR InstName D3 SYMATTR Value BZX84C6V2L SYMATTR Description Diode SYMATTR Type diode SYMBOL zener 736 240 R180 WINDOW 0 24 64 Left 2 WINDOW 3 -22 -29 Left 2 SYMATTR InstName D4 SYMATTR Value TFZ6_8B SYMATTR Description Diode SYMATTR Type diode SYMBOL zener 864 240 R180 WINDOW 0 24 64 Left 2 WINDOW 3 -25 -38 Left 2 SYMATTR InstName D5 SYMATTR Value UMZ7_5K SYMATTR Description Diode SYMATTR Type diode SYMBOL res 352 0 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R5 SYMATTR Value 1 SYMBOL njf 416 48 R0 SYMATTR InstName J1 SYMATTR Value U309 SYMBOL njf 544 48 R0 SYMATTR InstName J2 SYMATTR Value U309 SYMBOL njf 672 48 R0 SYMATTR InstName J3 SYMATTR Value U309 SYMBOL njf 800 48 R0 SYMATTR InstName J4 SYMATTR Value U309 TEXT 110 216 Left 2 !.tran 4

Reply to
Piotr Wyderski
Loading thread data ...

Not directly, but you can make a current-dependent voltage source that has a Laplace transfer function for the gain. It'll need to be of the form H = s / (tau * s + 1), because SPICE doesn't like nekkid differentiators.

--
Tim Wescott 
Control systems, embedded software and circuit design 
I'm looking for work!  See my website if you're interested 
http://www.wescottdesign.com
Reply to
Tim Wescott

Or just use a buffer and a C-R circuit.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

[snip]

If the x-axis is time, simply add to the plot...

d(I(R5))

At least that's how I do it in PSpice, which is Berkeley Spice compliant. In LTspice YMMV. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| STV, Queen Creek, AZ 85142    Skype: skypeanalog |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 

             I'm looking for work... see my website.
Reply to
Jim Thompson

Killjoy.

--
Tim Wescott 
Control systems, embedded software and circuit design 
I'm looking for work!  See my website if you're interested 
http://www.wescottdesign.com
Reply to
Tim Wescott

In general differentiation blows up at high frequency, (where things are changing faster) and you have to roll it off.

George H.

Reply to
George Herold

I like to build my own test equipment in Spice.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

I think it is a general question of doing math operations on the sim results, which AFAIK is not something very user-friendly in LTspice. Exporting the results and finishing processing in, say, Octave is doable, but very inconvenient. Another option is to co-simulate your own analog computer the John Larkin's way, but if the operation is more complex, this approach quickly runs out of steam.

c.

Reply to
circuitmaker

Copy the current at R5 with a current-controlled current source and apply this current to an auxiliary inductor. The voltage across the inductor will be L*dI(R5)/dt

Pere

Reply to
o pere o

Yeah, my mistake. Late at night and too quick a read.

George H.

Reply to
George Herold

[snip]

Download LTspiceTutorials.zip from the Simulation Tools & macros page of my website, and extract.

LTspice will do the time derivative via ddt(x), but apparently doesn't do a general d(x)/d(x-axis-variable) like PSpice. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| STV, Queen Creek, AZ 85142    Skype: skypeanalog |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 

             I'm looking for work... see my website.
Reply to
Jim Thompson

Is Spice Turing-complete? Could you simulate a digital computer within Spice? Given enough time and processing power, could one simulate an Spice computer that could run Spice?

Reply to
bitrex

You can make a NAND gate in SPICE, and if you have a NAND gate you can synthesize all other logic. You can build a Turing complete computer out of logic. So, assuming you can make an infinite number of NAND gates in SPICE, it is Turing complete.

--
Tim Wescott 
Control systems, embedded software and circuit design 
I'm looking for work!  See my website if you're interested 
http://www.wescottdesign.com
Reply to
Tim Wescott

LT Spice already has the basic logic gates and flops. They typically need a little timing fudging to build things like shift registers and state machines.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

I hear the robot civilizations of the far future will spend an enormous amount of effort searching for the remnants of the First Compiler, the assembly language program which boostrapped the first higher level program, from which the compilers for all future programs derived.

Reply to
bitrex

I finished assembling an infinite number of NAND gates just yesterday. It took slightly longer than I had anticipated. Sadly, my workbench being what it is, the assembly has gone missing. I'm not happy.

Learn from my mistake and connect your next project to the power supply upon completion. That way, with any luck, you can follow the leads to the terminals.

mike

--
It is hard enough to remember my opinions, without also remembering my 
reasons for them! 
--Friedrich Nietzsche
Reply to
m II

There is only one program. All the programs that we see are just modified versions of that first one. Oommmmmmmmm!

Reply to
Clifford Heath

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.