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
votes
1answer
111 views

Problem with Lagrangian and Matrix Calculus in Mathematica

Continuing the questions: Lagrangian of three-mass system with Mathematica Equations of motion for two-mass torsional oscillator with the gear train Derivation of equations of motion for a multi-body ...
2
votes
2answers
54 views

Removing transient part in equation and solving for a general form

I have the following code that I run: ...
3
votes
1answer
132 views

Equations of motion for two-mass torsional oscillator with the gear train

This is my first topic and I continue work on that: Lagrangian of three-mass system with Mathematica I found interesting problem here, and try reproduce results. Assumption: $d_1=0$ Algorithm: Write ...
1
vote
1answer
138 views

How can I solve this system please?

I need to solve the following impulsive heat equation: $$ \left\{\begin{array}{ll} \partial_{t} \psi(x,t)-\partial_{xx} \psi(x,t)=0, & (x,t)\in (0,1) \times((0, 2) \backslash\{1\}) \\ \...
1
vote
3answers
80 views

BodePlot to calculate the amplitude and phase at a specific frequency

I have transfer function: $W=\frac{1}{s+1}$ tf = TransferFunctionModel[{{1/(s + 1)}}, s] BodePlot[tf, {.01, 100}] It is very simple to construct a Bode diagram, ...
1
vote
1answer
86 views

Asymptotic Output Tracking: Compensator properties

Asymptotic Output Tracking: Code Issues The question is, rather, of a theoretical nature (practical applications can be viewed in the topic at the link). Asymptotic Output Tracking is said to be based ...
2
votes
1answer
50 views

OutputResponse numerical error?

It shoud approach to 1 and remains at 1, but when time over 20s it deteriorates. Mathematica 12.1 ...
1
vote
0answers
67 views

Multidimensional obstacle avoidance in ODE. Part II

Multidimensional obstacle avoidance in ODE (Visualization) https://math.stackexchange.com/questions/4146255/multidimensional-obstacle-avoidance-in-ode For some time, I studied this question more ...
1
vote
2answers
68 views

Notation parse rule does parse when it acts as a argument

https://reference.wolfram.com/language/Notation/tutorial/NotationSymbolizeAndInfixNotation.html Notation[boxes ⟹ expr] set boxes to be parsed to expr I want a simplified notation for entering a ...
4
votes
1answer
117 views

Multidimensional obstacle avoidance in ODE (Visualization)

A simple 3-dimensional ODE system is given: $F=\begin{cases} \dot{x}=g+g_{U_{rep}} \\ \dot{g}=-g+\frac{df}{dx} \\ \dot{h}=-h+\frac{d^2f}{d^2x} \end{cases} $ Task: Make the variable $g$ move so that ...
1
vote
1answer
112 views

Tuning the optimal control synthesized according to the Pontryagin maximum/minimum principle and choosing the cost function

I continue to study the topic I started here: Problem with optimal control and Pontryagin's maximum principle A simple ODE system $(1)$ is given: $F=\begin{cases} \dot{x}=g \\ \dot{g}=-g+\frac{df}{...
6
votes
1answer
325 views

Problem with optimal control and Pontryagin's maximum principle

For dynamic system: $\dot{x}=\frac{df}{dx}+u$ where $f=e^{-x^2}$ It is necessary to develop optimal control, minimizing criterion: $J= \int_{0}^{t_f} ((\frac{df}{dx})^2+u^2) \,dt $ Algorithm: We ...
0
votes
0answers
30 views

FeedBack linearization and stabilization error

Consider nonlinear system: \begin{cases} \dot{x_1}=x_4+u \\ \dot{x_2}=-x_2+\frac{(\tanh(k \cdot x_5)+1)}{2}+U(t)+u \\ \dot{x_3}=-x_3+\dot{f} \\ \dot{x_4}=-x_4+x_3 \cdot s(t) \\ \dot{x_5}=-x_5+x_3 \...
1
vote
0answers
39 views

Nonlinear system with time-optimal control

Given nonlinear system: \begin{cases} \dot{x_1}=x_3+u \\ \dot{x_2}=-x_2+\dot{f} \\ \dot{x_3}=-x_3+x_2 \cdot \alpha \sin(\omega t) \\ \dot{x_4}=-x_4+x_2 \cdot (\frac{16}{\alpha^2}(\sin(\omega t)-\frac{...
0
votes
0answers
43 views

Asymptotic Output Tracking - How to Track?

Asymptotic Output Tracking: Code Issues Abstract state-space: \begin{cases} \dot{x_1}=x_3 \\ \dot{x_2}=-x_2+\frac{df}{dt} \\ \dot{x_3}=-x_3+x_2 \cdot \alpha \sin(\omega t) + u \\ \dot{x_4}=-x_4+x_2 \...
2
votes
1answer
34 views

AsymptoticOutputTracking for output with boundary condition

I want to try asymptotic output tracking, but with inequality. There is a differential equation: $\frac{dx}{dt}=\frac{d}{dx}(-x^4)$ With output $y=\frac{d}{dx}(-x^4)$, The output should strive for $0$,...
1
vote
1answer
59 views

AsymptoticOutputTracker to Matlab-Simulink

What is the structural scheme for AsymptoticOutputTracker in Mathematica? I need this in order to transfer the feedback signals received with the help of ...
5
votes
1answer
101 views

Is there a better way to simulate quadratic cost MPC problems?

Question I would like to know if there is a more straightforward or a better way to simulate MPC problems in terms of code length and accuracy as compared to what I am doing. I am looking to know if ...
1
vote
1answer
44 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
38 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
163 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
36 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
70 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
55 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
55 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
51 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
65 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
41 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
127 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
72 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
920 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
110 views

Linear Quadratic Integrator

With a given linear drive system ...
0
votes
1answer
44 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
82 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
106 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 ...
6
votes
1answer
334 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
79 views

TransferFunctionModel produces large coefficients

First, I define the following transfer functions using TransferFunctionModel: ...
4
votes
1answer
93 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
101 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
35 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
67 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 ...
6
votes
1answer
119 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
302 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
321 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
266 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
271 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
66 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
60 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
118 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:...