Solving Systems of Linear Equations

brianafischer

Senior member
Apr 6, 2000
225
0
0
I am doing some research on optimization of linear systems of equations. I had a design project last semester where we designed a 4-stage BJT audio amplifier. The assignment required that we did all calculations by hand and did not use the assistance of software packages. However, I don't believe that this is the case in industry because it is VERY inefficient. After tedious hours of calculation...we finally came up with a working solution that satisfied all of the design constraints. My question now is how do people use their system of equations derived from the design to solve for the best parameters? (i.e. cap values, resisitor values and BJT type configuration)
Example:

You may have resistor values of the E12 series (1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2)
You have the constraint equations (derived from circuit analysis)
You have the project specifications

How can I find the optimal solution using the E12 resistor values in the constraint equations to satisfy the project specifications?
Whoever can answer this question is my hero!

Thanks,
Brian
 

blahblah99

Platinum Member
Oct 10, 2000
2,689
0
0
I don't know about optimizing the system, but you can usually design your amplifier around the project specifications and can pick component values that will satisfy your constraint equations. In one of my projects I had to design a 3-stage wideband feedback amplifier that satisfied a few requirements. It took a few hours come up with the system equations and another hour to pick components that would satisfy the equations and requirements. I guess it just depends on experience.
 

Remnant2

Senior member
Dec 31, 1999
567
0
0
If all you need to solve are linear equations, can you not use linear optimization via the simplex method to optimize the system of equations? I'm afraid I'm not EE so I dont' know if there are caveats to worry about, but solving a linear system is luckily something that there has been a lot of work on, and lots of software packages out there that can do it (look for LINDO, etc).

as a matter of fact, I took a course on this topic last quarter. If you want to solve it by hand, the course slides might be helpful:

Math407: Linear Optimization

Hope this is actually useful!

 

EmMayEx

Member
Mar 2, 2001
118
0
76
Brian,

I think you'd be amazed at how many "hand" calculations are still done in industry, assuming you mean using a calculator since very few people own tables of logarithms these days ;). Most designs are the result of rules of thumb and design guidelines passed down from people who've figured out what works in the first place. The useful design rules tend to be simple enough to calculate by hand so you can quickly check a component value and see if it is about right. A lot of designs are a result of applying basic design rules for biasing and impedance matching followed by a bit of tweaking to meet specific design specs. This often proves easier than going through all the trouble to build an ACCURATE circuit model (no trivial task even for "simple" circuits, especially at higher frequencies) then spending big bucks for a software package and training in how to use to optimize the circuit values. Even when you do a full optimization you may find that the optimized circuit is only slightly better than the one based on design rules and tweaking (depending on the skill of the designer).

Optimization has its place, but trying to substitue it for well established design rules and the experience to tune up a circuit "by hand" will often waste time and resources and sometimes result in disaster since the results are only as good as the mathematical model you optimize and it's easy to overlook things when you are just punching in equations and reading out component values.

As for the specific discrete optimization problem you mention there are numerous techniques, none of which work very well in all cases. The general procedure might go as follows:

Given a particular circuit optimize power consumption for a specific input waveform.
Your constraints might include:
A given Vcc
discrete ranges of component values for all resistors and capacitors
A minimum desired gain
A maximum allowable gain
Some distortion criteria or signal to noise ratio

1. You would then simulate (or breadboard) your circuit and see how it operates with initial component values.
2. You vary component values according to your constraints and look for improvements
3. Based on whatever optimization methodology you are using you decide what the "best" set of component values should be based on the effect of individual variations
4. You apply the new component values and check to see if the circuit has "improved"
5. If the circuit has improved you adopt the new component values and go to step 2
6. If no improvement you can do one of the following:
a. stop because this is as good as it gets
b. revert to the initial values and try a different method of picking which component value changes to apply (change your optimization algorithm)
c. increase the amounts you are changing the component values by since you didn't change things enough to make a difference and go to step 2

One problem is that optimizations don't always converge so you can end up improving things by changing one value only to undo that effect somewhere else. If you have a reasonable number of discrete component combinations you can just try all the combinations and pick the one that works best. Provided your initial values, constraints and goal functions are reasonable this should work but it may take a while to test every possible combination of component values, even if you have a fast computer. Otherwise, for discrete optimization problems anyway, there is no guarantee you will end up with the best possible answer.

There is a lot of stuff on the web about optimization, you might want to look up "discrete optimization algorithms" as a start.

Max L.
 

JonB

Platinum Member
Oct 10, 1999
2,126
13
81
www.granburychristmaslights.com
A friend who is taking a course in circuit design is using MatLab software. It seems to let you lay out the circuit, adjust the parameters, then it gives a list of parts using the standard industry values (your E12 resistors, for example.) It sure makes hand design look silly.
 

blahblah99

Platinum Member
Oct 10, 2000
2,689
0
0
JonB, are you sure your friend uses Matlab? Matlab only does the number crunching... I think you meant he plugged in the equations and wrote a script to find the values.
 

brianafischer

Senior member
Apr 6, 2000
225
0
0
Well... It doesn't seem that odd that Matlab would be used for this. I am not proficient at Matlab programming, but it seems logical that you could get it a set of linear equations, and a set of possible inputs, then have it give you the best results. Computers are here to enhance our abilities as engineers. I see no reason why they should not be applied to circuit analysis for the most optimal circuits. JonB, if you could tell me more or even where to learn this from I would be VERY greatful...in fact willing to pay for it!

Thanks,
Brian
 

Fandu

Golden Member
Oct 9, 1999
1,341
0
0
Is Electronics Workbench capable of the calculations that your looking for?
 

NucEm

Senior member
Jun 13, 2001
242
0
76
If you are talking about multiple linear regression analysis then you could use MS EXCEL. Initially, I used a HP41C with a math / stat module. Then I found out how to use EXCEL.
 

brianafischer

Senior member
Apr 6, 2000
225
0
0
Excel's solver is not powerful enough to handle this...it has already been attempted. The main limitation of excel's solver is that it cannot "test" the specific E12 series of resistors. I am doing some research on this pretty soon. It looks like the best solution would be Matlab. With the proper programming skills, I believe that you could test a set of input across a set of linear equations. Then manually comparing the results of each "set" of resistors with the actual value would produce the best fit solution. My problem is that I have no idea how matlab programming works, therefore am not sure if its even possible to write such a program. Keep the advice coming!

-Brian