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
1
vote
1answer
24 views

Comparison of NDSolve and Asymptotic Output Tracking results: Problem identified

My question is a continuation of the topic: Asymptotic Output Tracking: Code Issues Edit: Take system of ODE for example: $\begin{cases} \frac{dx}{dt}=H \cdot \alpha \sin(\omega t)+\alpha \omega \cos(\...
2
votes
0answers
30 views

Affine state-space: Nonlinear output

I am using a system of equations to experiment: $\begin{cases} x_1'=x_2 \\ x_2'=x_1^2-x_2+u \end{cases} $ As an output, I want to use the following non-linear output: $y=e^{-x_1^2}$ ...
2
votes
1answer
138 views

Asymptotic Output Tracking: Code Issues

My question is a continuation of the topic Which way of solving from nonlinear control to choose?, and in the future I plan to expand this question. I want to try to apply this article https://www....
1
vote
0answers
32 views

Which way of solving from nonlinear control to choose?

I have a nonlinear system: \begin{cases} x'=f(x)+u \\ y=f(x) \end{cases} where $f(x)$ - gradient of some one-extremal function (for example $f=e^{-(x)^2}$), i.e. $\frac{df}{dx}$. I want to construct a ...
0
votes
0answers
55 views

NDSolve Error - There are fewer dependent variables, than equations, so the system is overdetermined

I have a program in which I am simulating the motion of two-wheel vehicle. I have four global parameters xo (position x of rear wheel), yo (position y of rear wheel), teta (the angle of inclination of ...
3
votes
1answer
54 views

How to code a Sum Block when working with Transfer Functions?

I am working using transfer functions models with Mathematica and i am missing a basic feature like the ability to use a Sum Block. How could the model above be modeled? Considering: ...
1
vote
0answers
84 views

Do Loop contained in a function defined within a custom package doesn’t work as expected but works fine when function is defined directly in a script

Below is my code and I am having problems running the StdMPC function that I am trying to define. Running my code gives me the error that the matrix A and Xopt[[i]] are not of compatible shapes for ...
0
votes
0answers
52 views

How to solve this linear complementarity problem with NDSolve or other functions? The arguments should be ordered consistently

I want to find a numerical solution of $\omega(t,q)$, where $t\in[0,T]$ and $q\in[0,N]$. $q_t$ is a determinstic w.r.t $t$, other unmentioned parameters can be fullfilled or given by the user. I met ...
1
vote
1answer
48 views

Changing the quality of the transient process in a nonlinear system (in Mathematica)

I urgently need advice and help. I have a system of differential equations like this: $\begin{cases} \frac{dx}{dt} == y[t] \cdot \alpha \cdot sin(\omega t) + \frac{d}{dt}(\alpha \cdot sin(\omega t)) ...
2
votes
1answer
55 views

How to combine Manipulate and OutputResponse to manipulate a transfer function

The webpage on Manipulate provides an example on section Examples > Applications of how to manipulate two parameters (the initial conditions) of an Initial Value Problem (ODE with initial ...
0
votes
0answers
28 views

Is there any formula to get the IRR from the slope of the Cumulative Cash Flow?

I've simulated a monthly regular cash flow with Excel, and the Internal Rate of Return (IRR) calculated from the first date to the current row. The curve of the IRR is very similar to the Transfer ...
3
votes
1answer
90 views

State Space Model in Controllable Canonical Form

Mathematica by default puts state space model realizations in controllable companion form, as seen here: ...
1
vote
0answers
69 views

Problem with the analytical study of transient processes in nonlinear systems with linear dynamic links

I ask for advice and help. I am having difficulties of this nature. There is a nonlinear system of the following type: I need to analyze analytically the transient process in such a system. The ...
22
votes
2answers
906 views

Can we use Mathematica to design an electronic active filter?

How can we use Mathematica to design an electronic implementation of an active filter?
2
votes
1answer
98 views

Linear Quadratic Integrator

With a given linear drive system ...
0
votes
1answer
39 views

Compiling RiccatiSolve LQRegulator gains

Given some specific matricies, numA, numB, numP, q and r to calculate LQR gains, one can use simply LQRegulatorGains or solve the same via ...
3
votes
2answers
75 views

Limiting transfer function of PID to upper and lower bounds

I have a question about Limiting the output of a transfer function in my system model. (Im fairly new to control theory and control systems) I have a model where a PID controller is directly ...
0
votes
0answers
81 views

How to solve Partial differential equation (PDE) with delay!

I just have one question please, I searched on Mathematica documents concerning partial differential equations with delay, all I had found is ordinary differential equations(EDO), that's means ...
4
votes
1answer
244 views

Estimation of parameters of limit cycles for systems of high-order differential equations (n> = 3)

There is a system of differential equations: Then, call the limit cycle the projection of the phase trajectory onto the plane in a pairwise combination of state variables ($x-y,y-z,x-z$). where $x,y,...
3
votes
1answer
71 views

TransferFunctionModel produces large coefficients

First, I define the following transfer functions using TransferFunctionModel: ...
4
votes
1answer
77 views

Finding group delay of transfer function

I'm having trouble finding the group delay of a transfer function. I've seen a solved question on here about finding the group delay, but I want to understand why my method doesn't work. Here is some ...
6
votes
1answer
97 views

How to use RiccatiSolve with symbolic matrix

According to the RiccatiSolve documentation the Eigensystem method can apply to symbolic matrices. However, I can not get it to ...
3
votes
1answer
33 views

Get the greatest time contant of a system's output given its expression

Let $y(t)$ be a function that consists of a sum of terms, each of which is in general a product of an exponential function $e^{\sigma t}$, and a sine function $\sin{\omega t}$ or cosine function $\cos{...
3
votes
0answers
64 views

Simple neural network with feedbacks in state-space form

Having studied more or less in detail the mechanisms of working with the state-space that Mathematica provides us with, I asked myself: can these tools be applied to neural networks? This article ...
7
votes
1answer
111 views

Implicit Riccati Equation Solver (to find the anti-stabilizing solution)

I've found that the latest MATLAB icare() solver includes the possibility to find also the anti-stabilizing solution of the Riccati equation. I haven't found a ...
8
votes
2answers
249 views

Converting a backward/forward sweep code for optimal control to _Mathematica_

I'm trying to convert to Mathematica a simple backward/forward sweep (with RK4 integrator) code to solve an optimal control problem in epidemiology, but I'm getting some error messages and I cannot ...
5
votes
1answer
261 views

Solution to the inverted pendulum problem (system of non-linear ODE)

A classic control systems problem is that of the translational inverted pendulum, as shown below. By applying a force $f(t)$ to the car (e.g. through a DC motor attached to the car), the goal is to ...
6
votes
1answer
263 views

Understanding code generated by MicrocontrollerEmbedCode

I've been using MicrocontrollerKit for a while now to generate code for little projects, inverse pendulums, filters, etc. Generally it works well. I am now currently trying to design a LQI (Linear ...
3
votes
2answers
210 views

Lagrangian of three-mass system with Mathematica

Before proceeding to calculations in Mathematica, I would like to clarify with knowledgeable people. There is an ordinary linear three-mass system. If we write its Lagrangian, we get the following ...
2
votes
1answer
64 views

Representation in state-space of a system with ideal and real differentiating links in feedback

There are two systems in the state space with an ideal and a real differentiator. For the first system, the code in Mathematica is as follows. ...
0
votes
1answer
59 views

Closed-Loop Systems and System Response Modeling [closed]

I'm testing out code from a textbook for possible bugs. This chapter demonstrates a plot of a motor's angular position response in accordance to it's transfer function model: ...
3
votes
1answer
105 views

Output response for state-space with piecewise nonlinear elements

In addition to the previous topic: System model merge with multiple input and one output For example, I am trying to reproduce a system from simulink, a diagram of which is shown in the figure below:...
5
votes
3answers
801 views

Mathematica and MATLAB giving different results from inverse Laplace transform [closed]

Given the transfer function gs = (5*s + 4)/(s^4 + 4*s^3 + 2*s^2 + 3*s); and the input signal ut = Sin[t + π/6; I want to get ...
3
votes
1answer
109 views

System model merge with multiple input and one output

I was curious, and I used the built-in functions of Mathematica to analyze the following scheme: I used SystemModelMerge as: ...
1
vote
1answer
98 views

Problem when solving Kalman filter in Mathematica: How to define a spectral density matrix and calculate the covariance matrix?

I am reading the classic book on state-space control theory by Bernard Friedland. In order to strengthen my understanding of Kalman filter, I want to reproduce Example 11A (Inverted pendulum on page ...
1
vote
1answer
87 views

Why doesn’t x’ = a.x + b.u, y = c . x + d.u hold in this state-space model?

I have noted that sometimes state variables may change (thanks Thomas’s help :)), due to the Mathematica’s internal automatic transformation from a descriptor state-space model to a standard state-...
2
votes
1answer
50 views

Confusing behavior of LQR control that strongly depends on system output (with odes solved by NDSolve)

I am implementing a LQR control of a 3-floors structure. Firstly, I obtained a reasonable result with my first code (Code 1 as shown below). In this code, the ...
7
votes
1answer
227 views

How to implement a Kalman or LQG regulator in the control of classical pendulum problem

My final purpose is to realize an LQG control of inverted pendulum. To this end, my first step I think is to build a Kalman regulator in Mathematica. The original Matlab version of Kalman filter is ...
1
vote
1answer
83 views

Strange output of a simple statespace model

The output of statespace model seems strange. In the follwing code, the odes are governing equations of a three floors structure, and the output are three accelerations of floors. If I ...
2
votes
1answer
49 views

Does NonlinearStateSpaceModel work with symbolic constants?

I'm trying to put a nonlinear system of two 2nd order ODEs given by: ...
1
vote
1answer
122 views

Experiments with Feedback Linearization and StateTransformLinearization in Mathematica

I have some nonlinear system, and i have three big question: Non-linear ODE from closed-loop system and Response 1. how correctly use such terms, like "Feedback Linearization and StateTransform ...
6
votes
1answer
178 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
55 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
150 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 ...
6
votes
1answer
198 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
751 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
74 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
79 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 $...
1
vote
1answer
329 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 ...
1
vote
1answer
69 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 ...