# LTSpice variable Resistor with voltage and current

Discussion in 'General Electronics Chat' started by ulix, May 21, 2015.

1. ### ulix Thread Starter New Member

May 21, 2015
7
0
Hello,

I want to simulate a variable resistor, for which I have the current and voltage date (0V, 0.5V, 1V, 2V, 4V, 6V, 8V, 10V) How can I get this realized? Everything I tested didn't get me in the simulation on the x-axes the voltage and on the y-axes the current...
cheers

2. ### MikeML AAC Fanatic!

Oct 2, 2009
5,451
1,071
Is the resistor non-linear ( a function of the voltage across it), or do you just want to vary the resistor to see what effect that has on the operation of the circuit?

3. ### ulix Thread Starter New Member

May 21, 2015
7
0
it's non linear, from a light-bulb. I only have the voltage and current data.

4. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,146
1,492
You can make a non-linear resistor by setting its value to some variable, like this:

5. ### ulix Thread Starter New Member

May 21, 2015
7
0
Sorry, I don't understand. How can I import the voltage current data? it's all dc voltage

6. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,146
1,492
I suggest you plot your data and from the graph deduce an equation which gives resistance as a function of current or voltage. Then use that equation to set the sim resistor value.

7. ### ulix Thread Starter New Member

May 21, 2015
7
0
How can I get the function? Is there no other way? In PSpice it works with the GTABLE Command, you put TABLE = (u_1, i_1) (u_2, i_2) ....

• ###### non lin.png
File size:
21.1 KB
Views:
41
Last edited: May 21, 2015
8. ### ulix Thread Starter New Member

May 21, 2015
7
0
Ok, I calculated a function, can LtSpice handle ^2 functions?

9. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,146
1,492
You write it as **2.

ulix likes this.
10. ### ulix Thread Starter New Member

May 21, 2015
7
0
Well, my function is: f(x)=-5.7942*10^-4 * x^2 + 0.01416x + 7.3299*10^-3. But it doesn't replay the correct value. Can I display the voltage current as function in ltspice?
The right value is: V(vr)=1.695V and 31.8mA

File size:
43.8 KB
Views:
40
11. ### ulix Thread Starter New Member

May 21, 2015
7
0
Alec_t you are great, mate! I got it. I read your post again, I didn't make a function for R, at first I did it for I.
cheers!

12. ### MikeML AAC Fanatic!

Oct 2, 2009
5,451
1,071
Sure, just plot the expression V(vr)/I(R5).

Here is an example of how to make a resistor a function of a node voltage in LTSpice. I also show how to plot the resistance of R1.

I am guessing that your function R=f(x) is not correct. I sure doesn't resemble any light bulb I have ever modeled.