You will have to do something funky like that because parameters are only evaluated before a simulation run. Measure statements are evaluated after a simulation.
I think a resistor would be a voltage dependent current source, g or g2. If you can set that relation to a function of time, it might work.
--
Rick C.
- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209
Yes... Just create a voltage controlled resister in a behavioural subckt, and ramp the control voltage.
This one creates a linear resistance with control voltage. vmin is arbitrary to avoid a divide by zero at a control voltage of zero. The passed in paramter sets the v=1V resistance
.SUBCKT VCR cp cn ra rb res=1k
.param vmin=1e-4
B1 ra rb i=v(ra,rb)/(v(cp,cn) + {vmin})/{res} .ends
Way back in DOS days, I used a netlist-based non-Spice simulator called ECA. It was of course slow and clumsy, but the documentation was superb, and it executed any expression that you could type. A resistor, cap, voltage, or inductor value could be a function of anything else in the circuit. That was very cool. I suppose it violated conservation of energy, and maybe causality, but nobody's perfect.
And it always converged. It might occasionally toss a warning (divide by zero!) but it kept going.
--
John Larkin Highland Technology, Inc
Science teaches us to doubt.
Claude Bernard
Am 30.05.20 um 17:31 schrieb snipped-for-privacy@highlandsniptechnology.com:
So this might be nothing about syntax, more about the value of R. The simulator can not cope with R=0 and 200k * time is at the very beginning zero ...
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com
Take a grounded 1 volt source and drive a string of three 1 ohm resistors to ground. You'll get 1/3 and 2/3 volts. Now sort of randomly change some of the resistors to zero. The number of nodes changes! But the divider works.
A two-resistor 1-ohm divider of course gives 0.5 volts, but if you change the lower resistor to 0, the mid node gets named 'ground' and can't be probed. But the current is 1 amp.
Maybe the explanation is that both nodes of a 0 ohm resistor get called the same node. LT treats a 0 ohm resistor as a piece of wire. You can't probe its current.
Numerical nodes must be assigned at compile time, when you hit 'run'.
--
John Larkin Highland Technology, Inc
Science teaches us to doubt.
Claude Bernard
I have set resistors to 0 value. Are you saying it won't respond to the sy ntax "R=0" while "0" works ok? If no one is typing the "R=" and it's j ust "200K+TIME" the reason it's not working isn't because it evaluates to 0 . I just changed the 2 ohm resistor in John's circuit to 0 ohms and it sti ll works. It runs very slowly, but it works.
--
Rick C.
+ Get 1,000 miles of free Supercharging
+ Tesla referral code - https://ts.la/richard11209
You might be thinking of some devices that if you don't specify a resistanc e will include a small amount. I added a voltage source to a schematic, se t the resistance to zero, put a small resistor in series with it and it see ms the voltage source has literally no resistance. I can measure the volta ge on that net and it is the voltage source setting to how many decimal pla ces that are used in LTspice? I think it is using zero ohms internally bec ause I set it to zero.
--
Rick C.
-- Get 1,000 miles of free Supercharging
-- Tesla referral code - https://ts.la/richard11209
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.