Hello,
How to change switch state before simulation? I mean close or open without changing schematic?
Since spice is not continous simulation, switch state is not changed in the middle of simulation. Also for 4 pins voltage controlled switch, usually I apply vdd or gnd to change state.
As always, there are many ways to achieve switching during the simulation.
What kind of simulation do you want to do (tran, dc, ac …)?
I do not understand this statement. What do you want to tell us?
If we talk about transient simulation, here are two possibilites:
You may use a pulse voltage source changing between GND and VDD for simulation time based switch control .
You may use (instead of a switch) a behavioural resistor switching its resistance from low to high (or vice versa) at a specific time.
I just do DC analysis to know how much current flow and also voltage drop. So I create several loads connected by swtch. I do combination of load connected before run. Everytime i change the combination, i need to change switch on or off with changing schematic which is hassle i think.
You may use voltage controlled switches.
For the voltage source you may use a ngspice parameter.
So replace the voltage value of the source (e.g. V1) by {ctrlv} and place a statement
.param ctrlv=1
in a text box onto the Eeschema canvas. If you have switches with threshold 0.5V, on or off is determined by the parameter value and your wiring of the switch control inputs.
The only change now needed is to change the value in the .param statement (you have 2 states, 0V and 1V).