|
20 | 20 | mc.set_parameter_deviation('Vos', 3e-4, 5e-3, 'uniform') # The keyword 'distribution' is optional |
21 | 21 | mc.prepare_testbench(num_runs=1000) # Prepares the testbench for 1000 simulations |
22 | 22 |
|
23 | | -manually_simulating_in_LTspice = False |
| 23 | +# Finally the netlist is saved to a file. This file contains all the instructions to run the simulation in LTspice |
| 24 | +mc.save_netlist('./testfiles/temp/sallenkey_mc.asc') |
| 25 | +# -- End of Example 1 -- |
24 | 26 |
|
25 | | -if manually_simulating_in_LTspice: |
26 | | - # Finally the netlist is saved to a file. This file contains all the instructions to run the simulation in LTspice |
27 | | - mc.save_netlist('./testfiles/temp/sallenkey_mc.asc') |
28 | | - # -- End of Example 1 -- |
29 | | -else: |
30 | | - # Using the Toolkit to run the simulation. |
31 | | - mc.run_testbench(runs_per_sim=100, exe_log=False) # Runs the simulation with splits of 100 runs each |
32 | | - logs = mc.read_logfiles() # Reads the log files and stores the results in the results attribute |
33 | | - logs.obtain_amplitude_and_phase_from_complex_values() # Splits the complex values into real and imaginary parts |
34 | | - logs.export_data('./temp_mc/data_testbench.csv') # Exports the data to a csv file |
35 | | - logs.plot_histogram('fcut') # Plots the histograms for the results |
36 | | - mc.cleanup_files() # Deletes the temporary files |
| 27 | +# Using the Toolkit to run the simulation. |
| 28 | +mc.run_testbench(runs_per_sim=100, exe_log=False) # Runs the simulation with splits of 100 runs each |
| 29 | +logs = mc.read_logfiles() # Reads the log files and stores the results in the results attribute |
| 30 | +logs.obtain_amplitude_and_phase_from_complex_values() # Splits the complex values into real and imaginary parts |
| 31 | +logs.export_data('./temp_mc/data_testbench.csv') # Exports the data to a csv file |
| 32 | +logs.plot_histogram('fcut') # Plots the histograms for the results |
| 33 | +mc.cleanup_files() # Deletes the temporary files |
37 | 34 |
|
38 | 35 | print("=====================================") |
39 | 36 | a = input("Make 1000 simulations ? [Y/N]") |
|
0 commit comments