Electronics-Related.com
Forums

Numerical Optimizer (Solver) for LTSpice

Started by Unknown July 23, 2012
bitterlemon40@yahoo.ie wrote:

>Worried? While I agree that AI has been a big flop in general I think you h= >ad better know that Evolutionary Algorithms are starting to show human comp=
You mean genetic algorithms? Those are not suitable for problems with only one solution.
>etitive results. There is a lot of 'Robot' trading on the financial market= >s for example. There are human competitive results in engineering (antennas= > for example) and science (drug design). Do some of your designers spend e= >ntire days playing around component values trying to find some elusive swee=
Wouldn't it be easier to calculate the proper values and include their real life tolerances? Can you give one practical example where your algorithm would solve a problem quicker than a good EE could? -- Failure does not prove something is impossible, failure simply indicates you are not using the right tools... nico@nctdevpuntnl (punt=.) --------------------------------------------------------------
On 07/24/2012 12:17 AM, Jeff Liebermann wrote:
> On Mon, 23 Jul 2012 18:24:19 -0700, Jim Thompson > <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote: > >> Plus I feel any circuit subject to such a tool wouldn't qualify as >> having been properly designed in the first place. >> ...Jim Thompson > > I don't know about circuit design, but in the area of antenna design, > the optimizer is a key part of the design process. With circuit > design, there may be a few parts that affect each other. In antenna > design, everything affects everything else, making every length, > spacing, and value a compromise between the various parameters (gain, > bandwidth, vswr, pattern, etc). For example, in 4NEC2, I set the > target values, establish weighing factors for the lengths and spacings > that will change, and let the program grind most of the night trying > to find an optimal compromise. I could probably get close doing all > this manually, but it's so much better and easier using an optimizer. > At the least, it allows mediocre antenna designers (like me) to do > better than mediocre work. I suspect that might also apply to > optimizers in circuit design. > > "Antenna simulation tutorial 3 - 4NEC2 optimizer and impedance > matching" > <http://www.youtube.com/watch?v=kYy6Yur127A> > > Examples of some of my antennas (not all are mine), most of which were > fed to an optimizer for the final tweaks: > <http://802.11junk.com/jeffl/antennas/> > <http://802.11junk.com/jeffl/antennas/index2.html> >
My EM simulator code uses the Nelder-Mead downhill simplex method to optimize over completely arbitrary user-defined parameters. I couldn't have done my infrared antenna gizmos without it--the materials don't have nice simple metal and dielectric behaviour at 200 THz. I thought about using a response-surface optimizer, but FDTD results aren't continuous functions of the parameters in general, and Nelder-Mead does a lot better at that than more sophisticated algorithms do. You just have to restart it a few times to make sure it hasn't got wedged, which it sometimes does. There are a couple of things I could use a SPICE optimizer for, but if I were writing it myself, I'd probably just use Nelder-Mead or simulated annealing again, because I really like being able to use arbitrary parameters. Genetic algorithms can be pretty useful for some things, especially antennas, but despite the cool name, they're just another wrench in the toolbox. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net
On 24/07/2012 13:57, Nico Coesel wrote:
> bitterlemon40@yahoo.ie wrote: > >> Worried? While I agree that AI has been a big flop in general I think you h= >> ad better know that Evolutionary Algorithms are starting to show human comp= > > You mean genetic algorithms? Those are not suitable for problems with > only one solution.
There may be better algorithms where a unique global maximum is guaranteed for example conjugate gradients, but that doesn't prevent genetic algorithms or simulated annealing from working it just means they are not the quickest way to a solution. Methods that exploit a well defined gradient structure are almost always preferable.
> >> etitive results. There is a lot of 'Robot' trading on the financial market=
I would not use that as a favourable example. High speed computer based trading is responsible for most of the insane market volatility these days - that and herd instinct. It is only a matter of time before some idiot crashes a major bank into the ground with a sophisticated double or quits bet that fails many hundreds of times in a millisecond. Last one was in 2010: http://www.thestreet.com/story/10749261/1/did-trading-error-worsen-market-plunge.html
>> s for example. There are human competitive results in engineering (antennas= >> for example) and science (drug design). Do some of your designers spend e= >> ntire days playing around component values trying to find some elusive swee= > > Wouldn't it be easier to calculate the proper values and include their > real life tolerances? Can you give one practical example where your > algorithm would solve a problem quicker than a good EE could?
Antenna design would be an obvious example where everything is a design tradeoff and multiple optima exist. You do have to worry about a design with such elusive sweet spots that an engineer cannot see how to optimise it without computer aid. The advantage of a computer optimisation algorithm is that it prevents poor engineers from cluelessly altering parameters and never making progress. A classic case would be where an optimum occurs in a steep valley at 45 degrees to two of the available tuning parameters. The same is true of focussing ion optics (where simplex is good enough) very often pairs (or more) of classical potentiometer controls have to be moved together in some well defined ratio. Computer optimisation wins because after a while it finds the eigenvectors of the matrix. I suspect the future lies with engineers defining the topology of a circuit and optimising tools adjusting things to work best. Where "best" is some subjective mixture of minimum current, cost to build and maximum efficiency. -- Regards, Martin Brown
On Tue, 24 Jul 2012 12:57:09 GMT, nico@puntnl.niks (Nico Coesel)
wrote:

>bitterlemon40@yahoo.ie wrote: > >>Worried? While I agree that AI has been a big flop in general I think you h= >>ad better know that Evolutionary Algorithms are starting to show human comp= > >You mean genetic algorithms? Those are not suitable for problems with >only one solution. > >>etitive results. There is a lot of 'Robot' trading on the financial market= >>s for example. There are human competitive results in engineering (antennas= >> for example) and science (drug design). Do some of your designers spend e= >>ntire days playing around component values trying to find some elusive swee= > >Wouldn't it be easier to calculate the proper values and include their >real life tolerances? Can you give one practical example where your >algorithm would solve a problem quicker than a good EE could?
My point exactly. I _so_ much enjoyed the "optimization" of my bandgap even if my derision and laughter directed at the manager cost me a project. ...Jim Thompson -- | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | 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, 24 Jul 2012 15:23:56 +0100, Martin Brown
<|||newspam|||@nezumi.demon.co.uk> wrote:

>On 24/07/2012 13:57, Nico Coesel wrote: >> bitterlemon40@yahoo.ie wrote: >> >>> Worried? While I agree that AI has been a big flop in general I think you h= >>> ad better know that Evolutionary Algorithms are starting to show human comp= >> >> You mean genetic algorithms? Those are not suitable for problems with >> only one solution. > >There may be better algorithms where a unique global maximum is >guaranteed for example conjugate gradients, but that doesn't prevent >genetic algorithms or simulated annealing from working it just means >they are not the quickest way to a solution. Methods that exploit a well >defined gradient structure are almost always preferable. >> >>> etitive results. There is a lot of 'Robot' trading on the financial market= > >I would not use that as a favourable example. High speed computer based >trading is responsible for most of the insane market volatility these >days - that and herd instinct. It is only a matter of time before some >idiot crashes a major bank into the ground with a sophisticated double >or quits bet that fails many hundreds of times in a millisecond. >Last one was in 2010: > >http://www.thestreet.com/story/10749261/1/did-trading-error-worsen-market-plunge.html > >>> s for example. There are human competitive results in engineering (antennas= >>> for example) and science (drug design). Do some of your designers spend e= >>> ntire days playing around component values trying to find some elusive swee= >> >> Wouldn't it be easier to calculate the proper values and include their >> real life tolerances? Can you give one practical example where your >> algorithm would solve a problem quicker than a good EE could? > >Antenna design would be an obvious example where everything is a design >tradeoff and multiple optima exist. You do have to worry about a design >with such elusive sweet spots that an engineer cannot see how to >optimise it without computer aid.
Unless you're Lan Jen Chu, one of my Professors :-)
> >The advantage of a computer optimisation algorithm is that it prevents >poor engineers from cluelessly altering parameters and never making >progress. A classic case would be where an optimum occurs in a steep >valley at 45 degrees to two of the available tuning parameters. > >The same is true of focussing ion optics (where simplex is good enough) >very often pairs (or more) of classical potentiometer controls have to >be moved together in some well defined ratio. Computer optimisation wins >because after a while it finds the eigenvectors of the matrix. > >I suspect the future lies with engineers defining the topology of a >circuit and optimising tools adjusting things to work best. > >Where "best" is some subjective mixture of minimum current, cost to >build and maximum efficiency.
Most decent Spice simulators can do at least two dimensional parameterization (and thus search for an optimum) without any particular effort on the user's part. But more degrees of freedom requires cleverness. ...Jim Thompson -- | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | 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 Mon, 23 Jul 2012 21:17:54 -0700, Jeff Liebermann <jeffl@cruzio.com>
wrote:

>On Mon, 23 Jul 2012 18:24:19 -0700, Jim Thompson ><To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote: > >>Plus I feel any circuit subject to such a tool wouldn't qualify as >>having been properly designed in the first place. >> ...Jim Thompson > >I don't know about circuit design, but in the area of antenna design, >the optimizer is a key part of the design process. With circuit >design, there may be a few parts that affect each other. In antenna >design, everything affects everything else, making every length, >spacing, and value a compromise between the various parameters (gain, >bandwidth, vswr, pattern, etc). For example, in 4NEC2, I set the >target values, establish weighing factors for the lengths and spacings >that will change, and let the program grind most of the night trying >to find an optimal compromise. I could probably get close doing all >this manually, but it's so much better and easier using an optimizer. >At the least, it allows mediocre antenna designers (like me) to do >better than mediocre work. I suspect that might also apply to >optimizers in circuit design. > >"Antenna simulation tutorial 3 - 4NEC2 optimizer and impedance >matching" ><http://www.youtube.com/watch?v=kYy6Yur127A> > >Examples of some of my antennas (not all are mine), most of which were >fed to an optimizer for the final tweaks: ><http://802.11junk.com/jeffl/antennas/> ><http://802.11junk.com/jeffl/antennas/index2.html>
Back in the dark ages, we were using Touchstone in our MW circuits class. Several of the guys had found the optimiser in it, and they would set it up and run it all night to try and find the best solutions. Me? I could never bother with it. Instead, I found there was also a parameter 'tune' function where you adjust a parameter, and then run a simulation and look at the graph of the result. I would set up almost all my values as parameters, and then Play! You take this length or that width, and start playing with the values, and then watch what the output does. Extremely educational, as you could see the effects in almost real time, giving you a great 'feel' for what values did what. Once I had a handle on it, I could optimize a filter in a few minutes, just adjusting first this parameter, and then this one. The guys using the optimiser? My favorite was the guy that was programming for a band pass filter, and forgot to put in the stop bands. His result? A single transmission line... ;-) Charlie
On Mon, 23 Jul 2012 17:59:32 -0700, bitterlemon40 wrote:

> I have written a numerical optimizer (solver) for LTSpice.
Does it run under Wine, in Linux? -- "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." (Richard Feynman)