Time Domain, Parameter Sweep, Multiple Input Parameters and/or variable input parameters

From the GUI, it doesn't currently look like it's possible to run a sweep across multiple parameters. More useful still would be a sweep using a variable. This would allow multiple components to be swept together. For instance one capacitor can be 5x and the other can be 1x. Then, in the simulation area, I could say, sweep: x, start:0.7, stop:1.5, step: 0.1. In this way, when components are related in a certain way, I could perform one sweep simulation to visualize the results. I come from a cadence design suite background. Your tool is much more user friendly, it just needs a couple more features to become a really powerful tool. Thanks!

by horta1212
May 26, 2013

Hi horta1212,

You might like to +1 this then:

https://www.circuitlab.com/forums/support/topic/n98tb8z5/feature-request-parameters-please/

:)

by signality
May 27, 2013

Either you've misunderstood me or I've misunderstood you. I don't see how this allows for me to sweep a variable which is NOT a parameter in the schematic. For instance, x1uF for one capacitor and x20uF for another capacitor, with x being a generic variable. It errors out telling me that the capacitor value is not a number. If I've misunderstood your other post, please clarify how I get the functionality I'm after. Thank you!

by horta1212
May 27, 2013

What you are asking for is just a particular example of the much larger superset of functionality that can be supported by parameters.

In spice you can set up a parameter that can then be used to scale any other parameter or component value in a simulation.

For instance you want to scale all your 1k and 10k resistors in a sim by 1.01 so you set a parameter:

.param scale = 1.01

then you make all your resistor values:

R1val = {scale*1k} R2val = {scale*10k}

Then you decide you want to sweep scale from 0.99 to 1.01 in steps of 0.001; you set up a step statement like this:

.step param scale 0.99 1.01 0.001

the scale parameter could be applied to any other parameter or value in any simulation.

You can set up several different parameters:

.param scale1 = 1 scale2 = 10 Cval = 1u Rval1 =1k Rval2 = 10k

and set up components:

R1val = {scale1*Rval1} R2val = {scale1*Rval2} R3val = {scale2*Rval1} R4val = {scale2*Rval2}

and then you could step them all (or at least up 3 parameters at once).

Using parameters in spice, you have a lot of control over sims and because parameters can be used in expressions, you can do some mind bogglingly clever things.

However, at present, none of this functionality is supported in CL.

Hence my Feature Request.

At present, the nearest you can get to it in CL is by using arbitrary behavioural sources and controlling values in the expressions used in them by dedicated voltage or current sources. Like the examples in this thread:

https://www.circuitlab.com/forums/support/topic/5m3ath65/how-can-i-use-a-resistor-value-to-compute-an-expression/

There are also some examples of behavioural (voltage controlled) capacitors and inductors in CL and you may be able you use the CL flux defined capacitor as a voltage controlled cap (not sure , only just thought of using the CL part that way).

However this is a very cumbersome way to do it and still does not offer the flexibility of parameters.

by signality
May 27, 2013

Ahh, gotcha. Is there any way to +1 to your feature request other than commenting on it, "Yes please" or something similar?

by horta1212
May 27, 2013

Just literally add "+1 to that" or some other comment like "me too!".

:)

by signality
May 28, 2013

Post a Reply

Please sign in or create an account to comment.

Go Ad-Free. Activate your CircuitLab membership. No more ads. Save unlimited circuits. Run unlimited simulations.

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.