JoeyDelp / JoSIM

Superconductor Circuit Simulator
MIT License
78 stars 35 forks source link

Parameter sweep simulations #84

Open UGreco opened 1 year ago

UGreco commented 1 year ago

Hi Joey, A big thank you for creating JoSim! I would like to ask you if it is possible in JoSim to perform simulations sweeping a parameter automatically. In the documentation I see that with the .param command you can define a variable X and its value, but I don't understand if you can change the value of X in a range.

For example, I want to perform five transient analysis where I change the value of a resistor Rx each time in the range Rx = (1,2,3,4,5). Can I do that using the .param command? Best

Angelo

JoeyDelp commented 1 year ago

Hi Angelo,

Unfortunately this functionality is not supported in JoSIM. It gets quite complicated when multiple simulations need to be run with different parameters, especially in storing these parameters. Resetting the entire simulation internally to change 1 component would be fine but if there are multiple then every possible combination needs to be simulated and written as output in some way.

I.e. if you had Rx = (1,2,3,4,5) and Rz = (1,2,3,4,5) then the total combinations would be 5^2, however introducing more parameters to sweep could lead to N^N combinations that all need to be kept track of and output as different files. This could become very unwieldy.

We rather leave this to the user to do with an external script or program. It is for this reason that the library interface libjosim and python module pyjosim exists.

Hope this helps, Joey

UGreco commented 1 year ago

Hi Joey, Thank you very much for your reply. Best regards

Angelo