dyrun


Namedyrun JSON
Version 1.1.11 PyPI version JSON
download
home_pagehttps://github.com/abolfazldelavar/dyrun
SummaryEasy way to simulation
upload_time2023-05-22 16:38:45
maintainer
docs_urlNone
authorAbolfazl Delavar
requires_python>=3.6
licenseMIT
keywords control simulation academic mathematics differential closed-loop numberical calculation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://github.com/abolfazldelavar/dyrun/blob/main/logo.png?raw=true" align="right" width="300" alt="header pic"/>

# Dynamic Runner (DYRUN)

This Python-based basement environment is designed for simulating dynamical systems, including differential equations, and visualizing their results, which can be particularly useful for academic research and paper presentations. `dyrun` is a simple tool that facilitates simulations expeditiously and effortlessly, using invaluable instruments for modeling linear and nonlinear dynamic systems. This formidable instrument is capable of executing **differential mathematical equations** [1] and is advantageous for

* **Control engineering**,
* **Estimation** [2, 3],
* **Encryption** [4],
* and **Neuroscience** [5, 6].

Researchers who wish to delve into the realm of dynamic and control systems will find this package to be an invaluable resource.

# License

MIT license

# Author

Abolfazl Delavar
- Email: faryadell [at] gmail [dot] com
- Webpage: https://github.com/abolfazldelavar

"*Successful people are those who can build solid foundations with the bricks others throw at them.*"

# Instructions

## Installation

To install the full package, run the below code:

```
pip install dyrun
```

To build a new project, just run the following order:

```
dyrun DIR_NAME
```

If the package has been installed, you can update it by:

```
pip install --upgrade dyrun
```

where the **DIR_NAME** denotes the folder you wish to create the project.

## First trying

The main file of this package is `dyrun.py`, which can be run easily using:

```
python3 dyrun.py
```

However, the jupyter format of that is also provided in order to have better control on each section of that.
It is recommended you to modify `dyrun.ipynb` file to make the most of jupyter tools and facilities.
All sections will be introduced in the following.

## The structure of `dyrun.ipynb`

The notebook is organized into the following sections: **Introduction:**, **Requirements:**, **Custom Functions:**, **Parameters:**, **Signals:**, **Models:**, **Main:**, **Execution:**, **Illustration:**, and **Preservation:**.

The notebook is designed to be self-contained and easy to follow, even for users who are new to dynamic simulations and the `dyrun` library.
The only effort you must make is to read the instruction presented in `dyrun.ipynb` and this guideline.

<details>
    <summary><h3> Introduction </h3></summary>
    A brief overview of the *dyrun* library and its main features.
</details>

<details>
    <summary><h3> Requirements </h3></summary>
    The external dependencies utilized in the project are documented in this section.
</details>

<details>
    <summary><h3> Custom Functions </h3></summary>
    Any custom functions for the project are defined in this section.
</details>

<details>
    <summary><h3> Parameters </h3></summary>
    This section establishes the static quantities such as model parameters used throughout the entire project.
</details>

<details>
    <summary><h3> Signals </h3></summary>
    This section is designated for the definition of any signals and array variables.
</details>

<details>
    <summary><h3> Models </h3></summary>
    Dynamic objects and those that are not as elementary as an array must be included in this section.
</details>

<details>
    <summary><h3> Main </h3></summary>
    This section contains the simulation function that is used to run the project.
</details>

<details>
    <summary><h3> Execution </h3></summary>
    This section contains the code snippet to run the project.
</details>

<details>
    <summary><h3> Illustration </h3></summary>
    This section is used to display the results of the simulation.
</details>

<details>
    <summary><h3> Preservation </h3></summary>
    This section is used to store data.
</details>


## Requirements

The file named `core/lib/required_libraries.py` is where the crucial requirements are loaded and used througout the project. You will not need it normally, unless you wish to use a specific library in the whole project. In other words, all addition requirements should be called in the requirements section of `dyrun` file. For instance, as long as the project needs to use a specific model file (This will be discussed in the following parts of this instrustion), they should be called by `from blocks.general_blocks import *` in this important section.

## Libraries

In this section, all available libraries that can be utilized for better managing your projects are given.

<details>
    <summary><h2> `Clib` </h2></summary>

This pre-imported library which you can find it in the **requirements** section of the `dyrun.ipynb`, brings you several useful functions, which will be elaborated now:

1. `set_timer(ID)`: This function sets the timer and initializes the simulation. It also sets up the logging module, creates a log file in the `logs` directory with the name `<ID>.log`, and writes a message to the log file indicating that the simulation has started.
    * `ID` (input) - The id number of the simulation; it is usually unique.
    * Output: The current time at the moment that the function is called.

2. `end_report(start_time)`: This function reports the end of the simulation and the time it took to run. It calculates the elapsed time since the simulation started, formats it as a string, and writes a message to the log file indicating that the simulation has ended and the elapsed time.
    * `start_time` (input) - The time the simulation was started (returned by `set_timer()`).
    * Output: None.

3. `get_now(report_type=0, splitter_char='_')`: This function returns a string containing the current date and time in the specified format. The format of the output string depends on the value of `report_type` and `splitter_char`. The function gets the current date and time using the `datetime.now()` method, formats it according to the specified format, and returns the formatted string.
    * `report_type` (input, optional) - The type of report to generate. The default value is `0`.
        * 0: YMDHMS
        * 1: YMD_HMS
        * 2: Y_M_D_H_M_S
        * 3: YMD_HM
        * 4: YMD_HM
        * 5: Y_M_D
        * 6: H_M_S
    * `splitter_char` (input, optional) - The character used to separate the different parts of the date and time. The default value is `'_'`.
    * Output: A string containing the current date and time in the specified format.

Certainly! Here are the revised instructions for the `Clib` class, which provides several useful functions related to file I/O. For each function, I've provided a brief description of its operation, along with the input variables and output variables:

4. `diary(message, no_print=False)`: This function is used to put the message in the diary file as well as to print it to the console. It writes the message to the log file using the `logging` module and also prints the message to the console if `no_print` is `False`.
    * `message` (input) - The message that you want to show or put in the diary.
    * `no_print` (input, optional) - A boolean value that specifies whether to disable printing to the console. The default value is `False`.
    * Output: None.

5. `save_csv(tensor, name, zip=False)`: This function saves the given data in a `.csv` file. If `zip` is `True`, it creates a `.zip` file with the same name as the `.csv` file and saves it in the same directory.
    * `tensor` (input) - The data that you want to save, e.g., matrices or numerical vectors.
    * `name` (input) - The path including the name of the file where you want to save the data. For example, `data/outputs/TensorFileName`.
    * `zip` (input, optional) - A boolean value that specifies whether to save the data as a `.zip` file. The default value is `False`.
    * Output: None.

6. `load_csv(name, maxsize=1000)`: This function loads the content of the given `.csv` file saved by `save_cvs()`. If the data file is too large, it can be restricted by specifying the maximum file size in MB using the `maxsize` option.
    * `name` (input) - The path including the name of the `.csv` file from which you want to load the data. For example, `data/outputs/TensorFileName`.
    * `maxsize` (input, optional) - An integer value that specifies the maximum size of the file to be loaded in MB. The default value is `1000`.
    * Output: The loaded data in the form of a NumPy array.

7. `save_npy(tensor, name, zip=False)`: This function saves the given `tensor` as a `.npy` file with the specified `name`. If `zip=True`, the function saves the tensor as a `.zip` file instead of a `.npy` file.
    * `tensor` (input) - The data to be saved, such as a matrix or numerical vector.
    * `name` (input) - The path and name of the file to be saved, e.g. `data/outputs/TensorFileName`.
    * `zip` (input, optional) - A boolean value that specifies whether to save the data as a `.zip` file. The default value is `False`.
    * Output: None.

8. `load_npy(name)`: This function loads the content of the given `.npy` file with the specified `name`.
    * `name` (input) - The path and name of the file to be loaded, e.g. `data/outputs/TensorFileName`.
    * Output: The loaded tensor data.

9. `delayed(signal, k, delay_steps)`: This function creates a delayed version of a discrete signal.
    * `signal` (input): The full signal.
    * `k` (input): The current point in the signal.
    * `delay_steps` (input): The amount of delay in integer steps.
    * Output: The delayed signal value.

10. `sigmoid(time_line, bias, alph, area)`: This method generates a sigmoid function signal.
    * `time_line` (input): The time line.
    * `bias` (input): The time shift bias.
    * `alph` (input): The smoother.
    * `area` (input): The domain in the form of a list `[a, b]`.
    * Output: The output signal.

11. `exp_f(time_line, decay_rate, area)`: This method generates an exponential function signal.
    * `time_line` (input): The time line.
    * `decay_rate` (input): The decay rate.
    * `area` (input): The domain in the form of a list `[a, b]`.
    * Output: The output signal.

12. `linear_mapping(x, current_area, target_area)`: This method linearly maps the input `x` from the domain `[a1, b1]` to the range `[a2, b2]`.
    * `x` (input): The input array.
    * `current_area` (input): The domain `[a1, b1]`.
    * `target_area` (input): Therange `[a2, b2]`.
    * Output: The output array.

To use these functions, you can call them as static methods of the `Clib` class. For example, to save a tensor, you can call `Clib.save_npy(tensor, name)`, where `tensor` is the data to be saved, and `name` is the path and name of the file to be saved.
</details>

<details>
    <summary> <h2> `Plib` </h2></summary>

This pre-imported library which you can find it in the **requirements** section of the `dyrun.ipynb`, provides several practical functions related to illustration purposes. The following methods are available:


The `Plib` class provides several practical functions related to illustration purposes. The following methods are available:

1. `initialize()`: This function initializes the environment and sets the `font.family`, `font.size`, and `text.usetex` to any further draws. Furthermore, the size of plot windows and several other essential properties are adjusted. There is no input to this function. Note that it is recommended to make sure the last `latex` package (like `TexLive`) has been installed in your systems. you can download from <a target="_blank" href="https://www.tug.org/texlive/">here</a>. It is used to draw for academic purposes. If you do not have `ltex`, you can temporarily ignore this function, although it is suggested to use it.
    * Output: None.

2. `isi(params, fig = 0, save = False, width = 8.5, hw_ratio = 0.65)`: This function makes plots prettier and ready to use in academic purposes. The inputs to this function are:
    * `params` (input): a string that describes the plot.
    * `fig` (input, optional): the figure handler; use `h = plt.figure(tight_layout=True)` to create one.
    * `save` (input, optional): a string that specifies the name of the file to save the illustration, or just insert `True`.
    * `width` (input, optional): a float that represents the width of the figure in inches; default is `8.5`.
    * `hw_ratio` (input, optional): a float that represents the height to width ratio between `0` and `1`; default is `0.65`.
    * Output: None.

3. `save_figure(params, save=True, fig=plt.gcf(), dpi=300)`: This function can be used to save a figure/plot as an image file. The inputs to this function are:
    * `params` (input): An object that contains various parameters related to the current run of the program.
    * `save` (input, optional): A boolean or string value that specifies whether to save the figure or not. If a string value is provided, it is used as the **filename** for the saved image.
    * `fig` (input, optional): A matplotlib figure object that represents the current figure/plot to be saved.
    * `dpi` (input, optional): An integer value that specifies the resolution of the saved image file in dots per inch.
    * Output: None.

4. `linear_gradient(colors, locs, n=256, show=False)`: This function can be used to generate a linear gradient of colors. The inputs to this function are:
    * `colors` (input): A list of color values in RGBA format. For example, `[[1, 0, 0, 1], [1, 1, 1, 1], [0, 0, 0, 1]]` represents a gradient from red to white to black.
    * `locs` (input): A list of values between 0 and 1 that specify the location of each color in the gradient.
    * `n` (input, optional): An integer value that specifies the number of colors in the output gradient. Default value is `256`.
    * `show` (input, optional): A boolean value that, if set to True, shows a plot of the generated gradient.
    * Output: The output of this function is an array of colors that represents the generated gradient.

5. `cmap_maker(name, colors, n=256)`: This function can be used to create a Linear Segmented Color Map (LSCM) using the given colors and their locations. The inputs to this function are:
    * `name` (input): A string that specifies the name of the color map.
    * `colors` (input): A list of tuples where each tuple contains a value between 0 and 1 (specifying the location of the color on the graph line) and a color value in any valid format (e.g., `#FF0000` for red).
    * `n` (input, optional): An integer value that specifies the number of colors in the output color map. Default value is `256`.
    * Output: The output of this function is a matplotlib colormap object that can be used for visualizations.

To use these functions, you can call them as static methods of the `Plib` class, similar to `Clib`.
</details>


<details>
    <summary> <h2> `eclib` </h2></summary>
    This is a Python library for numerical simulation of encrypted control.
    You have to import the library you need in the requirements section. For instance, to utilize `Paillier`, insert `import core.lib.eclib.paillier as pai` and use `pai` in the whole project.
    Visit <a target="_blank" href="https://github.com/KaoruTeranishi/EncryptedControl">EncryptedControl</a> [4] for more information.
</details>

## A survey on `Scope` class

...

## Questions

<details>
    <summary> <h4> How to model an LTI system?</h4></summary>
</details>

<details>
    <summary> <h4> How to model a nonlinear system?</h4></summary>
</details>

<details>
    <summary> <h4> How to model a network including nonlinear agents?</h4></summary>
</details>

# References

[1]. Butcher, John C. (2003). Numerical Methods for Ordinary Differential Equations. New York: John Wiley & Sons. ISBN 978-0-471-96758-3.

[2]. Simon, Dan (2006). Optimal State Estimation. Hoboken, NJ: John Wiley & Sons. ISBN 978-0-471-70858-2.

[3]. E. A. Wan and R. Van Der Merwe, "The unscented Kalman filter for nonlinear estimation," Proceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No.00EX373), Lake Louise, AB, Canada, 2000, pp. 153-158, doi: 10.1109/ASSPCC.2000.882463.

[4]. Teranishi K, Encrypted control library, github. https://github.com/KaoruTeranishi/EncryptedControl

[5]. Izhikevich, E. M. (2003). Simple model of spiking neurons. IEEE Transactions on Neural Networks, 14(6), 1569-1572.

[6]. Ullah, M., Fletcher, A. E. C., & Hake, J. (2006). The Role of Calcium Release-Activated Calcium Currents in Bursting Pacemaker Activity of Nucleus Ambiguus Neurons. Journal of Computational Neuroscience, 21(3), 271-282.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/abolfazldelavar/dyrun",
    "name": "dyrun",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Control,Simulation,Academic,Mathematics,Differential,Closed-loop,Numberical calculation",
    "author": "Abolfazl Delavar",
    "author_email": "faryadell@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/90/02/3c0c5f03eb7beb7cf5490705160e8af847cb67511dbdb864ccd873b0305e/dyrun-1.1.11.tar.gz",
    "platform": null,
    "description": "<img src=\"https://github.com/abolfazldelavar/dyrun/blob/main/logo.png?raw=true\" align=\"right\" width=\"300\" alt=\"header pic\"/>\n\n# Dynamic Runner (DYRUN)\n\nThis Python-based basement environment is designed for simulating dynamical systems, including differential equations, and visualizing their results, which can be particularly useful for academic research and paper presentations. `dyrun` is a simple tool that facilitates simulations expeditiously and effortlessly, using invaluable instruments for modeling linear and nonlinear dynamic systems. This formidable instrument is capable of executing **differential mathematical equations** [1] and is advantageous for\n\n* **Control engineering**,\n* **Estimation** [2, 3],\n* **Encryption** [4],\n* and **Neuroscience** [5, 6].\n\nResearchers who wish to delve into the realm of dynamic and control systems will find this package to be an invaluable resource.\n\n# License\n\nMIT license\n\n# Author\n\nAbolfazl Delavar\n- Email: faryadell [at] gmail [dot] com\n- Webpage: https://github.com/abolfazldelavar\n\n\"*Successful people are those who can build solid foundations with the bricks others throw at them.*\"\n\n# Instructions\n\n## Installation\n\nTo install the full package, run the below code:\n\n```\npip install dyrun\n```\n\nTo build a new project, just run the following order:\n\n```\ndyrun DIR_NAME\n```\n\nIf the package has been installed, you can update it by:\n\n```\npip install --upgrade dyrun\n```\n\nwhere the **DIR_NAME** denotes the folder you wish to create the project.\n\n## First trying\n\nThe main file of this package is `dyrun.py`, which can be run easily using:\n\n```\npython3 dyrun.py\n```\n\nHowever, the jupyter format of that is also provided in order to have better control on each section of that.\nIt is recommended you to modify `dyrun.ipynb` file to make the most of jupyter tools and facilities.\nAll sections will be introduced in the following.\n\n## The structure of `dyrun.ipynb`\n\nThe notebook is organized into the following sections: **Introduction:**, **Requirements:**, **Custom Functions:**, **Parameters:**, **Signals:**, **Models:**, **Main:**, **Execution:**, **Illustration:**, and **Preservation:**.\n\nThe notebook is designed to be self-contained and easy to follow, even for users who are new to dynamic simulations and the `dyrun` library.\nThe only effort you must make is to read the instruction presented in `dyrun.ipynb` and this guideline.\n\n<details>\n    <summary><h3> Introduction </h3></summary>\n    A brief overview of the *dyrun* library and its main features.\n</details>\n\n<details>\n    <summary><h3> Requirements </h3></summary>\n    The external dependencies utilized in the project are documented in this section.\n</details>\n\n<details>\n    <summary><h3> Custom Functions </h3></summary>\n    Any custom functions for the project are defined in this section.\n</details>\n\n<details>\n    <summary><h3> Parameters </h3></summary>\n    This section establishes the static quantities such as model parameters used throughout the entire project.\n</details>\n\n<details>\n    <summary><h3> Signals </h3></summary>\n    This section is designated for the definition of any signals and array variables.\n</details>\n\n<details>\n    <summary><h3> Models </h3></summary>\n    Dynamic objects and those that are not as elementary as an array must be included in this section.\n</details>\n\n<details>\n    <summary><h3> Main </h3></summary>\n    This section contains the simulation function that is used to run the project.\n</details>\n\n<details>\n    <summary><h3> Execution </h3></summary>\n    This section contains the code snippet to run the project.\n</details>\n\n<details>\n    <summary><h3> Illustration </h3></summary>\n    This section is used to display the results of the simulation.\n</details>\n\n<details>\n    <summary><h3> Preservation </h3></summary>\n    This section is used to store data.\n</details>\n\n\n## Requirements\n\nThe file named `core/lib/required_libraries.py` is where the crucial requirements are loaded and used througout the project. You will not need it normally, unless you wish to use a specific library in the whole project. In other words, all addition requirements should be called in the requirements section of `dyrun` file. For instance, as long as the project needs to use a specific model file (This will be discussed in the following parts of this instrustion), they should be called by `from blocks.general_blocks import *` in this important section.\n\n## Libraries\n\nIn this section, all available libraries that can be utilized for better managing your projects are given.\n\n<details>\n    <summary><h2> `Clib` </h2></summary>\n\nThis pre-imported library which you can find it in the **requirements** section of the `dyrun.ipynb`, brings you several useful functions, which will be elaborated now:\n\n1. `set_timer(ID)`: This function sets the timer and initializes the simulation. It also sets up the logging module, creates a log file in the `logs` directory with the name `<ID>.log`, and writes a message to the log file indicating that the simulation has started.\n    * `ID` (input) - The id number of the simulation; it is usually unique.\n    * Output: The current time at the moment that the function is called.\n\n2. `end_report(start_time)`: This function reports the end of the simulation and the time it took to run. It calculates the elapsed time since the simulation started, formats it as a string, and writes a message to the log file indicating that the simulation has ended and the elapsed time.\n    * `start_time` (input) - The time the simulation was started (returned by `set_timer()`).\n    * Output: None.\n\n3. `get_now(report_type=0, splitter_char='_')`: This function returns a string containing the current date and time in the specified format. The format of the output string depends on the value of `report_type` and `splitter_char`. The function gets the current date and time using the `datetime.now()` method, formats it according to the specified format, and returns the formatted string.\n    * `report_type` (input, optional) - The type of report to generate. The default value is `0`.\n        * 0: YMDHMS\n        * 1: YMD_HMS\n        * 2: Y_M_D_H_M_S\n        * 3: YMD_HM\n        * 4: YMD_HM\n        * 5: Y_M_D\n        * 6: H_M_S\n    * `splitter_char` (input, optional) - The character used to separate the different parts of the date and time. The default value is `'_'`.\n    * Output: A string containing the current date and time in the specified format.\n\nCertainly! Here are the revised instructions for the `Clib` class, which provides several useful functions related to file I/O. For each function, I've provided a brief description of its operation, along with the input variables and output variables:\n\n4. `diary(message, no_print=False)`: This function is used to put the message in the diary file as well as to print it to the console. It writes the message to the log file using the `logging` module and also prints the message to the console if `no_print` is `False`.\n    * `message` (input) - The message that you want to show or put in the diary.\n    * `no_print` (input, optional) - A boolean value that specifies whether to disable printing to the console. The default value is `False`.\n    * Output: None.\n\n5. `save_csv(tensor, name, zip=False)`: This function saves the given data in a `.csv` file. If `zip` is `True`, it creates a `.zip` file with the same name as the `.csv` file and saves it in the same directory.\n    * `tensor` (input) - The data that you want to save, e.g., matrices or numerical vectors.\n    * `name` (input) - The path including the name of the file where you want to save the data. For example, `data/outputs/TensorFileName`.\n    * `zip` (input, optional) - A boolean value that specifies whether to save the data as a `.zip` file. The default value is `False`.\n    * Output: None.\n\n6. `load_csv(name, maxsize=1000)`: This function loads the content of the given `.csv` file saved by `save_cvs()`. If the data file is too large, it can be restricted by specifying the maximum file size in MB using the `maxsize` option.\n    * `name` (input) - The path including the name of the `.csv` file from which you want to load the data. For example, `data/outputs/TensorFileName`.\n    * `maxsize` (input, optional) - An integer value that specifies the maximum size of the file to be loaded in MB. The default value is `1000`.\n    * Output: The loaded data in the form of a NumPy array.\n\n7. `save_npy(tensor, name, zip=False)`: This function saves the given `tensor` as a `.npy` file with the specified `name`. If `zip=True`, the function saves the tensor as a `.zip` file instead of a `.npy` file.\n    * `tensor` (input) - The data to be saved, such as a matrix or numerical vector.\n    * `name` (input) - The path and name of the file to be saved, e.g. `data/outputs/TensorFileName`.\n    * `zip` (input, optional) - A boolean value that specifies whether to save the data as a `.zip` file. The default value is `False`.\n    * Output: None.\n\n8. `load_npy(name)`: This function loads the content of the given `.npy` file with the specified `name`.\n    * `name` (input) - The path and name of the file to be loaded, e.g. `data/outputs/TensorFileName`.\n    * Output: The loaded tensor data.\n\n9. `delayed(signal, k, delay_steps)`: This function creates a delayed version of a discrete signal.\n    * `signal` (input): The full signal.\n    * `k` (input): The current point in the signal.\n    * `delay_steps` (input): The amount of delay in integer steps.\n    * Output: The delayed signal value.\n\n10. `sigmoid(time_line, bias, alph, area)`: This method generates a sigmoid function signal.\n    * `time_line` (input): The time line.\n    * `bias` (input): The time shift bias.\n    * `alph` (input): The smoother.\n    * `area` (input): The domain in the form of a list `[a, b]`.\n    * Output: The output signal.\n\n11. `exp_f(time_line, decay_rate, area)`: This method generates an exponential function signal.\n    * `time_line` (input): The time line.\n    * `decay_rate` (input): The decay rate.\n    * `area` (input): The domain in the form of a list `[a, b]`.\n    * Output: The output signal.\n\n12. `linear_mapping(x, current_area, target_area)`: This method linearly maps the input `x` from the domain `[a1, b1]` to the range `[a2, b2]`.\n    * `x` (input): The input array.\n    * `current_area` (input): The domain `[a1, b1]`.\n    * `target_area` (input): Therange `[a2, b2]`.\n    * Output: The output array.\n\nTo use these functions, you can call them as static methods of the `Clib` class. For example, to save a tensor, you can call `Clib.save_npy(tensor, name)`, where `tensor` is the data to be saved, and `name` is the path and name of the file to be saved.\n</details>\n\n<details>\n    <summary> <h2> `Plib` </h2></summary>\n\nThis pre-imported library which you can find it in the **requirements** section of the `dyrun.ipynb`, provides several practical functions related to illustration purposes. The following methods are available:\n\n\nThe `Plib` class provides several practical functions related to illustration purposes. The following methods are available:\n\n1. `initialize()`: This function initializes the environment and sets the `font.family`, `font.size`, and `text.usetex` to any further draws. Furthermore, the size of plot windows and several other essential properties are adjusted. There is no input to this function. Note that it is recommended to make sure the last `latex` package (like `TexLive`) has been installed in your systems. you can download from <a target=\"_blank\" href=\"https://www.tug.org/texlive/\">here</a>. It is used to draw for academic purposes. If you do not have `ltex`, you can temporarily ignore this function, although it is suggested to use it.\n    * Output: None.\n\n2. `isi(params, fig = 0, save = False, width = 8.5, hw_ratio = 0.65)`: This function makes plots prettier and ready to use in academic purposes. The inputs to this function are:\n    * `params` (input): a string that describes the plot.\n    * `fig` (input, optional): the figure handler; use `h = plt.figure(tight_layout=True)` to create one.\n    * `save` (input, optional): a string that specifies the name of the file to save the illustration, or just insert `True`.\n    * `width` (input, optional): a float that represents the width of the figure in inches; default is `8.5`.\n    * `hw_ratio` (input, optional): a float that represents the height to width ratio between `0` and `1`; default is `0.65`.\n    * Output: None.\n\n3. `save_figure(params, save=True, fig=plt.gcf(), dpi=300)`: This function can be used to save a figure/plot as an image file. The inputs to this function are:\n    * `params` (input): An object that contains various parameters related to the current run of the program.\n    * `save` (input, optional): A boolean or string value that specifies whether to save the figure or not. If a string value is provided, it is used as the **filename** for the saved image.\n    * `fig` (input, optional): A matplotlib figure object that represents the current figure/plot to be saved.\n    * `dpi` (input, optional): An integer value that specifies the resolution of the saved image file in dots per inch.\n    * Output: None.\n\n4. `linear_gradient(colors, locs, n=256, show=False)`: This function can be used to generate a linear gradient of colors. The inputs to this function are:\n    * `colors` (input): A list of color values in RGBA format. For example, `[[1, 0, 0, 1], [1, 1, 1, 1], [0, 0, 0, 1]]` represents a gradient from red to white to black.\n    * `locs` (input): A list of values between 0 and 1 that specify the location of each color in the gradient.\n    * `n` (input, optional): An integer value that specifies the number of colors in the output gradient. Default value is `256`.\n    * `show` (input, optional): A boolean value that, if set to True, shows a plot of the generated gradient.\n    * Output: The output of this function is an array of colors that represents the generated gradient.\n\n5. `cmap_maker(name, colors, n=256)`: This function can be used to create a Linear Segmented Color Map (LSCM) using the given colors and their locations. The inputs to this function are:\n    * `name` (input): A string that specifies the name of the color map.\n    * `colors` (input): A list of tuples where each tuple contains a value between 0 and 1 (specifying the location of the color on the graph line) and a color value in any valid format (e.g., `#FF0000` for red).\n    * `n` (input, optional): An integer value that specifies the number of colors in the output color map. Default value is `256`.\n    * Output: The output of this function is a matplotlib colormap object that can be used for visualizations.\n\nTo use these functions, you can call them as static methods of the `Plib` class, similar to `Clib`.\n</details>\n\n\n<details>\n    <summary> <h2> `eclib` </h2></summary>\n    This is a Python library for numerical simulation of encrypted control.\n    You have to import the library you need in the requirements section. For instance, to utilize `Paillier`, insert `import core.lib.eclib.paillier as pai` and use `pai` in the whole project.\n    Visit <a target=\"_blank\" href=\"https://github.com/KaoruTeranishi/EncryptedControl\">EncryptedControl</a> [4] for more information.\n</details>\n\n## A survey on `Scope` class\n\n...\n\n## Questions\n\n<details>\n    <summary> <h4> How to model an LTI system?</h4></summary>\n</details>\n\n<details>\n    <summary> <h4> How to model a nonlinear system?</h4></summary>\n</details>\n\n<details>\n    <summary> <h4> How to model a network including nonlinear agents?</h4></summary>\n</details>\n\n# References\n\n[1]. Butcher, John C. (2003). Numerical Methods for Ordinary Differential Equations. New York: John Wiley & Sons. ISBN 978-0-471-96758-3.\n\n[2]. Simon, Dan (2006). Optimal State Estimation. Hoboken, NJ: John Wiley & Sons. ISBN 978-0-471-70858-2.\n\n[3]. E. A. Wan and R. Van Der Merwe, \"The unscented Kalman filter for nonlinear estimation,\" Proceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No.00EX373), Lake Louise, AB, Canada, 2000, pp. 153-158, doi: 10.1109/ASSPCC.2000.882463.\n\n[4]. Teranishi K, Encrypted control library, github. https://github.com/KaoruTeranishi/EncryptedControl\n\n[5]. Izhikevich, E. M. (2003). Simple model of spiking neurons. IEEE Transactions on Neural Networks, 14(6), 1569-1572.\n\n[6]. Ullah, M., Fletcher, A. E. C., & Hake, J. (2006). The Role of Calcium Release-Activated Calcium Currents in Bursting Pacemaker Activity of Nucleus Ambiguus Neurons. Journal of Computational Neuroscience, 21(3), 271-282.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Easy way to simulation",
    "version": "1.1.11",
    "project_urls": {
        "Homepage": "https://github.com/abolfazldelavar/dyrun"
    },
    "split_keywords": [
        "control",
        "simulation",
        "academic",
        "mathematics",
        "differential",
        "closed-loop",
        "numberical calculation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17fc49f4b2d5d3d91f351e0b6701885fa6dc3206ec923b94576681d08c431c8d",
                "md5": "b5eb5bb02e2bfa8c0a8299135d59af08",
                "sha256": "dfb3f497d09a500500d0a521dd32f7e9fa1dd03345758c9bc916061cb4680cfa"
            },
            "downloads": -1,
            "filename": "dyrun-1.1.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b5eb5bb02e2bfa8c0a8299135d59af08",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 63564,
            "upload_time": "2023-05-22T16:38:41",
            "upload_time_iso_8601": "2023-05-22T16:38:41.823881Z",
            "url": "https://files.pythonhosted.org/packages/17/fc/49f4b2d5d3d91f351e0b6701885fa6dc3206ec923b94576681d08c431c8d/dyrun-1.1.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "90023c0c5f03eb7beb7cf5490705160e8af847cb67511dbdb864ccd873b0305e",
                "md5": "c1920e29f5a3834c3b46932677e810c3",
                "sha256": "b6fac9129f8995a927781791ed659ad208a567ab74bd8395da224d0dcb0db0bf"
            },
            "downloads": -1,
            "filename": "dyrun-1.1.11.tar.gz",
            "has_sig": false,
            "md5_digest": "c1920e29f5a3834c3b46932677e810c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 54875,
            "upload_time": "2023-05-22T16:38:45",
            "upload_time_iso_8601": "2023-05-22T16:38:45.763330Z",
            "url": "https://files.pythonhosted.org/packages/90/02/3c0c5f03eb7beb7cf5490705160e8af847cb67511dbdb864ccd873b0305e/dyrun-1.1.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-22 16:38:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "abolfazldelavar",
    "github_project": "dyrun",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dyrun"
}
        
Elapsed time: 0.07304s