Is this a mistake in "Op Amps for Everyone - Ron Mancini" - Page 1
Forum section: electronics / projects

author: Cicada
author_rank: Regular Contributor
timestamp: September 15, 2023, 08:35:42 am
content: HiI used Tina spice to test an op amp circuit shown on Page 422 in "Op Amps for Everyone - Ron Mancini"https://www.mikrocontroller.net/attachment/51476/slod006b.pdfI have attached this page 422 for convenience. The equation on this page does not produce the same results as Tina Spice. So I derived the equations myself. The derivation is in doc.pdf attached.Could someone tell me if I am making a big mistake?If so why does Tina Spice show my equation to be correct.I have attached the Tina Spice file as well.RegardsCicada

author: moffy
author_rank: Super Contributor
timestamp: September 15, 2023, 10:56:58 am
content: I get the same result as you: Vo = Vref*(1 + R2/R1 + R3/R1 + R3/R4 + (R2*R3)/(R1*R4)) for Vin = 0VVo = Vref*(1 + (R2 + R3)/R1 + R3/R4 + (R2*R3)/(R1*R4))P.S. The circuit if certain conditions are met: R2 >> R3 or R4, R3 >> R4 (R2 >> R1)? it becomes a way to multiply the magnitude of R2 thereby avoiding the need of very large resistors. It becomes:Vo = Vref*(1 + (R2/R1)*(R3/R4))

author: Cicada
author_rank: Regular Contributor
timestamp: September 15, 2023, 12:27:45 pm
content: It would be great if one could do these kind of simplifications using Python. Something like a symbolic match toolbox in Python. Maybe there is some Python guru on this forum that can tell us how to do what I ask in the attached pdf.I have updated the attached pdf after the original post.

author: tszaboo
author_rank: Super Contributor
timestamp: September 15, 2023, 12:44:00 pm
content: You can simplify the circuit if you do a Y-delta conversion on the feedback network.Two of the resistors becomes irrelevant.For practical purposes the circuit makes sense, but the resistor to ground in the feedback is usually a capacitor, and they use it to mess up perfect microphone amplifier characteristics.

author: ch_scr
author_rank: Frequent Contributor
timestamp: September 15, 2023, 01:14:34 pm
content: Quote from: Cicada on September 15, 2023, 12:27:45 pmThere isSKiDLto do schematic capture with python. How to do then math from this another question though.

author: Cicada
author_rank: Regular Contributor
timestamp: September 15, 2023, 01:55:36 pm
content: Quote from: Cicada on September 15, 2023, 12:27:45 pmI asked the question on stackoverflow and someone was so kind to solve the problem. This could be useful for quickly simplifying equations.https://stackoverflow.com/questions/77112181/how-do-i-use-sympy-to-simplify-by-substitution-a-number-of-equations-to-get-to-aI run my python code in a jupiter notebook usinghttps://colab.google/Thanks for all the comments.

author: The Electrician
author_rank: Frequent Contributor
timestamp: September 15, 2023, 02:15:15 pm
content: Quote from: Cicada on September 15, 2023, 12:27:45 pmThis pdf is confusing. You haven't labeled Vi and Vx on the schematic. I had to refer back to the doc in the earlier post to see where they are. There's a symbol with an upper case I on the far left. I mistakenly thought that was supposed to be Vi. The symbol on the far left should be labeled Vin as Mancini did.The coefficient of Vin from Mancini's page 422 is correct.The two forms (3) and (4) are not the same, and they're not the same as Mancini's solution.

author: Cicada
author_rank: Regular Contributor
timestamp: September 15, 2023, 02:30:34 pm
content: Quote from: The Electrician on September 15, 2023, 02:15:15 pmYou are indeed correct in stating that the pdf (Sympy question.pdf ) is incorrect. I have corrected my typos and re-uploaded the files.

author: ledtester
author_rank: Super Contributor
timestamp: September 15, 2023, 03:27:53 pm
content: Quote from: Cicada on September 15, 2023, 12:27:45 pmSee this post for an example using sympy online (https://live.sympy.org)https://www.eevblog.com/forum/beginners/increasing-the-current-handling-capability-of-linear-voltage-regulators/msg4476811/?topicseen#msg4476811And for the version of the problem in the "Sympy question.pdf" see the attachment.

author: The Electrician
author_rank: Frequent Contributor
timestamp: September 15, 2023, 06:56:22 pm
content: Quote from: ledtester on September 15, 2023, 03:27:53 pmSympy has done a bad job of solving the system, the intermediate variable "Vx" appearing in three terms of the result.

author: The Electrician
author_rank: Frequent Contributor
timestamp: September 15, 2023, 07:51:16 pm
content: Quote from: Cicada on September 15, 2023, 12:27:45 pmIt makes a lot more sense after your corrections.If you want simplifications some of the mathematical "assistants" that are available such as Maple, Mathematica, Macsyma, etc., can do the job. Here is the solution using linear algebra in Mathematica:

author: ledtester
author_rank: Super Contributor
timestamp: September 15, 2023, 09:07:01 pm
content: Quote from: The Electrician on September 15, 2023, 06:56:22 pmThe way to handle that is to add V_x as a variable to solve for, e.g.:Code:vi, vo, vx = symbols('V_i V_o V_x')r1, r2, r3, r4 = symbols('R_1 R_2 R_3 R_4')eq1 = Eq( (0-vi)/r1, (vi-vx)/r2 )eq2 = Eq( (vi-vx)/r2, (vx/r4 + (vx-vo)/r3 ) )solve([eq1, eq2], [vo, vx])

author: Someone
author_rank: Super Contributor
timestamp: September 15, 2023, 10:47:28 pm
content: Quote from: Cicada on September 15, 2023, 12:27:45 pmSteep learning curve, but SageMathCleanly groups the result:$$V_{o} = \frac{{\left(R_{1} {\left(R_{3} + R_{4}\right)} + R_{2} {\left(R_{3} + R_{4}\right)} + R_{3} R_{4}\right)} V_{i}}{R_{1} R_{4}}$$

author: The Electrician
author_rank: Frequent Contributor
timestamp: September 15, 2023, 11:08:52 pm
content: Why didn't R1(R3+R4) + R2(R3+R4) become (R1+R2)(R3+R4) ?I haven't seen yet a mathematical software that can do as good a job as a skilled human being at formatting mathematical expressions.

author: Someone
author_rank: Super Contributor
timestamp: September 15, 2023, 11:21:26 pm
content: Quote from: The Electrician on September 15, 2023, 11:08:52 pmGiven the possible representations can show different characteristics, its hard to come up with a single true/best. Much harder to turn that concept into an algorithm. Asking for the fully simplified version returns something you might not expect:$$V_{o} = \frac{{\left({\left(R_{1} + R_{2}\right)} R_{3} + {\left(R_{1} + R_{2} + R_{3}\right)} R_{4}\right)} V_{i}}{R_{1} R_{4}}$$Still more terms than your suggestion but equally useful from my perspective.For that human flourish:$$V_{o} = V_{i}\frac{{{\left(R_{1} + R_{2}\right)} R_{3} + {\left(R_{1} + R_{2} + R_{3}\right)} R_{4}}}{R_{1} R_{4}}$$or$$\frac{V_{o}}{V_{i}} = \frac{{{\left(R_{1} + R_{2}\right)} R_{3} + {\left(R_{1} + R_{2} + R_{3}\right)} R_{4}}}{R_{1} R_{4}}$$