find resistance value using LT spice

Thread Starter

Bigcountry

Joined Jul 4, 2008
76
I am having a hard time find the value of the R1 and R2 in the circuit using LT spice.

Notice that I drew the circuit but I get an error for R1 and R2. Of course I used KCL to solve for the resistors values. My big problem is I can not place voltage meters that are shown in the given circuit. I tried placing the label net there but could not get it work.

Any suggestion or input would be greatly appreciated.
 

Attachments

crutschow

Joined Mar 14, 2008
24,931
LTspice (or just about any Spice program) does not solve for unknown values. You have to put in estimated values.

The voltage and currents at all nodes can be determined the doing the .op analysis.
 

MikeML

Joined Oct 2, 2009
5,444
LTspice (or just about any Spice program) does not solve for unknown values. You have to put in estimated values.

The voltage and currents at all nodes can be determined the doing the .op analysis.
But it can solve this by taking advantage of LTSpice's neat functionality.

I set up three behavioral voltage sources, the first V(e1) computes the square of the error between 3.71V and V(b), the second V(e2) the square of the error between V(c) and 5.61V, and finally the third V(e3) computes the sum of the squared errors.

Goal is to find values of R1 and R2 which minimizes the sum of the squared errors (sound familiar?)

I'm using the .step Param function to explore ranges of R1 and R2 that simultaneously minimize the sum of the squared errors. This does repeated .op DC solutions

First iteration, do 81 DC solutions as R2 steps from 1Ω to 9Ω in steps of 1Ω and as R1 steps from 1Ω to 9Ω in steps of 1Ω. Plotting Log of V(e3) displays it as a family of curves vs R2 (first index being stepped). The color of the curve is the second index. You can see by inspection that the minimum sum of the squared errors occurs when R2 is near 6Ω and R1 is near 4Ω.

Two more iterations of refining the range over which R2 and R1 is stepped brings us the answer out to 4 significant figures...

Somebody want to solve a system of mesh equations in two unknowns to check this?

Ain't LTSpice wonderful? It limits you only to your own imagination...
 

Attachments

MikeML

Joined Oct 2, 2009
5,444
In the original statement of the problem, likely the voltages at V(b) and V(c) were rounded down to less significant figures. A simple .OP sim with R1=4Ω and R2=6Ω shows this...
 

Attachments

Top