# PSpice Ratiometric Simulations

Started by November 14, 2012
```This is not a school question. It's a real-life question.

Suppose three resistors are connected to a common node. The other end
of each resistor is connected to a voltage source.

So V1 is connected to R1, V2 is connected to R2, and V3 is connected
to R3. The opposite terminal of each resistor connects R1, R2, and R3
together.

I want to use PSpice Monte Carlo to observe the voltage at the common
node.

R1 is a 1% resistor.

R2 and R3 are two resistors in a single package. Their tolerance is 1%
but the tolerance of their ratio is 0.1%.

How can PSpice Monte Carlo be used to accurately determine the
possible voltages of the common node?
```
```On Wednesday, November 14, 2012 6:48:34 AM UTC+2, Bob Penoyer wrote:
> This is not a school question. It's a real-life question.
>
>
>
> Suppose three resistors are connected to a common node. The other end
>
> of each resistor is connected to a voltage source.
>
>
>
> So V1 is connected to R1, V2 is connected to R2, and V3 is connected
>
> to R3. The opposite terminal of each resistor connects R1, R2, and R3
>
> together.
>
>
>
> I want to use PSpice Monte Carlo to observe the voltage at the common
>
> node.
>
>
>
> R1 is a 1% resistor.
>
>
>
> R2 and R3 are two resistors in a single package. Their tolerance is 1%
>
> but the tolerance of their ratio is 0.1%.
>
>
>
> How can PSpice Monte Carlo be used to accurately determine the
>
> possible voltages of the common node?

This might get you started. Got the basic idea from elsewhere on the web , so no
credit to me :0) It does a worst case analysis 1% on all resistors , but I have NOT done the 0.1% ratio calculation. I'm sure someone can improve  , but it will get you started.
Use LTSpice.

Version 4
SHEET 1 880 680
WIRE 176 -32 16 -32
WIRE 320 -32 176 -32
WIRE 432 -32 320 -32
WIRE 16 16 16 -32
WIRE 176 16 176 -32
WIRE 320 16 320 -32
WIRE 16 160 16 96
WIRE 176 160 176 96
WIRE 320 160 320 96
WIRE 176 240 16 240
WIRE 320 240 176 240
WIRE 176 256 176 240
FLAG 176 256 0
FLAG 432 -32 Vout
SYMBOL voltage 16 144 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value 1
SYMATTR Value2 ""
SYMATTR SpiceLine ""
SYMBOL voltage 176 144 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value 2
SYMATTR Value2 ""
SYMATTR SpiceLine ""
SYMBOL voltage 320 144 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V3
SYMATTR Value 3
SYMATTR Value2 ""
SYMATTR SpiceLine ""
SYMBOL res 0 0 R0
WINDOW 3 -70 117 Left 2
SYMATTR InstName R1
SYMATTR Value {wc_a({R1},tola)}
SYMBOL res 160 0 R0
WINDOW 3 -32 119 Left 2
SYMATTR InstName R2
SYMATTR Value {wc_a({R2},tola)}
SYMBOL res 304 0 R0
WINDOW 3 68 68 Left 2
SYMATTR InstName R3
SYMATTR Value {wc_a({R3},tola)}
TEXT -264 -24 Left 2 !.param tola=0.01
TEXT -264 296 Left 2 !.function wc_a(nom,tola) if(run==1,nom,if(flat(1)>0,nom*(1+tola),nom*(1-tola)))
TEXT -264 -64 Left 2 !.step param run 1 40 1
TEXT -264 328 Left 2 !.tran 1
TEXT -264 24 Left 2 !.param R1 = 1k
TEXT -264 64 Left 2 !.param R2 = 2k
TEXT -264 104 Left 2 !.param R3 = 2k
```
```On Tue, 13 Nov 2012 20:48:17 -0800, Bob Penoyer
<bob@NOSPAMbobpenoyer.com> wrote:

>This is not a school question. It's a real-life question.
>
>Suppose three resistors are connected to a common node. The other end
>of each resistor is connected to a voltage source.
>
>So V1 is connected to R1, V2 is connected to R2, and V3 is connected
>to R3. The opposite terminal of each resistor connects R1, R2, and R3
>together.
>
>I want to use PSpice Monte Carlo to observe the voltage at the common
>node.
>
>R1 is a 1% resistor.
>
>R2 and R3 are two resistors in a single package. Their tolerance is 1%
>but the tolerance of their ratio is 0.1%.
>
>How can PSpice Monte Carlo be used to accurately determine the
>possible voltages of the common node?

Parameterize the _value_ of R2 and R3.  Then Monte Carlo on the
parameter and the ratio?

...Jim Thompson
--
| James E.Thompson, CTO                            |    mens     |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

I love to cook with wine.     Sometimes I even put it in the food.
```
```On Tue, 13 Nov 2012 20:48:17 -0800, Bob Penoyer
<bob@NOSPAMbobpenoyer.com> wrote:

>This is not a school question. It's a real-life question.
>
>Suppose three resistors are connected to a common node. The other end
>of each resistor is connected to a voltage source.
>
>So V1 is connected to R1, V2 is connected to R2, and V3 is connected
>to R3. The opposite terminal of each resistor connects R1, R2, and R3
>together.
>
>I want to use PSpice Monte Carlo to observe the voltage at the common
>node.
>
>R1 is a 1% resistor.
>
>R2 and R3 are two resistors in a single package. Their tolerance is 1%
>but the tolerance of their ratio is 0.1%.
>
>How can PSpice Monte Carlo be used to accurately determine the
>possible voltages of the common node?

You could make R2 and R3 each from two resistors in series, and apply
different Monte Carlo rules to them, specifically lock R2A and R3A to
the same value and flog them 1%, but let the other two be independent
and vary 0.1%.

Something could be done with a Y-configuration representing R2 and R3,
but takes more thinking.

--

John Larkin                  Highland Technology Inc
www.highlandtechnology.com   jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME  analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators
```
```Jim Thompson a &#2013265929;crit :
> On Tue, 13 Nov 2012 20:48:17 -0800, Bob Penoyer
> <bob@NOSPAMbobpenoyer.com> wrote:
>
>> This is not a school question. It's a real-life question.
>>
>> Suppose three resistors are connected to a common node. The other end
>> of each resistor is connected to a voltage source.
>>
>> So V1 is connected to R1, V2 is connected to R2, and V3 is connected
>> to R3. The opposite terminal of each resistor connects R1, R2, and R3
>> together.
>>
>> I want to use PSpice Monte Carlo to observe the voltage at the common
>> node.
>>
>> R1 is a 1% resistor.
>>
>> R2 and R3 are two resistors in a single package. Their tolerance is 1%
>> but the tolerance of their ratio is 0.1%.
>>
>> How can PSpice Monte Carlo be used to accurately determine the
>> possible voltages of the common node?
>
> Parameterize the _value_ of R2 and R3.  Then Monte Carlo on the
> parameter and the ratio?
>

The real question being: does one need spice for such a simple answer
that should take no more than 2 or 3 lines?

--
Thanks,
Fred.
```
```On Wed, 14 Nov 2012 21:06:17 +0100, Fred Bartoli <" "> wrote:

>Jim Thompson a &#2013265929;crit :
>> On Tue, 13 Nov 2012 20:48:17 -0800, Bob Penoyer
>> <bob@NOSPAMbobpenoyer.com> wrote:
>>
>>> This is not a school question. It's a real-life question.
>>>
>>> Suppose three resistors are connected to a common node. The other end
>>> of each resistor is connected to a voltage source.
>>>
>>> So V1 is connected to R1, V2 is connected to R2, and V3 is connected
>>> to R3. The opposite terminal of each resistor connects R1, R2, and R3
>>> together.
>>>
>>> I want to use PSpice Monte Carlo to observe the voltage at the common
>>> node.
>>>
>>> R1 is a 1% resistor.
>>>
>>> R2 and R3 are two resistors in a single package. Their tolerance is 1%
>>> but the tolerance of their ratio is 0.1%.
>>>
>>> How can PSpice Monte Carlo be used to accurately determine the
>>> possible voltages of the common node?
>>
>> Parameterize the _value_ of R2 and R3.  Then Monte Carlo on the
>> parameter and the ratio?
>>
>
>The real question being: does one need spice for such a simple answer
>that should take no more than 2 or 3 lines?

You didn't include the "2 or 3 lines" ?:-)

...Jim Thompson
--
| James E.Thompson, CTO                            |    mens     |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

I love to cook with wine.     Sometimes I even put it in the food.
```
```Jim Thompson a &#2013265929;crit :
> On Wed, 14 Nov 2012 21:06:17 +0100, Fred Bartoli <" "> wrote:
>
>> Jim Thompson a &#2013265929;crit :
>>> On Tue, 13 Nov 2012 20:48:17 -0800, Bob Penoyer
>>> <bob@NOSPAMbobpenoyer.com> wrote:
>>>
>>>> This is not a school question. It's a real-life question.
>>>>
>>>> Suppose three resistors are connected to a common node. The other end
>>>> of each resistor is connected to a voltage source.
>>>>
>>>> So V1 is connected to R1, V2 is connected to R2, and V3 is connected
>>>> to R3. The opposite terminal of each resistor connects R1, R2, and R3
>>>> together.
>>>>
>>>> I want to use PSpice Monte Carlo to observe the voltage at the common
>>>> node.
>>>>
>>>> R1 is a 1% resistor.
>>>>
>>>> R2 and R3 are two resistors in a single package. Their tolerance is 1%
>>>> but the tolerance of their ratio is 0.1%.
>>>>
>>>> How can PSpice Monte Carlo be used to accurately determine the
>>>> possible voltages of the common node?
>>> Parameterize the _value_ of R2 and R3.  Then Monte Carlo on the
>>> parameter and the ratio?
>>>
>> The real question being: does one need spice for such a simple answer
>> that should take no more than 2 or 3 lines?
>
> You didn't include the "2 or 3 lines" ?:-)
>

Come on...
I carefully wrote 1 2/3 lines to hint you in the right direction,
leaving you 1 1/3 line to complete the answer :-)
Now you have between 20 and 30 characters left. That's getting to be tough.

--
Thanks,
Fred.
```
```On Wed, 14 Nov 2012 21:48:54 +0100, Fred Bartoli <" "> wrote:

>Jim Thompson a &#2013265929;crit :
>> On Wed, 14 Nov 2012 21:06:17 +0100, Fred Bartoli <" "> wrote:
>>
>>> Jim Thompson a &#2013265929;crit :
>>>> On Tue, 13 Nov 2012 20:48:17 -0800, Bob Penoyer
>>>> <bob@NOSPAMbobpenoyer.com> wrote:
>>>>
>>>>> This is not a school question. It's a real-life question.
>>>>>
>>>>> Suppose three resistors are connected to a common node. The other end
>>>>> of each resistor is connected to a voltage source.
>>>>>
>>>>> So V1 is connected to R1, V2 is connected to R2, and V3 is connected
>>>>> to R3. The opposite terminal of each resistor connects R1, R2, and R3
>>>>> together.
>>>>>
>>>>> I want to use PSpice Monte Carlo to observe the voltage at the common
>>>>> node.
>>>>>
>>>>> R1 is a 1% resistor.
>>>>>
>>>>> R2 and R3 are two resistors in a single package. Their tolerance is 1%
>>>>> but the tolerance of their ratio is 0.1%.
>>>>>
>>>>> How can PSpice Monte Carlo be used to accurately determine the
>>>>> possible voltages of the common node?
>>>> Parameterize the _value_ of R2 and R3.  Then Monte Carlo on the
>>>> parameter and the ratio?
>>>>
>>> The real question being: does one need spice for such a simple answer
>>> that should take no more than 2 or 3 lines?
>>
>> You didn't include the "2 or 3 lines" ?:-)
>>
>
>Come on...
>I carefully wrote 1 2/3 lines to hint you in the right direction,
>leaving you 1 1/3 line to complete the answer :-)
>Now you have between 20 and 30 characters left. That's getting to be tough.

I was yanking your chain.  It's a simple Algebraic expression.  I
don't (generally) do Monte Carlo... I do worst case.  If I pass worst
case I know I'll pass _any_ Monte Carlo.

...Jim Thompson
--
| James E.Thompson, CTO                            |    mens     |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

I love to cook with wine.     Sometimes I even put it in the food.
```
```On 14.11.12 6:48 , Bob Penoyer wrote:
> This is not a school question. It's a real-life question.
>
> Suppose three resistors are connected to a common node. The other end
> of each resistor is connected to a voltage source.
>
> So V1 is connected to R1, V2 is connected to R2, and V3 is connected
> to R3. The opposite terminal of each resistor connects R1, R2, and R3
> together.
>
> I want to use PSpice Monte Carlo to observe the voltage at the common
> node.
>
> R1 is a 1% resistor.
>
> R2 and R3 are two resistors in a single package. Their tolerance is 1%
> but the tolerance of their ratio is 0.1%.
>
> How can PSpice Monte Carlo be used to accurately determine the
> possible voltages of the common node?
>

You can use the known ratio tolerance, if you change the
circuit part with R2, R3, V2, and V3 to a de Thevenin
equivalent circuit, applying the resistance tolerance
to the internal resistance and the ratio tolerance to
the equivalent EMF of the de Thevenin voltage source.

--

Tauno Voipio

```
```On Wed, 14 Nov 2012 13:52:29 -0700, Jim Thompson wrote:

> On Wed, 14 Nov 2012 21:48:54 +0100, Fred Bartoli <" "> wrote:
>
>>Jim Thompson a &eacute;crit :
>>> On Wed, 14 Nov 2012 21:06:17 +0100, Fred Bartoli <" "> wrote:
>>>
>>>> Jim Thompson a &eacute;crit :
>>>>> On Tue, 13 Nov 2012 20:48:17 -0800, Bob Penoyer
>>>>> <bob@NOSPAMbobpenoyer.com> wrote:
>>>>>
>>>>>> This is not a school question. It's a real-life question.
>>>>>>
>>>>>> Suppose three resistors are connected to a common node. The other
>>>>>> end of each resistor is connected to a voltage source.
>>>>>>
>>>>>> So V1 is connected to R1, V2 is connected to R2, and V3 is
>>>>>> connected to R3. The opposite terminal of each resistor connects
>>>>>> R1, R2, and R3 together.
>>>>>>
>>>>>> I want to use PSpice Monte Carlo to observe the voltage at the
>>>>>> common node.
>>>>>>
>>>>>> R1 is a 1% resistor.
>>>>>>
>>>>>> R2 and R3 are two resistors in a single package. Their tolerance is
>>>>>> 1% but the tolerance of their ratio is 0.1%.
>>>>>>
>>>>>> How can PSpice Monte Carlo be used to accurately determine the
>>>>>> possible voltages of the common node?
>>>>> Parameterize the _value_ of R2 and R3.  Then Monte Carlo on the
>>>>> parameter and the ratio?
>>>>>
>>>> The real question being: does one need spice for such a simple answer
>>>> that should take no more than 2 or 3 lines?
>>>
>>> You didn't include the "2 or 3 lines" ?:-)
>>>
>>>
>>Come on...
>>I carefully wrote 1 2/3 lines to hint you in the right direction,
>>leaving you 1 1/3 line to complete the answer :-) Now you have between
>>20 and 30 characters left. That's getting to be tough.
>
> I was yanking your chain.  It's a simple Algebraic expression.  I don't
> (generally) do Monte Carlo... I do worst case.  If I pass worst case I
> know I'll pass _any_ Monte Carlo.
>
>                                         ...Jim Thompson

Worst case in this instance means only testing eight points, so one does
wonder why they can't start there...

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
```