Questions tagged [control-systems]

Questions on the use of Mathematica to analyze, design, and simulate continuous- and discrete-time control systems.

Filter by
Sorted by
Tagged with
4
votes
1answer
88 views

Non-linear ODE from closed-loop system and Response

I started using Mathematica 12 and ran into difficulties. Namely, I want to compare the results of the calculation of a closed system from Simulink and in Mathematica. I rummaged around a bit on the ...
1
vote
1answer
52 views

Error with StateSpaceTransform: the rule based transformation must be of length 2

I would like to perform a change of variables on the following dynamics system: ...
2
votes
3answers
92 views

PIDTune and characteristic equation of zero

I have a BLDC electric motor, I'm currently trying to control via a PIDTune. This is mostly an attempt to reduce (remove) a small run away drift that ends up ...
4
votes
1answer
89 views

Extended Kalman Filter by hand

While trying to learn a bit about control theory, observers and most importantly, to use Microcontroller Kit in version 12 of MMA, I've stumbled upon the KalmanEstimator. After reading a bit (and ...
30
votes
2answers
474 views

Can we use Mathematica for electronics design?

A spoiler alert: I intend to answer my own question. I am posting this because I would like to share my excitement regarding the control theory tools in Mathematica, and also to promote further ...
1
vote
1answer
70 views

Speeding up the calculations by Reduce and NSolve

I have a non-linear system of equations with numeric parameter values as shown below. I first tried FindRoot with given initial values and it did not converge. Then ...
1
vote
1answer
68 views

StateTransformationLinearize - references?

I am impressed by StateTransformationLinearize, and I feel terribly bad for not having noticed this function before. How does it work? Does it attempt to find a $...
0
votes
1answer
255 views

Solving Differential Equation System for HIV Treatment Model

I was working on a project about optimal strategies for HIV treatment, models used from [Butler, Kirschner, and Lenhart] 1997. This model explains the spread of HIV viruses in the human body, where ...
0
votes
0answers
43 views

Finding the functions that Mathematica plots while using BodePlot

I've the following Mathematica-code: ...
1
vote
1answer
43 views

Manual control plots differ from StateResponse and OutputResponse

So In my quest to try to learn some control theory inspired by the following link, I have been modeling an inverse pendulum regulated with a flywheel. The system model is pretty ok I think, and when ...
2
votes
1answer
67 views

OutputResponse and contradictory control models

So I'm trying to learn some control theory for a little project I'm working on and decided I'd try the examples of pendulum and cart one can find all over the internets, and I'm following this post ...
2
votes
2answers
137 views

BodePlot with magnitude in db or log scale

I have to plot a BodePlot with magnitude in db or log, but i could not find the option for setting the magnitude scale. ...
2
votes
1answer
194 views

Analyze stability of equilibria using Routh-Hurwitz conditions

For an assignment, I need to analyze the stability of a system very close to equilibrium, using "Routh-Hurwitz conditions". I have already obtained the characteristic equation of my system, but I do ...
3
votes
2answers
115 views

Inconsistencies when using BodePlot with `StateSpaceModel` and `TransferFunctionModel`

Consider a linear system . ...
2
votes
0answers
67 views

Accuracy problem with BodePlot

Hoping to find a quick answer to a question of frequency response of multiple band-pass filters in closed loop, I opened up Mathematica,and entered the first set of ...
2
votes
1answer
149 views

Simulating a combination of PDEs and ODEs

I am trying to simulate a combination of PDEs and ODEs, given below. $$ \begin{matrix} -L\dfrac{\partial}{\partial t}I(t,z)&=&\dfrac{\partial}{\partial z}V(t,z)+RI(t,z)\\ C\dfrac{\...
3
votes
1answer
87 views

BodePlot of Warburg impedance - Errors

I'm trying to plot the Bode diagrams of the Warburg impedance (A=1, s=jw): $$Z=\frac{A}{\sqrt{\omega}}+\frac{A}{j\sqrt{\omega}}$$ $$Z=A \sqrt{\frac{j}{s}}+\frac{A}{j}\sqrt{\frac{j}{s}}$$ ...
2
votes
1answer
88 views

Event Trigger Ode's

I am trying to simulate a Hybrid system using the WhenEvent function in Mathematica. I have asked this question earlier. It was not an MWE. Now I tried to make an ...
1
vote
1answer
62 views

AxesLabel in a phase plot in the BodePlot command

I've the following code: ...
1
vote
0answers
43 views

Finding the mathematical function is plotted by using the bodeplot command

I've the following code: ...
2
votes
1answer
41 views

bodeplot phase in normal scale

I've the following fuction: ...
4
votes
1answer
248 views

Solving optimal control problem when input is constrained

Given a linear time-invariant system: $$x'(t)=Ax(t)+Bu(t)$$ with initial state $x(0)=x0$ and final state $x(T)=xT$. The performance measure to be minimized is: $$∫_0^Tu(t)^2dt$$ The most important ...
3
votes
2answers
213 views

Is it possible to find the transfer function of these three differential equations using Mathematica

Imagine you are attempting to obtain a model of a device with two inputs [u1, u2] and three outputs [O1, O2, x] from the Lagrangian. After some of Lagrangian work, you find the following three ...
7
votes
2answers
509 views

Why does NonlinearStateSpaceModel linearise?

The documentation for NonlinearStateSpaceModel says: In NonlinearStateSpaceModel[eqns, ...] the Taylor linearization is with ...
2
votes
1answer
82 views

Searching for poles of a transfer function on the edge of stability

I just started using Mathematica and I am a bit stuck. I want to compute poles of transfer function that are on edge of stability i.e. Re[s] = 0 and I want to find ...
8
votes
1answer
499 views

Solving an optimal control problem (LQR)

Given a linear time-invariant system: $$ \dot{x}(t)=Ax(t)+Bu(t) $$ with initial state $ x(0)=x_0 $ and final state $ x(T)=x_T $. The performance measure to be minimized is: $$ \int_{0}^{T} ((x_T-...
0
votes
1answer
110 views

Solve for input with given TransferFunctionModel

I obtained the transfer function for an electrical system from experimental data (left plot). Thereby, I can calculate the output voltage response for a given voltage input, using ...
1
vote
3answers
87 views

Can't find solutions to an equation involving a variable in eigenvalues

In control sytems we know that a system is of order 2 if there are two different eigenvalues such that they ratio is 10. In this case I want to find the controller gain that makes the above possible. ...
2
votes
2answers
320 views

Mathematica returns 1 for the denominator when clearly it isn't equal to 1

I'm trying to get the transfer function of a system from the State Space representation. It is given by $h(s)=C(sI-A)^{-1}B$ with I the identity matrix. Then I want to find the poles, so the idea is ...
4
votes
1answer
174 views

How is this StateSpaceModel derived?

Modifying an example from the documentation, StateSpaceModel[{a x'[t] + b x[t] == c u'[t] + d u[t]}, {{x[t], 0}}, {u[t]}, {x[t]}, t ] (state ...
1
vote
1answer
42 views

Factor by a specific literal (i.e factor by $s^N$ a transfer function)

I've found the closed loop transfer function but I want to know the order of it. So, the idea is to factor the denominator by the highest exponent of s to get an expression like this one: $$ l(s)=g(s)...
2
votes
1answer
72 views

Matrix Solve for a particular form

Suppose that we have two matrices $\mathbf A$ and $\mathbf B$ which are known to us and both of them are square matrices of the same dimensions. Now we want to find a square matrix $\mathbf C$ that ...
0
votes
0answers
85 views

Wrong answers while trying to analyze stability

I want to analyze the stability of a closed-loop system (with feedback). The idea is to choose a proper gain kc for the controller. The code is the following: ...
3
votes
1answer
126 views

Unable to find proper solutions through “Solve” or “NSolve”

I'm working on a problem that involves a CUK converter. In control theory, a system is marginally stable if the real part of all eigenvalues are equal to zero. Actually, the eigenvalues of a matrix $A$...
2
votes
1answer
112 views

Running a feedback control system problem

I'm trying to work with a feedback control system. The general scheme is: So the input $u(t)$ is supposed to be: $u(t)=k_a\cdot k_{st}\cdot h_c \cdot e(t)$ where $k_a,k_{st},k_c$ are the transfers ...
4
votes
2answers
62 views

Possible problem with method of resolution of differential equation

I'm trying to simulate an elevator circuit. I divided the problem in two steps. First step: simulate the problem with $d(t)$ and $e(t)$ constant. The final conditions of this system will be the ...
1
vote
0answers
63 views

Plotting a switching function

I'm trying to use a switch-function. I'm using $d(t)=d_o+\Delta d_1*UnitStep(t-0.01)+\Delta d_2*UnitStep(t-0.04)$ and a sawtooth function with period 0.002 and amplitude 1. To generate the sawtooth ...
3
votes
1answer
146 views

What KalmanEstimator elements tells us?

I'm looking for an interpretation of Kalman filter in discrete time. You know, if we consider an state space on the form of the form ...
0
votes
1answer
406 views

How to plot points on Bode plot curves

I used BodePlot to plot the magnitude and phase plots for a transfer function Gp1 and I figured out how to add a point to the ...
1
vote
1answer
150 views

How do you mark/show the critical point (-1, 0) on Nyquist plot? [closed]

I am trying to make the Nyquist plot of the function $\frac{200}{(s+1)(s+2)(s+3)}$ as below. However, I would like to see mark the critical point (-1, 0) on the plot so we can see clearly whether the ...
2
votes
1answer
58 views

strange curve that NyquistPlot gives for delayed first-order system

I've got a strange result from NyquistPlot for a delayed first-order system $\frac{e^{-i\pi /2}}{s + 1}$, using the mathematica code: ...
3
votes
1answer
161 views

1D transient heat equation problem with controller - 2

My question is related to this former question (1D transient heat equation problem with controller), which has already been solved, but the issue is now a different one. In the already solved ...
3
votes
1answer
149 views

Solve a forced system of differential equations with Mathematica (with Heaviside) [closed]

It is my first time here so I hope this question fits here. I want to solve the following system of equations: $x1'[t] == Vpv/L1 - x3[t]/L1*(1-u(t))$ $x2'[t] == x3[t]/L1*u(t) - x4[t]/L2$ $x3'[t] == ...
1
vote
0answers
169 views

Lyapunov exponent and stability of limit cycles

I have a four dimensional dynamical system where I have a Hopf bifurcation. My aim is to figure out if limit cycles are stable or not. The calibration in the system is ...
2
votes
1answer
171 views

RST controller in Mathematica

I was wondering, if it is possible to simulate an RST controller using Mathematica ? This is what I tried, but the computation of the closed loop does not work: ...
12
votes
1answer
350 views

1D transient heat equation problem with controller

I would appreciate some help with following issue: I am trying to solve a 1D transient heat equation problem with a control loop in order to compensate a time variable boundary condition at one ...
3
votes
2answers
209 views

State Space Model [closed]

I want to calculate State Space Model, there are four matrix: ...
2
votes
1answer
81 views

Does TransferFunctionModel have to be finite dimensional?

Does TransferFunctionModel have to be finite dimensional? Or can we for example use Mathematica to make a BodePlot of a transfer ...
2
votes
0answers
57 views

Where is documentation for Control`PoleZeroPlot? [duplicate]

An earlier question here mentioned Control`PoleZeroPlot, which I've found useful. Typing Names["*`PoleZeroPlot] returns ...
2
votes
2answers
205 views