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
2 votes
5 answers
432 views

Finding a way to skip an iteration in a table

I am creating a project in Wolfram that models oil slicking using Cellular Automata. In my project I have a function called vonNeumann Neighborhood that takes in a radius and a length of a size of a ...
Kopiaobia's user avatar
1 vote
0 answers
40 views

Limiting State-space Controller

I have a state-space representation of a system with a few inputs and outputs. Further, I've used LQRegulatorGains to (surprise, surprise) construct an LQ regulator controller. This is all well and ...
Davis Last's user avatar
0 votes
0 answers
39 views

How to plot the input to a state-space closed loop model?

I have a mathematica notebook to build the state-space model of a system from its differential equations, calculate LQR gains and simulate the system response. ...
Hussein Fawzy's user avatar
0 votes
0 answers
40 views

How to use the OutputResponse function with multiple inputs?

I have a state-space model with 2 inputs and 2 outputs. The documentations of mathematica to obtain the output response define the usage as ...
Hussein Fawzy's user avatar
0 votes
0 answers
52 views

How to set reference value a State-Space Model with simulating the reponse?

I have a mathematica notebook to build the state-space model of a system from its differential equations, calculate LQR gains and simulate the system response. ...
Hussein Fawzy's user avatar
0 votes
0 answers
33 views

Problem in visualization of control variable from the NDSolveValue solution

I am trying to solve some optimal control problem with free endpoint and bounded control in the switching environment. First of all, it would be great if someone will check the code and the logic ...
San's user avatar
  • 1
-1 votes
1 answer
78 views

How to Paste Complex Transfer Function Equation to Excel [closed]

I am trying to paste this transfer function to Excel, is it possible?
analog_designer's user avatar
0 votes
1 answer
75 views

How can i derive this using StateSpaceModel?

Please how can I solve this using StateSpaceModel. eqns := {(lp \[Theta]''[t]) + m g Sin [\[Theta][t]] + c \[Theta]'[t] - Sin [\[Theta][t]] y0''[t] == 0};
Tetrasreal's user avatar
4 votes
1 answer
78 views

Discontinuous ODE results in NDSolve::ndinid warning, initial condition is not in the range specified by the discrete variable (internal variable)

The equations and code are below. The short version is: I know the error is because NDSolve is doing something in the background to handle the discontinuous ODE. ...
Nolan King's user avatar
2 votes
1 answer
67 views

Matrix Rank Error

I have a linear State Space model and was trying to tell if it was completely controllable. When I get the matrix with ControllabilityMatrix and then calculate the rank I get an incorrect matrix rank ...
Ivan Beck's user avatar
3 votes
1 answer
130 views

Possible Lagrangian: ODE and System of ODE's

For the Lagrangian: ...
dtn's user avatar
  • 2,374
1 vote
2 answers
137 views

NDSolve with piece-wise function and BVP

How to numerically solve a system of differential equation with boundary conditions and piece wise affine functions ? Consider the following system of differential equations from some optimal control ...
Kredan's user avatar
  • 11
1 vote
0 answers
56 views

Phase unwrapping of transfer function model for calculating group delay [duplicate]

Suppose that I have a transfer function model ...
km3's user avatar
  • 51
0 votes
2 answers
223 views

Plotting horizontal lines on Bode plot

I have an array of transfer functions and plotted multiple Bode plot. Now I need to add a horizontal line to show where all these Bode plots attain a gain of -8db. I know that previously people ...
km3's user avatar
  • 51
2 votes
1 answer
237 views

The nonlinear state-space model of a spherical pendulum cannot be linearized and cannot be controlled?

I am attempting to model and control a spherical pendulum. I have derived the equations as follows: ...
Maher 's user avatar
  • 23
5 votes
3 answers
342 views

Calculating the n derivative of state space equations

I have a nonlinear model ${\bf{\dot x}} = f\left( {\bf{x}} \right) $ which is represented as follows: $$\begin{array}{l}{{\dot x}_1} = {x_2}\\{{\dot x}_2} = {x_3} - \alpha {x_4}{x_2} + \frac{\alpha }{...
TanjiroLL's user avatar
  • 151
2 votes
2 answers
208 views

Why does this PhaseRange not work?

Any idea why this PhaseRange does not work? BodePlot[-(1/(s + 1000)), PlotLayout -> "Phase", PhaseRange -> {0, 2 \[Pi]}]
hana's user avatar
  • 2,688
0 votes
1 answer
293 views

Solve Riccati Equations by hand

I'm in the midst writing a bit about LQR problems and would like to show that some things in mathematica can be tested by trying to write such problems out by ones self, However I cannot seem to find ...
DrMrstheMonarch's user avatar
1 vote
1 answer
224 views

How to excite a transfer function with continuous white noise

I'm trying to get the output response of linear system represented by transfer function, once the white noise is given as an input. Here's the code:- For generating continuous noise, I'm getting help ...
Atif Qayyum's user avatar
6 votes
1 answer
136 views

What does BodePlot actually calculate?

I'm using Mathematica v12.3 student edition, running on Windows 10 Home (AMD Ryzen 5 4500U with Radeon Graphics 2.38 GHz). I'm trying to get a Bode plot of an example function. I try to do it with the ...
Merro's user avatar
  • 63
0 votes
1 answer
110 views

Asymptotic bode plot [closed]

Is it possible to plot an asymptotic bode plot. I am interested in verifying my straight line bode plot approximations done by hand by using mathematica but the bodeplot function generates the curved ...
user15588486's user avatar
1 vote
0 answers
267 views

Linearization of the ODE system: Problems

I have summarized the issues covered in the topics: Linearization of ODE without an equilibrium I ask for help with commands TransferFunctionModel + StateSpaceModel Plot3D + WhenEvent + NDSolve ...
dtn's user avatar
  • 2,374
1 vote
1 answer
77 views

I ask for help with commands TransferFunctionModel + StateSpaceModel

Given system of ODE: $\begin{cases} \dot{x}=G+u_1 \\ \dot{z}=-z+\frac{df}{dt} \\ \dot{G}=-G+z \cdot u_2 \end{cases}$ where $f=-x^2$, $u_1=\frac{d}{dt}(\alpha \sin(\omega \cdot t))$ and $u_2=\alpha \...
dtn's user avatar
  • 2,374
-1 votes
1 answer
199 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 ...
dtn's user avatar
  • 2,374
2 votes
2 answers
77 views

Removing transient part in equation and solving for a general form

I have the following code that I run: ...
Jan Eerland's user avatar
  • 1,941
3 votes
1 answer
310 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 ...
dtn's user avatar
  • 2,374
1 vote
1 answer
155 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\}) \\ \...
walid fssm's user avatar
1 vote
3 answers
662 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, ...
dtn's user avatar
  • 2,374
1 vote
1 answer
96 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 ...
dtn's user avatar
  • 2,374
2 votes
1 answer
67 views

OutputResponse numerical error?

It shoud approach to 1 and remains at 1, but when time over 20s it deteriorates. Mathematica 12.1 ...
eason's user avatar
  • 197
1 vote
0 answers
74 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 ...
dtn's user avatar
  • 2,374
1 vote
2 answers
80 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 ...
eason's user avatar
  • 197
4 votes
1 answer
146 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 ...
dtn's user avatar
  • 2,374
1 vote
1 answer
274 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}{...
dtn's user avatar
  • 2,374
10 votes
2 answers
1k 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 ...
dtn's user avatar
  • 2,374
1 vote
0 answers
73 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{...
dtn's user avatar
  • 2,374
0 votes
0 answers
54 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 \...
dtn's user avatar
  • 2,374
2 votes
1 answer
45 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$,...
dtn's user avatar
  • 2,374
1 vote
1 answer
77 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 ...
dtn's user avatar
  • 2,374
5 votes
1 answer
143 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 ...
ModCon's user avatar
  • 225
1 vote
1 answer
62 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(\...
dtn's user avatar
  • 2,374
2 votes
0 answers
96 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}$ ...
dtn's user avatar
  • 2,374
2 votes
1 answer
186 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....
dtn's user avatar
  • 2,374
1 vote
0 answers
38 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 ...
dtn's user avatar
  • 2,374
0 votes
0 answers
270 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 ...
Kacper's user avatar
  • 1
3 votes
1 answer
122 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: ...
zurg's user avatar
  • 117
1 vote
0 answers
87 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 ...
ModCon's user avatar
  • 225
0 votes
0 answers
102 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 ...
Hot Pizza's user avatar
1 vote
1 answer
58 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)) ...
dtn's user avatar
  • 2,374
2 votes
1 answer
147 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 ...
alejnavab's user avatar
  • 453

1
2 3 4 5