Skip to content

Commit

Permalink
Deploying to gh-pages from @ sympy/sympy@e228082 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Sc0rpi0n101 committed Aug 26, 2024
1 parent 32416f5 commit dc23cfa
Show file tree
Hide file tree
Showing 453 changed files with 10,102 additions and 7,041 deletions.
Binary file modified dev/_downloads/0130acc9674ca6615e762dac32f6f525/matrices-10.pdf
Binary file not shown.
Binary file modified dev/_downloads/0249fb66c2fcb06b78bd6a84135be88a/beam-2.pdf
Binary file not shown.
Binary file modified dev/_downloads/02f5470280a542a7c80635a082cb7e09/beam-23.pdf
Binary file not shown.
Binary file modified dev/_downloads/034c3ce6c53eca7932c83f9b35d14c64/plotting-2.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/0a5b397c3adc07987864b0441654dc1c/beam-1.pdf
Binary file not shown.
Binary file modified dev/_downloads/0c7c1262b6b611b1944eed12f33413fe/beam-5.pdf
Binary file not shown.
Binary file modified dev/_downloads/0eb265c8614c7bd3f16f6034d076f6d3/beam-21.pdf
Binary file not shown.
Binary file modified dev/_downloads/0efc8f797e345bcc903c8f4dab4a5322/plotting-4.pdf
Binary file not shown.
Binary file modified dev/_downloads/0ffd2a0f4570e502b64ad8529258801f/plotting-17.pdf
Binary file not shown.
Binary file modified dev/_downloads/1362531cda049d5b7f4db4abe11d4178/plotting-6.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/16c046e4f150f3aca5fb6bd438b952ce/matrices-24.pdf
Binary file not shown.
Binary file modified dev/_downloads/16f8dba9abaa041f16c4636d6e41a0ac/matrices-25.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/1f24a27fa4a24f0b331e9442f61363d7/plotting-16.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified dev/_downloads/2454d35ad3fc284cb67b6c619b4246c1/beam-8.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/2608cc95ac952e335ca0ce8cea458c1b/matrices-22.pdf
Binary file not shown.
Binary file modified dev/_downloads/2667a5fcc739d282a7512f6b7b39071a/matrices-4.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/2acde0fab574588f4a28670019a75bf9/plotting-26.pdf
Binary file not shown.
Binary file modified dev/_downloads/2f44ee19ebd4c314ad1c408629357c53/plotting-1.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/39dc203c3bf6e7485368c7a401448a6f/matrices-8.pdf
Binary file not shown.
Binary file modified dev/_downloads/3af3ee18448b7a687ef6594665f932f9/plotting-19.pdf
Binary file not shown.
Binary file modified dev/_downloads/3cd14c510b41514f1496a3155ea8cf2d/matrices-17.pdf
Binary file not shown.
Binary file modified dev/_downloads/464f047ba3ef7f04429a4eb163a6a2de/matrices-18.pdf
Binary file not shown.
Binary file modified dev/_downloads/4c9cbd846f69df68795ea4e2cdf667e9/plotting-33.pdf
Binary file not shown.
Binary file modified dev/_downloads/4d0c9c96647fc2441757598f44d4936b/beam-20.pdf
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/56447441b8d8108229134a5d3454516c/plotting-7.pdf
Binary file not shown.
Binary file modified dev/_downloads/569497501b2d3eb864ce466d19b06017/plotting-20.pdf
Binary file not shown.
Binary file modified dev/_downloads/5815ed289d6d66d90e420fd31330fef7/plotting-28.pdf
Binary file not shown.
Binary file modified dev/_downloads/5860560b08ead850923e530e3240b5c6/plotting-15.pdf
Binary file not shown.
Binary file modified dev/_downloads/5b83bd080155a6f59e2eeb633bda5ab4/matrices-13.pdf
Binary file not shown.
Binary file modified dev/_downloads/6236456dc31640e622c3f943842d9925/plotting-27.pdf
Binary file not shown.
Binary file modified dev/_downloads/68597f1bcbf2528fdc041a5c14e53f0f/plotting-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified dev/_downloads/704bfe351153d402a4a0a831ece25675/matrices-2.pdf
Binary file not shown.
Binary file modified dev/_downloads/76c597139b65debdf0e125c15cd040ca/plotting-25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_downloads/7bfa6a992ea402720a120fd5093741a4/plotting-11.pdf
Binary file not shown.
Binary file modified dev/_downloads/7d4a2d083d96719b05ab2f759c57874a/matrices-6.pdf
Binary file not shown.
Binary file modified dev/_downloads/7eed1bf07a4dacbb97d209dac2614e9a/matrices-19.pdf
Binary file not shown.
Binary file modified dev/_downloads/81a43cb7598cbbe880e19146241abe5f/plotting-26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_downloads/81a780d815116a5eb737d2d484c44444/matrices-21.pdf
Binary file not shown.
Binary file modified dev/_downloads/81f16477713a2ebedd53f1c8ec85b754/plotting-12.pdf
Binary file not shown.
Binary file modified dev/_downloads/83ec70596dcaacc88e256e7679fafcee/matrices-12.pdf
Binary file not shown.
Binary file modified dev/_downloads/865dedeca3d1430244910d89d552e5ef/beam-19.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/8c3e8789c867600d80b2cce11272d81e/matrices-15.pdf
Binary file not shown.
Binary file modified dev/_downloads/8f6a7c938e347f134c67566d5aef740d/plotting-29.pdf
Binary file not shown.
Binary file modified dev/_downloads/90b2354acc779cd49f552b57929e55ab/plotting-13.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/950e4c42a3beff8bac74d47e0f8d8516/plotting-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_downloads/95feb1999af91b22f624aa3ce3c6b1c4/solve-ode-1.pdf
Binary file not shown.
Binary file modified dev/_downloads/9659cd876877dfc4002fae48de3c98ae/beam-4.pdf
Binary file not shown.
Binary file modified dev/_downloads/9728219edea47500a9403b3679a5bc09/plotting-10.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/9ba0a373644e3b8e75cb2f2d1a46ac33/plotting-35.pdf
Binary file not shown.
Binary file modified dev/_downloads/a11367bb58b03bf09a75c9657b4e223a/matrices-16.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/a3a06dbcaf4cb9dbce7fe53c37ec22a8/plotting-30.pdf
Binary file not shown.
Binary file modified dev/_downloads/a45cb86364a3602f7138b4466beb1097/beam-3.pdf
Binary file not shown.
Binary file modified dev/_downloads/a6ba697f4fd41244d4a03ae13c871d77/matrices-20.pdf
Binary file not shown.
Binary file modified dev/_downloads/a892d8f10080acfce9914123b164dd0e/matrices-11.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/ac472fec5b32a66f329e9328277c64b3/plotting-34.pdf
Binary file not shown.
Binary file modified dev/_downloads/b0f2a5ef738f9e96458a670bdb264732/beam-18.pdf
Binary file not shown.
Binary file modified dev/_downloads/b78b32e3870f0d0ffa753084ae625ec7/plotting-9.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/c1adee8d5f4e9aedd715240ee2abc6e5/matrices-9.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/ca52fc8f0db47908fb8d38cc335d5c1a/plotting-22.pdf
Binary file not shown.
Binary file modified dev/_downloads/cb44a32b25833934efb3a9d4adfe400c/plotting-29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_downloads/cc4619d4e67ea48ddf5026828b7569eb/beam-22.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_downloads/d1eadb36634e8e0276f3d1752e83893e/matrices-14.pdf
Binary file not shown.
Binary file modified dev/_downloads/d2c03725fdbe7104e13f46e3798a03e1/beam-7.pdf
Binary file not shown.
Binary file modified dev/_downloads/d3453595eb36f834c2ad86d18546535c/matrices-7.pdf
Binary file not shown.
Binary file modified dev/_downloads/d4935c2256660a8a33a7af58457af366/beam-6.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/dac00acb10450bde21ecfc4fd9c34817/matrices-1.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_downloads/ddddc4679201fda850a702ce6ca7ff1e/plotting-5.pdf
Binary file not shown.
Binary file modified dev/_downloads/e0563f4c3c89c72192ce76efd2e6fe6b/matrices-3.pdf
Binary file not shown.
Binary file modified dev/_downloads/e07f3720dbc2048eb106de8a904dcfa9/plotting-25.pdf
Binary file not shown.
Binary file modified dev/_downloads/e51f495094ca971c2da007d95d7c6aff/matrices-5.pdf
Binary file not shown.
Binary file modified dev/_downloads/e8a5010f49b1076156ddfe2fa5fe6189/beam-9.pdf
Binary file not shown.
Binary file modified dev/_downloads/eb990a3106294a2a2f898aea0b429ab7/matrices-23.pdf
Binary file not shown.
Binary file modified dev/_downloads/ebf272f79479d63cc5b71ad0f0e41f7d/fourier-1.pdf
Binary file not shown.
Binary file modified dev/_downloads/ee22a6375b132bbe50ac86a0282c8f8f/fourier-2.pdf
Binary file not shown.
Binary file modified dev/_downloads/ef1b602db6b31a5b8d8b9d20a2410f41/beam-10.pdf
Binary file not shown.
Binary file modified dev/_downloads/f0b1ed1309beacf065f53d41a069ebe1/plotting-24.pdf
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/f143e8af7f67232f463360136b513860/truss-1.pdf
Binary file not shown.
Binary file modified dev/_downloads/fd7d64e97562f1e8bfd34628ef58f000/plotting-31_01.pdf
Binary file not shown.
Binary file modified dev/_downloads/fd8f37f13aecb42027ed8c23548b8132/plotting-31_00.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions dev/_images/Electrical_Problems_Q1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions dev/_images/Electrical_Problems_Q2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_images/plotting-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_images/plotting-25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_images/plotting-26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/_images/plotting-29.png
Binary file modified dev/_images/plotting-30.png
7 changes: 4 additions & 3 deletions dev/_sources/guides/physics/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The Python Package SymPy can be used to symbolically solve physics problems
on Classical Mechanics, Continuum Mechanics, Control Systems, High-Energy
Physics, Optics, Quantum Mechanics, Units and Vector algebra.

.. toctree::
:maxdepth: 1
For physics tutorials, please check out:

control_problems.rst
* `Biomechanics Tutorials <../../tutorials/physics/biomechanics/index.html>`_
* `Mechanics Tutorials <../../tutorials/physics/mechanics/index.html>`_
* `Control Tutorials <../../tutorials/physics/control/index.html>`_
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Solution
[[[-1, 0], []], [[-3/4], [4, -1/2 - sqrt(3)*I/2, -1/2 + sqrt(3)*I/2]]]
>>> pole_zero_plot(G[0, 0]) # doctest: +SKIP

.. plot:: guides/physics/generate_plots.py q3_3
.. plot:: tutorials/physics/control/generate_plots.py q3_3

Subpart 4

Expand All @@ -189,18 +189,18 @@ Solution
(s + 1)
>>> step_response_plot(tf1) # doctest: +SKIP

.. plot:: guides/physics/generate_plots.py q3_4
.. plot:: tutorials/physics/control/generate_plots.py q3_4

Subpart 5

>>> tf2 = G[0, 1]
>>> bode_magnitude_plot(tf2) # doctest: +SKIP

.. plot:: guides/physics/generate_plots.py q3_5_1
.. plot:: tutorials/physics/control/generate_plots.py q3_5_1

>>> bode_phase_plot(tf2) # doctest: +SKIP

.. plot:: guides/physics/generate_plots.py q3_5_2
.. plot:: tutorials/physics/control/generate_plots.py q3_5_2



Expand Down Expand Up @@ -344,11 +344,11 @@ Solution
TransferFunction(s**4 + 3*s**3 + 3*s**2 + 3*s + 2, 12*s**5 + 193*s**4 + 873*s**3 + 1644*s**2 + 1484*s + 712, s)
>>> pole_zero_plot(sys6) # doctest: +SKIP

.. plot:: guides/physics/generate_plots.py q5
.. plot:: tutorials/physics/control/generate_plots.py q5



References
----------
^^^^^^^^^^
1. `testbook.com <https://testbook.com/objective-questions/mcq-on-transfer-function--5eea6a1039140f30f369e952>`_
2. `www.vssut.ac.in <https://www.vssut.ac.in/lecture_notes/lecture1423904331.pdf>`_
300 changes: 300 additions & 0 deletions dev/_sources/tutorials/physics/control/electrical_problems.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
.. _electrical_problems-physics:

=============================================
Electrical Problems using StateSpace
=============================================

The state-space approach is a powerful method used to model and analyze systems in control
theory. Instead of focusing solely on the input-output relationships like the transfer function
approach, the state-space approach represents systems as a set of first-order differential
equations.

The state-space representation of a system can be written as:

.. math::
\dot{x}(t) = A x(t) + B u(t) \\
y(t) = C x(t) + D u(t)
Where :math:`x(t)` is the state vector, :math:`u(t)` is the input vector, :math:`y(t)` is the output vector,
:math:`A`, :math:`B`, :math:`C`, and :math:`D` are matrices that define the system dynamics.

Below are some examples to demonstrate the use of StateSpace to solve Electrical problems.

Example 1
---------

.. image:: Electrical_Problems_Q1.svg
:align: center

In a series RLC circuit, we have a resistor :math:`R`, an inductor :math:`L`, and a capacitor :math:`C`
connected in series with an input voltage :math:`v_{in}(t)`. The state variables are the current through
the inductor :math:`i(t)` and the voltage across the capacitor :math:`v_C(t)`.

Applying **Kirchhoff's Voltage Law** (KVL) around the loop in the above diagram gives:

.. math::
v_{in}(t) = R \cdot i(t) + L \frac{di(t)}{dt} + V_C(t)
Where: :math:`v_{in}(t)` is the input voltage, :math:`i(t)` is the current through the inductor and
:math:`v_C(t)` is the voltage across the capacitor.

This equation relates the input voltage to the elements of the RLC circuit.

**Capacitor Voltage Equation**

The voltage across the capacitor can be related to the current by:

.. math::
V_C(t) = \frac{1}{C} \int i(t) \, dt
Taking the time derivative of both sides, we obtain the rate of change of the capacitor voltage:

.. math::
\dot{v}_C(t) = \frac{d v_C(t)}{dt} = \frac{i(t)}{C}
This equation shows that the rate of change of the capacitor voltage is proportional to the current through the circuit.

From the KVL equation, solving for the derivative of the current gives:

.. math::
\frac{di(t)}{dt} = -\frac{R}{L} i(t) - \frac{1}{L} v_C(t) + \frac{1}{L} v_{in}(t)
This is the first-order differential equation that describes the rate of change of the current in terms of the circuit's components and input voltage.

The state-space representation expresses the system in terms of state variables, which are typically the variables that describe the energy stored in the circuit elements (such as current and voltage).

We define the state vector `X(t)` as:

.. math::
X(t) = \begin{bmatrix} x_1(t) \\ x_2(t) \end{bmatrix} = \begin{bmatrix} i(t) \\ v_C(t) \end{bmatrix}
Here `x_1(t) = i(t)` is the current through the inductor and `x_2(t) = v_C(t)` is the voltage across the capacitor.

The input vector `U(t)` is the input voltage:

.. math::
U(t) = v_{in}(t)
The system of differential equations in terms of the state variables becomes:

1. The derivative of the current:

.. math::
\dot{x}_1(t) = -\frac{R}{L} x_1(t) - \frac{1}{L} x_2(t) + \frac{1}{L} v_{in}(t)
2. The derivative of the capacitor voltage:

.. math::
\dot{x}_2(t) = \frac{x_1(t)}{C}
The matrices for the series RLC circuit are:

.. math::
A = \begin{bmatrix}
-\frac{R}{L} & -\frac{1}{L} \\
\frac{1}{C} & 0
\end{bmatrix},
B = \begin{bmatrix}
\frac{1}{L} \\
0
\end{bmatrix},
C = \begin{bmatrix} 0 & 1 \end{bmatrix},
D = \begin{bmatrix} 0 \end{bmatrix}
Thus, the state-space representation of the series RLC circuit is:

.. math::
\dot{X}(t) = \begin{bmatrix}
-\frac{R}{L} & -\frac{1}{L} \\
\frac{1}{C} & 0
\end{bmatrix}
\begin{bmatrix} x_1(t) \\ x_2(t) \end{bmatrix}
+ \begin{bmatrix}
\frac{1}{L} \\
0
\end{bmatrix} V_{in}(t)
Y(t) = \begin{bmatrix} 0 & 1 \end{bmatrix}
\begin{bmatrix} x_1(t) \\ x_2(t) \end{bmatrix}
+ \begin{bmatrix} 0 \end{bmatrix} V_{in}(t)
The state-space representation provides a compact way of modeling
the series RLC circuit by using matrices to describe the system's
dynamics. The matrices :math:`A`, :math:`B`, :math:`C`, and :math:`D`
capture the relationships between the circuit's state variables,
input, and output. This representation is particularly useful for
analyzing the system's behavior in the time domain and for designing
control systems.

Solution

>>> from sympy import Matrix, symbols, pprint
>>> from sympy.physics.control import *
>>> R, L, C = symbols('R L C')
>>> A = Matrix([[-R/L, -1/L], [1/C, 0]])
>>> B = Matrix([[1/L], [0]])
>>> C = Matrix([[0, 1]])
>>> D = Matrix([[0]])
>>> ss = StateSpace(A, B, C, D)
>>> ss
StateSpace(Matrix([
[-R/L, -1/L],
[ 1/C, 0]]), Matrix([
[1/L],
[ 0]]), Matrix([[0, 1]]), Matrix([[0]]))

We can convert the StateSpace to TransferFunction by rewrite method.

>>> tf = ss.rewrite(TransferFunction)[0][0]
>>> tf
TransferFunction(1, C*L*s**2 + C*R*s + 1, s)


Example 2
---------

.. image:: Electrical_Problems_Q2.svg
:align: center

Obtain the state model for a system represented by an electrical
system as shown in figure

The system is modeled with two state variables,
`x_1(t)` and `x_2(t)`, which are related to the physical voltages at the nodes
`v_1(t)` and `v_2(t)` respectively.

Let the two state variables be defined as:

.. math::
v_1(t) = x_1(t)
v_2(t) = x_2(t)
The governing equations are derived by applying Kirchhoff's Current Law (KCL) at the nodes `v_1(t)` and `v_2(t)`.

Applying KCL at node `v_1(t)`:

.. math::
\frac{v_1(t) - u(t)}{R} + C \frac{d v_1(t)}{dt} + \frac{v_1(t) - v_2(t)}{R} = 0
Substituting the state variables:

.. math::
\frac{x_1(t) - u(t)}{R} + C \frac{dx_1(t)}{dt} + \frac{x_1(t) - x_2(t)}{R} = 0
Simplifying:

.. math::
C \dot{x_1}(t) = -\frac{2x_1(t)}{R} + \frac{x_2(t)}{R} + \frac{u(t)}{R}
Thus, the state equation for `x_1(t)` becomes:

.. math::
\dot{x_1}(t) = -\frac{2x_1(t)}{RC} + \frac{x_2(t)}{RC} + \frac{u(t)}{RC}
Applying KCL at node `v_2(t)`:

.. math::
C \frac{d v_2(t)}{dt} + \frac{v_2(t) - v_1(t)}{R} = 0
Substituting the state variables:

.. math::
C \frac{d x_2(t)}{dt} + \frac{x_2(t) - x_1(t)}{R} = 0
Simplifying:

.. math::
C \dot{x_2}(t) = \frac{x_1(t)}{R} - \frac{x_2(t)}{R}
Thus, the state equation for `x_2(t)` becomes:

.. math::
\dot{x_2}(t) = \frac{x_1(t)}{RC} - \frac{x_2(t)}{RC}
The state-space representation is given by the following matrix equation:

.. math::
\begin{bmatrix}
\dot{x_1}(t) \\
\dot{x_2}(t)
\end{bmatrix}
=
\begin{bmatrix}
-\frac{2}{RC} & \frac{1}{RC} \\
\frac{1}{RC} & -\frac{1}{RC}
\end{bmatrix}
\begin{bmatrix}
x_1(t) \\
x_2(t)
\end{bmatrix}
+
\begin{bmatrix}
\frac{1}{RC} \\
0
\end{bmatrix}
u(t)
The output of the circuit is defined as:

.. math::
y(t) = v_2(t) = x_2(t)
Thus, the output equation can be written as:

.. math::
y(t) = \begin{bmatrix} 0 & 1 \end{bmatrix}
\begin{bmatrix}
x_1(t) \\
x_2(t)
\end{bmatrix}
Solution

>>> from sympy import symbols, Matrix
>>> from sympy.physics.control import *
>>> R, C = symbols('R C')
>>> A = Matrix([[-2/(R*C), 1/(R*C)], [1/(R*C), -1/(R*C)]])
>>> B = Matrix([[1/(R*C)], [0]])
>>> C = Matrix([[0, 1]])
>>> ss = StateSpace(A, B, C)
>>> ss
StateSpace(Matrix([
[-2/(C*R), 1/(C*R)],
[ 1/(C*R), -1/(C*R)]]), Matrix([
[1/(C*R)],
[ 0]]), Matrix([[0, 1]]), Matrix([[0]]))


References
----------
1. `bmsce.ac.in <https://bmsce.ac.in/Content/TE/STATE_SPACE_ANALYSIS.pdf>`_
27 changes: 27 additions & 0 deletions dev/_sources/tutorials/physics/control/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _control_tutorial:

=============================
Control Tutorials
=============================

The control module in SymPy provides essential tools for symbolic control system
analysis. The TransferFunction class allows for creating transfer functions and
analyzing their properties, such as stability is_stable(), poles, and zeros.
Series, Parallel, and Feedback classes enable constructing and simplifying
system interconnections. The TransferFunctionMatrix handles multi-input, multi-output
(MIMO) systems, while MIMOSeries, MIMOParallel, and MIMOFeedback extend these
functionalities for complex systems.

Additionally, the module includes the StateSpace class, which allows for modeling
control systems using state variables, inputs, and outputs in matrix form. This
representation is particularly useful for time-domain analysis and handling complex
MIMO systems.

This tutorial contains a breif guide on how to solve Control Problems using
`TransferFunction` and `StateSpace`.

.. toctree::
:maxdepth: 1

control_problems.rst
electrical_problems.rst
1 change: 1 addition & 0 deletions dev/_sources/tutorials/physics/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ write to our `mailing list

biomechanics/index.rst
mechanics/index.rst
control/index.rst
Loading

0 comments on commit dc23cfa

Please sign in to comment.