As of May 31, 2023, we have updated our Code of Conduct.

# Tag Info

### 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 (...

### 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 ...
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 ...

### 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 ...
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 ...
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 ...
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 ...

### 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 ...
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 ...
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 ...

### 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 ...
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 ...
Accepted

### 1D transient heat equation problem with controller

Here is a way to do it: ...

### Mathematica and MATLAB giving different results from inverse Laplace transform

With Mathematica you can also do the following ...

### Convert DE to first order?

To convert ODEs (or difference equations) to state-space form you can use the functions StateSpaceModel, AffineStateSpaceModel, ...

### Solving Differential Equation System for HIV Treatment Model

Structuring the script. ...
Accepted

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

The system sysC needs to be modified as ...

### 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. ...
Accepted

### What does BodePlot actually calculate?

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

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

You need to construct an event for each i from 1 to n: ...
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 ...
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 ...
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 ...
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 ...
Accepted

### Evaluation problems with NDSolve using the fixed step ExplicitEuler-Method

First, you're not using a fixed step method. (An Euler scheme may be applied to any step size and to one that varies.) To get a true fixed step method you have to turn off ...
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 ...