cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

How to solve this simple voltage summing circuit using Mathcad

yhuang-3
1-Newbie

How to solve this simple voltage summing circuit using Mathcad

Hi All, I have a simple summing circuit. Two sources  are the inputs via two resistors to generate a weighted signal Vref. Then this Vref is multiplying by a constant number "ratio" to get a Vout. The details of my circuit can be seen here:

Vsum.jpg

My target V1,V2 are within 0 to 5.3V, and target 10>"ratio">1, and all resistors should be between 10K to 1M ohm.  Right now I am not able to use if condition to solve the equation array to figure out what V1,V2,R1,R2 are.

I have uploaded my worksheet in the attachment. Would anyone teach me how can I calculate these values within the reasonable range, by maintaining the other two parameters "ratio" and "Rsum1" within their reasonable range? Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:yhuang-3)

Yes, that is my conclusion given the problem description and especially the constratints you give.

Even if you allow larger values of ratio (larger than 10) I did not find a solution where V1>0 AND V2>0.

What worries me still is the fact that when I change gues values for the Given - Find block, I can get different solutions. This means there there are multiple solutions (as I've shown above), but they all have a negative V2.

Luc

View solution in original post

78 REPLIES 78

Hi.

For a symbolic solution, you need to convert the if statements to unitary steps.

For numeric solution you need to assign some guess values.

Theoretically, you can obtain the same solutions in both cases, but there are some issues in your equations. First, with symbolics there are a resistor with a negative value. Check the equations and try again.

Best regards.

Alvaro.

Hi Alvaro, I used your worksheet and inlcuded LucMeekes' constrained conditions, now I can calculate some values. Although I have not figured out the correct solution, I still thank you for your inputs!

Hi Yhuang.

If all equations looks very similar, it's easy to make a mistake writing them.

The attached shows that selecting a ratio of 3 all the parameters are in control.

V2 is negative, but in your diagram states that current can flow in both directions, which enable any sign for the potentials.

Best regards.

Alvaro.

FIG.gif

LucMeekes
23-Emerald III
(To:yhuang-3)

Here is a solution that is physically possible (all resistor values are positive), but does NOT obey the requirement V2>0.

I have not been able to find a solution that is both physically possible AND obeys the requirement that V1>0 AND V2>0.

Here's what happens when I add those constraints:

The error message here is "No solution was found..."

Success!
Luc

Hi LucMeekes, thank you for your solution!

I tried to download your file but my MC14 cannot give out that physical  results you obtained.

First of all, it kept showing "This variable is undefined". It looks like the error message that F.M.‌ got is similar to what I have. Then I followed this thread (This variable is undefined error when using Given/Find function, why?) and deleted all the units.

Then it run, but kept "showing no solution was found", even if I put your solved value as my guess values. Do you know how can I solve this problem and make it run? Thank you!no solution was found .JPG

LucMeekes
23-Emerald III
(To:yhuang-3)

I'm sorry, I don't know. In my Mathcad 11 it just runs; with and without units.

Is the solution with V2 being negative acceptable?

Luc

-MFra-
21-Topaz II
(To:LucMeekes)

... the input signals can be positive or negative or periodic and bipolar as well.

Hi LucMeeks, yes, negative V2 is OK (although it is not preferable). I will need to modify my circuit, to implement a sum and a subtractor in different conditions. Although it is not the first choice, I will use it if there is no solution for both positive V1 and V2.

-MFra-
21-Topaz II
(To:yhuang-3)

Hi yhuang-3,

Mine is a classical analytical solution obtained with the circuit inspection.

The results are listed before the solve block which had to be  used as a verify of the previous results. 

At the end, doing a test,I tried to solve the problem with a solve block but it doesn't work.

I would appreciate a lot if someonecould tell me what changes to make, so that the solve block gives a result.

Thanks so much.

Greetings

FM

Summer.jpg

Werner_E
24-Ruby V
(To:-MFra-)

You are trying to force Mathcad to display a vector consisting of different dimensions (voltage and resistance). This does not work in Mathcad 15 and below. It should work in Prime - one of the very few benefits of Prime over Mathcad.

So don't try to display the results of the Find-function but instead assign the results to a vector consisting of distinct variables.

Here are the results your solve block comes up with:

-MFra-
21-Topaz II
(To:Werner_E)

Thank you very much Werner ... you're a genius!

Werner_E
24-Ruby V
(To:-MFra-)

Sure not!

Just using Mathcad for quite some time.

-MFra-
21-Topaz II
(To:-MFra-)

With the help of Werner, we also have the result of the solve block.

Summer.jpg

You can also modify the solve block as follows:

summer circuit solve block.jpg

Hi F.M.

Excellent development for the circuit. Just two considerations.

You forgot to include the shunt resistor RSum, without it the potential at Vref is the same of the DC source, and the gain loss their function, which is to be a summing voltage circuit.

Also, your first solve block it's ok: 4 equations with 4 unknowns, and some restrictions. But your second solve block is for 7 variables and the same number of equations, this is with 3 DOF. Restrictions are only for discard unwanted mathematical correct values, but without physical sense, or sometimes, physically correct values, but without interest for the situation.  There are some situations where the only restriction works as a kind of equation, but certainly isn't the general case.

Best regards.

Alvaro.

Edited: Sorry, your first solve block isn't ok: 4 unknwons but only 2 equations.

-MFra-
21-Topaz II
(To:AlvaroDíaz)

Hi Alvaro,

My analysis is based on the circuit I designed and whose image is at the beginning of the worksheet. In it, Rsum1 is represented by the resistor R1. I think that this is clear, so that I  don't understand how you can interpret the thing differently.

In the new  solution block, I have tried to introduce constants as variables, the values returned are in fact correct, nor is signaled any error.

Greetings

Franc

Hi F.M.

For add two potentials V1 and V2 you need at least 3 resistors. This, from wikipedia, is with inversion, but without it is the same:

FIG.gif

Notice that if Rf = 0, then Vout is zero too.

The values returned for the solve block aren't correct in the sense of the design of the circuit. You set the requirements as restriction there, but only two physical equation, the inequalities is what you want for get the system "under control", but aren't physical characteristics of your devices (resistors and gains).

Best regards.

Alvaro.

-MFra-
21-Topaz II
(To:AlvaroDíaz)

Yuhang-3 does not specify the type of amplifier used, but only that Vref is the input of  some amplifier that, it seems to me, is a not inverting one, of the following type:

non inverting summer.jpg

I have the impression that you do not care to solve the problem of yhuang-3, but, rather, extend the discussion to some hidden purpose ... So please provide some solution to the problem or some modification, be made to the solutions already found.

Thank you.

Greetings

F. M.

Hi F.M, thank you so much for your help! In my circuit, I plan to achieve the non-inverting sum of two V (Vsource1 and V1, Vsource2 and V2), the ratio can be implemented by the resistor divider connecting between the output of the conventional opamp, the inverting input node and the GND.

non inverting sum.png

I have not fully understood your solution yet.Would you advise how to map Rsum1, R1 and R2 in my circuit to your R1 and R2? Thank you!

-MFra-
21-Topaz II
(To:yhuang-3)

Hi yhuang-3, The signal sources are only two: V1 and V2 can be any bipolar signals and not, as long as the amplitudes are adequate to the inputs of the subsequent circuits. These must be added by the non-inverting summer. What do you mean writing R1/R2, V1/V2, exct.?

non inverting summer.jpg

I'm sorry to tell you .... but you're just a beginner .... 

LucMeekes
23-Emerald III
(To:-MFra-)

But the OP has as a requirement that V1 and V2 both are between 0 and 5.3 V (that implies they must be positive DC voltages).

Also there are 6 variables requested to be solved for two different circuits. Apart from R1 and R2 they are V1 and V2, Rsum1 and ratio (= the gain of the amplifier if you will). And only Rsum1 and ratio are defined as having the same value for both these circuits.

I do not find that back in your analysis.

Luc

Hi Luc.

First, there are only one circuit, a summer. Both currents goes to the gain, and the voltage output is given by a lineal combination of the inputs.

The requirement for the bounds of V1, V2 came from the knowdolage of the system. For example, isn't for a distribution between cities.

About the sign of the potentials, remember that they are always relative to some reference. Here is important, because if not, you must to set an inversor, as Yhuang mentioned. First, I believe that the circuit was, as it is more usual, an inverter adder, just because the problem states that the current can flow in both directions.

Finnaly, don't think in variables for this design problem, because some of them must to be choosed by the designer. A gain from 2 to 20 means that you can select one, check their datasheet, and see the recommended values for polarize it. This design process reduces the number of truly unknowns of your system. If you don't reduce them, and try to solve a problem under determined (more unknowns than equations) you can arrive to some nonsense solutions, like resistors very small to others very high. The physical system requires some values in some range. But you select them, for the stability and the performance of your circuit, and are not "calculated" strictly saying. You can see in the modified Fred's solution, where, even the final values are the same, he put two resistors as guesses in the solve block, but, with a very minor modification, I go to see the datasheet of the device for choose the better values.

So, from the original six problem parameters, at the end remains only two as unknows. With two equations they can be determined.

Best regards.

Alvaro.

Hi F.M.

Your expertise in the area is outside of any doubt. But it's precisely for this expertise that you forgot some obvious things: you found a solution, but don't prove it. This is, you know that those values are the corrects, but your math, for this particular problem, isn't enough strong to found the correct solution without guessing the correct values. If you states, for example, that for some physical reason, R2 must (or better, its convenient) to have some value, then can't put it back in the solve block as unknown. If you do that, open the door for issues in the math. Check the attached example of that, where all values are almost the same, but both resistors goes to zero. So, no obscure purpose, just, as you say, this is the modifications to the solutions already found (by you, mine was with invertion, which is the more common configuration).

fig.gif

Another detail was the absense of the shunt divisor. Without it, the opamp goes unstable, and, as the problem states a gain > 1, guess that without a chance of make the circuit without it: Av=1 only for the short circuit, at least in the ideal perfect lineal model.

-MFra-
21-Topaz II
(To:AlvaroDíaz)

The circuit symbol of a system that has a general amplifying function, is a triangle with a horizontal vertex which is the output while the center of the left vertical side of the same triangle, is the input. The one I drew is just that. It is not an operational amplifier. So, I can not understand, to which shunt resistor you refer.

Object.jpg

All my previous analysis was based, precisely, on this hypothesis (generic amplifying system), but also on the hypothesis that the input conductance of the amplifier  was zero.

-MFra-
21-Topaz II
(To:AlvaroDíaz)

Hence, what change could we do?

F.M. wrote:

Hence, what change could we do?

In short: In a solve block use the same number of equations than unknowns.

See the modified Fred solutions, as example.

Fred states two resistors with values of 100 kilo Ohms as guesses, and put them into a solve block with four unknowns but only two equations. After the solve block, none of them change the value.

The general solution, for this cases, is select (and not guessing, but choosing the better values given your avaible components) the resistors (as i told you to do before to do with R2), fix them, and further use your equations for get the other values.

For example, in original Fred solution, if you take R1 and Rf1 as 1 mili ohms, the result, theoretically, goes to be the same, but we know that if burn the circuit if choose those values.

Best regards.

Alvaro.

This is basically two separate problems:  The input voltage to the amplifier and the amplifier gain.

As with any voltage divider circuit the ratio of the two resistors R1/R2 and Rf1/Rf2 are the true controlling factors to be solved for; the absolute values need to be chosen based on other concerns.

If we accept the four statements  as four independent conditions, there may not enough information to solve for all six variables.

Hi Fred.

Exact! The control fo the system is given by R1/R2 and one or two more resistors, depending the configuration. In your scheme, two, which quotient determine the gain (some other ciruits arrange can get the same with only one resistor).

As physical devices, "other cencerns" mean the information from the factory about typical values, which make that device stable.

Best regards.

Alvaro.

Recasting your problem:

Hi Fred.

Your solution it's very good.

Attached the small modifications for force it to the correct math: two equations with two unknowns.

Best regards.

Alvaro.

fig.gif

Top Tags