Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [control-systems]

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

0
votes
1answer
186 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
36 views
1
vote
1answer
33 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
60 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
75 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
111 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
109 views
2
votes
0answers
63 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
91 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
74 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
83 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 ...
0
votes
1answer
44 views

AxesLabel in a phase plot in the BodePlot command

I've the following code: ...
1
vote
0answers
40 views
2
votes
1answer
38 views

bodeplot phase in normal scale

I've the following fuction: ...
2
votes
1answer
166 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
160 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
482 views

Why does NonlinearStateSpaceModel linearise?

The documentation for NonlinearStateSpaceModel says: In NonlinearStateSpaceModel[eqns, ...] the Taylor linearization is with ...
2
votes
1answer
74 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 ...
7
votes
1answer
377 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
97 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
86 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
309 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
121 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
37 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
67 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
83 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
114 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
107 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
61 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
56 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
135 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
270 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
122 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
57 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
153 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
135 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
137 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
143 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: ...
11
votes
1answer
328 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
175 views

State Space Model [closed]

I want to calculate State Space Model, there are four matrix: ...
2
votes
1answer
79 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
53 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
162 views
0
votes
0answers
49 views

Root finder vs. feedback loop

I have a simulation that applies a force to a particle in a simple constant gravitational acceleration environment, and uses FindRoot in conjunction with ...
1
vote
1answer
96 views

Output tracking for nonlinear ODE

I am trying to compute an output tracking controller for the following system. ...
3
votes
1answer
167 views

Label State Space Models converting ODEs

Say I have a set of differential equations not necessarily in first order form. I would like to build the corresponding state space model. When equations are many and long, it becomes difficult to ...
7
votes
1answer
208 views

Connecting Inputs and Outputs of Transfer Function Models

I am trying to use Mathematica's TransferFunctionModel object and SystemsModelFeedbackConnect function to approach the following ...
6
votes
3answers
2k views

DC gain of a transfer function

Consider this example. M = TransferFunctionModel[3/(s^2 - s + 5), s] the DC gain should be the value of the transfer function ...
3
votes
2answers
134 views

Solve nonlinear differential equations with some Eliminations

In these sets of equations and elims, Eliminate is not able to handle nonlinearity, so it does not give an answer for the desired output. Any suggestions? (I ...
2
votes
0answers
98 views

Constraining the independent variable in a control system

For an analog closed loop feedback control, I can do the following to model the response of a second-order physical system with an order 1 zeros polynomial to a step disturbance. I have a proportional ...