Tag Info

Hot answers tagged control-systems

Can we use Mathematica for electronics design?

An example of electronics design is the design of amplifiers using operation amplifiers (op amps). One common configuration is the inverting amplifier depicted below in a schematic entered in LTSpice (...
• 4,167

Can we use Mathematica to design an electronic active filter?

Here I would like to share with this great community by offering an example of active filter design. Introduction This Mathematica code determines the component values for a low-pass active filter ...
• 4,167
Accepted

Mathematica and MATLAB giving different results from inverse Laplace transform

You missed one term in Matlab. den=[1,4,2,3,0]; and not den=[1,4,2,3]; The order is important in Matlab. Since you do not have ...
• 137k

Solving optimal control problem when input is constrained

Semi-smooth Newton solver This is supposed to solve constrained optimization problems of the form $$\text{Minimize } F(x) \text{ subject to } \varPhi(x) = 0 \text{ and } \varPsi(x) \leq 0.$$ More ...
Accepted

Numerical optimal control

Oh boy, what a question! This is very similar to some stuff I played a few weeks ago (Kerbal, what a game!). What follows solves (I think) the question you are asking. An approach that seemed to to ...
• 7,884
Accepted

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

These aren't actual limit cycles and what you're looking for has a fuzzy definition (notice how the amplitude increases in each pass). However this is still fun to play with, so let's see what we can ...
• 19.6k
Accepted

Why does NonlinearStateSpaceModel linearise?

Consider a model where the nonlinearity is in $x'(t)$ and not in the highest derivative $x''(t)$. eq1 = {x''[t] + Sin[ x'[t]] + x[t] == u[t]}; Choose the first ...
• 8,576
Accepted

Problem with optimal control and Pontryagin's maximum principle

Pontryagin's minimum principle means that we have to use Euler-Lagrange equations. Therefore code looks like this ...
• 42k

Numerical optimal control

This is more of a long comment, hopefully you can find some of these ideas helpful because I don't know how to completely implement this. Therefore, I'd really appreciate comments from more ...
• 1,584
Accepted

How is this StateSpaceModel derived?

The standard method depends on what is called state space realization. Which involves determining $A,B,C,D$ from the transfer function of the ODE. The standard form of state space representation is ...
• 137k
Accepted

Solving an optimal control problem (LQR)

my solution A={{-1,0.5},{0.3,-1}}; B={{1},{1}}; x0={{1},{0}}; xT={{0},{1}}; You have to choose an end time T=10; Next you ...
• 650

Why does NonlinearStateSpaceModel linearise?

My guess is to be able to have the same internal representations as for linear systems. It is not possible to represent a system using A,B,C,D state space standard ...
• 137k
Accepted

Frequency Response

In Mathematica, you can work with the function h(z) directly, since Mathematica is symbolic based. In other words, while in Matlab one needs to work for numerical ...
• 137k
Accepted

Discrepancy between Matlab and Mathematica

Using Mathematica 10.4.1 (Windows 7) the following code finds a pretty good match with the Matlab results. (And I'd argue that any differences between the two are due to differences in how the ...
• 40.6k
Accepted

1D transient heat equation problem with controller

Here is a way to do it: ...
• 39.1k

Mathematica and MATLAB giving different results from inverse Laplace transform

With Mathematica you can also do the following ...
• 1,825
Accepted

How to index multi-dimensional vectors in NDSolve/WhenEvent?

You need to construct an event for each i from 1 to n: ...
• 234k

Solving Differential Equation System for HIV Treatment Model

Structuring the script. ...
• 3,838
Accepted

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

The system sysC needs to be modified as ...
• 8,576

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

According to chapter 9, "Mathematica’s NDSolve can take in boundary conditions, and system (9.26) can be directly input into it" (p. 239). Let's give it a try. ...
• 19.6k
Accepted

What does BodePlot actually calculate?

Your understanding of what BodePlot (with the default ScalingFunctions->{Automatic,"dB"}) computes is correct. ...
• 4,325
Accepted

DC gain of a transfer function

The k in zpk is not the same as the dc gain. Given transfer function $\frac{num(s)}{den(s)}$, we write the tf in the form $k\frac{(s-z_1)(s-z_2)\dots}{(s-p₁)(s-p₂)\dots}$ where $z_{i}$ are the zeros ...
• 137k
Accepted

Simulating a combination of PDEs and ODEs

This problem can be solved with the help of pdetoode. We first eliminate Ib0 and Ib1 from ...
• 63.9k
Accepted

Problem with solving an optimal control system with Shooting Method

In general, when FindRoot is initialized with two initial guesses for each variable, it uses them to estimate how the function to be solved varies locally with ...
• 60.8k
Accepted

Do we need to know the input signal when we use KalmanEstimator?

The short answer is yes, we need to know the input signal when using the Kalman filter. Let's consider an example. Let's say we have a robot and we want to estimate it's position as it drives around ...
• 27.4k
Accepted

Matrix Solve for a particular form

LyapunovSolve[] is designed for this: ...
Accepted

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

Things work much better if you use vectors instead of row/column matrices. Using LinearSolve[] and Chop[] in this case also ...
Accepted

Analyze stability of equilibria using Routh-Hurwitz conditions

There are "modified Routh-Hurwitz criteria" that work directly on the Jacobian matrix that I prefer and don't seem very well known (Fuller 1968). Here's a function I wrote that uses them for up to ...
• 19.6k

Mathematica and MATLAB giving different results from inverse Laplace transform

With Mathematica, I get significantly different results than your Mathematica results. I do not have access to matlab nor know whether the matlab code shown is correct. ...
• 152k