Skip to content

Commit

Permalink
Adding description about the new features on the README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nunobrum committed Aug 11, 2023
1 parent a2692c2 commit b8244ca
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,23 @@ The simulation is then run from the LTSpice GUI.
```python
from PyLTSpice import SimRunner
from PyLTSpice import AscEditor
from PyLTSpice.sim.tookit.montecarlo import Montecarlo

# Force another simulatior
simulator = r"C:\Users\nunob\AppData\Local\Programs\ADI\LTspice\LTspice.exe"

# select spice model
LTC = SimRunner(output_folder='./temp', simulator=simulator)
sallenkey = AscEditor("./testfiles/salenkey.asc")

mc = Montecarlo(sallenkey, runner=LTC)

mc.set_tolerance('R', 0.01) # 1% tolerance
mc.set_tolerance('C', 0.1) # 10% tolerance
mc.set_tolerance('V', 0.1) # 10% tolerance

mc.set_parameter_deviation('Vos', 3e-4, 5e-3, 'uniform')
mc.save_netlist('./testfiles/salenkey_mc.net')
```

### LTSteps.py ###
Expand Down Expand Up @@ -212,6 +229,29 @@ for i in range(data.step_count):

print("Total number of measures found :", data.measure_count)
```
Simlarly, a worst case analysis can also be setup by using the class WorstCaseAnalysis

```python
from PyLTSpice import SimRunner
from PyLTSpice import AscEditor
from PyLTSpice.sim.tookit.worst_case import WorstCaseAnalysis

# Force another simulatior
simulator = r"C:\Users\nunob\AppData\Local\Programs\ADI\LTspice\LTspice.exe"

# select spice model
LTC = SimRunner(output_folder='./temp', simulator=simulator)
sallenkey = AscEditor("./testfiles/salenkey.asc")

mc = WorstCaseAnalysis(sallenkey, runner=LTC)

mc.set_tolerance('R', 0.01) # 1% tolerance
mc.set_tolerance('C', 0.1) # 10% tolerance
mc.set_tolerance('V', 0.1) # 10% tolerance

mc.set_parameter_deviation('Vos', 3e-4, 5e-3, 'uniform')
mc.save_netlist('./testfiles/salenkey_wc.asc')
```

The second possibility is to use the module directly on the command line

Expand Down

0 comments on commit b8244ca

Please sign in to comment.