=============================
SLiCAP Examples and Tutorials
=============================

SLiCAP examples and tutorials can be downloaded or cloned from `github <https://github.com/SLiCAP/SLiCAPexamples>`_. You can copy the examples at any location on your computer.

Examples use `KiCad version 9 <https://www.kicad.org/>`_ as schematic capture program. Please check if you have KiCad 9 or later installed before running these examples. If not, please upgrade or install KiCAD and delete the `SLiCAP.ini` file in your home directory. It will be regenerated by SLiCAP!

Some Examples use `LTspice <https://www.analog.com/en/resources/design-tools-and-calculators/ltspice-simulator.html>`_ as schematic capture program. Please check if you have it installed before running these examples. If not, please install it and delete the `SLiCAP.ini` file in your home directory. It will be regenerated by SLiCAP!

For help with configuring schematic capture programs to work with SLiCAP please see: `SLiCAP user guide: Create a SLiCAP circuit object <../userguide/circuit.html>`__.

Examples are organized in folders. Each folder comprises sub folders with the example source files. The example folder structure should not be altered.

The main (project) folder of an example is the one with the Python files or the Jupyter Notebook files. Running the Python code or the notebook:

#. Creates a `SLiCAP.ini` file in the project folder
#. Completes the project folder structure
#. Displayes the output in the Jupyter Notebook, or creates HTML output in the html folder.

Currently available examples are:

- `myFirstRCnetwork <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/myFirstRCnetwork>`_

   This example is the **Hello world** of SLiCAP. It is available in the form of a Python script and in the form of a Jupyter notebook and it shows you how to:
   
   - Create a circuit object from a KiCad, an LTspice or a Lepton-eda schematic file
   - Create a basic HTML report
   - Perform symbolic and numeric analysis
   - Create plots
   - Set-up and solve circuit design equations

- `FilterDesign <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/FilterDesign>`_

  This example shows how SLiCAP can be used to determine component values of a filter from both a prototype circuit and a prototype transfer function. 
  
  The filter in this example is a 4-th order Linkwitz-Riley filter that can be used as cross-over filter in loudspeaker systems.
  
- `ModelsAndLibraries <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/ModelsAndLibraries>`_

  This example shows how to use `.model` and `.lib` commands for using project-specific device libraries and models.
  
- `Reports <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/Reports>`_

  This example shows how to use SLiCAP for updating expression, tables, equations, and figures in Sphinx-generated websites and in LaTeX documents.
  
- `RootLocusPlots <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/RootLocusPlots>`_

   This example shows you how to make Root-locus plots with SLiCAP.
    
- `balancedCircuits <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/balancedCircuits>`_

   This example shows you how to decompose balanced circuits into differential-mode and common-mode equivalent circuits.
   
- `dcMatchingTracking <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/dcMatchtingTracking>`_

   This example shows you how to perform dc variance analysis with matching and tracking tolerances and temperature coefficients of resistors.

- `noiseFigure <https://github.com/SLiCAP/SLiCAPexamples/tree/main/Examples/noiseFigure>`_

   This example shows you how to perform noise analysis and calculate a noise figure of a simple resistive network.
