Modify parameters without stopping the simulation


Could something like this be implemented in QSPICE: run the simulation without stop, change the specific parameters of the components of the circuit during the simulation, and show how the waveforms are changing within the same simulation run.
It will be possible to implement such a thing in QSPICE?

You can use parameter sweep and either use list or linear

Otherwise, you can use variable capacitor, resistor, or inductor (using flux command)

I am aware of this, but this is not the point at which I am reffering now. The point is to be able to run the simulation infinitly until you explicitly pause or stop the simulation, and in this case of having the simulation going on to make changes of one or the other value of a component parameter and see in real time (so to speak to be able to see lively) how the waveform changed from current state value to the next state value due to changing of that parameter value in the same simulation window.

What you can do besides .step is make some parameters vary over time. For instance resistors. You can write R = 10 * time to make R vary over time.
You can also use if statements to make a change at certain times, like: R = 1 * if(time>100m, 10, 100).


Jope, Good idea. I will try to see. Thank you.

I am not sure why this does not work:
Am I doing something wrong?

I was expected this:

Your need to write into this. This is a special case, as your can force a resistor to behavioral resistor with R=<formula>.

Without R=, 1*if(time>100m,1,10) is assigned to <resistance>, which is an instance parameter not suppose to change during simulation.


1 Like

Thanks. In this way works.

But before, I tried in below way, but I received this error: “Fatal error: R1: missing resistance value.”

First thing first, in first attribute of resistor, if nothing is added, e.g. 10, this represents resistance = 10ohms. In this case, 10 is equivalent to Resistance=10. This doesn’t support a formula format!

If first attribute syntax is R=<formula>, this is a behavioral resistor and support formula. The formula can support .func

.param need to be a constant value in each sweep, you can setup something like this
In LTspice, you need to have a curly braces {}, but you don’t need that in Qspice.
In addition, in this example, .param Rx=1 is not essential (can delete that), whatever you setup .step param Rx, it already define Rx as a parameter for you.

1 Like

In spice, (not only Qspice), if you need to compare the effect of an instance parameter or model parameter change, we normally use .step param as @physicboy mentioned. The result is plot in waveform viewer overlay each other. In waveform viewer, press F6 can pop a Simulation Step Tool which shown you what color match to which parameter step. But currently, waveform viewer will cycle its color at every 7th step. If you need visually differentiate step result, try limiting .step within 6 step.

Just remember that, it is not common you can feed a formula into a device, except it is behavioral R, C, L or B-source…