# 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 (...
• 4,604

### 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,604
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 ...
• 147k

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

### 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 ...
• 20.3k
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,796
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 ...
• 46.2k
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 ...
• 147k
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 ...
• 147k
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 ...
• 147k
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 ...
• 42.1k
Accepted

### 1D transient heat equation problem with controller

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

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

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

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

You need to construct an event for each i from 1 to n: ...
• 239k
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 ...
• 147k
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 ...
• 67.1k

### Solving Differential Equation System for HIV Treatment Model

Structuring the script. ...
• 3,963
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,796

### 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. ...
• 20.3k
Accepted

### What does BodePlot actually calculate?

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

### Transfer function for Rayleigh-Plesset equation

You can't have transfer function for nonlinear ode. You have to either first linearize it around some operating point, or use nonlinear state space representation. Mathematica has ...
• 147k
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.7k
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 ...
• 20.3k

### 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. ...
• 160k
Accepted

### Understanding code generated by MicrocontrollerEmbedCode

The value 84.38063590995105=-26.8592*π is a residue that pops up if the equilibrium value is not set correctly. There are a few things that need to be changed to ...
• 8,796
Accepted

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

Do I have to use NDSolve? Yes If so, how? Something like ...
• 147k