I write supplemental explanation to render my aim of optimization.
First Consider discrete time linear system below:
\begin{equation} G(z)=\frac{1-e^{-0.3T}}{z^{100}(z-e^{-0.3T})} \end{equation}
where $z = e^{j\omega}$ and $\omega$ is frequency, $\omega \in [-\pi,\pi)$, and $T$ is sampling period, assume that $T = 1$. It's obvious that the absolute value of $z$ is equal to $1$ for all $\omega$ between $-\pi$ and $\pi$.
When one is talking about maximum absolute value of $G(z)$, in fact he/she consider below function :
\begin{equation} \max_{\omega} |G(e^{j\omega})|=|\frac{1-e^{-0.3T}}{e^{j\omega}-e^{-0.3T}}| . \end{equation}
note that $|z^{100}| = |z|^{100} = 1.$
On the other hand consider another discrete time linear system :
\begin{equation} C(z) = \frac{(x+\frac{T}{2}y)z+(\frac{T}{2}y-x)}{z-1} \end{equation}
Consider these two linear system connected serially.Then the closed loop system transfer function (with unity feedback) is:
\begin{equation} f(x,y,z) = \frac{G(z)C(z)}{1+G(z)C(z)}\end{equation}
or
\begin{equation} f(x,y,e^{j\omega}) = \frac{G(e^{j\omega})C(e^{j\omega})}{1+G(e^{j\omega})C(e^{j\omega})}\end{equation}
My aim is to minimize the maximum absolute value of $f$ (respect to $\omega$) over $x $ and $ y$ as mathematically described bellow:
\begin{equation} \min_{x, y} \max_{z \; or \; \omega} |f(x,y,z)|\end{equation}
This is equal to minimizing the $L_\infty$ norm of $f$ (respect to $\omega$) over $x$ and $y$ (right?) In fact:
\begin{equation}\min_{x, y} \max_{\omega} |f(x,y,\omega)| \equiv \min_{x, y} ||f(x,y,\omega)||_{\infty , \;\omega}\end{equation}
How can I do the optimization with Mathematica?
I try the code below for defining the function and maximizing $f$ respect to $z$:
T = 0.01
z = Exp[I w]
f = (((x + (T/2) y) z + ((T/2) y - x)) (1 - Exp[-0.3 T]))/(
(z^100) (z - Exp[-0.3 T]) (z - 1) + ((x + (T/2) y) z + ((T/2) y - x)) (1 - Exp[-0.3 T]))
maxp = First[ NMaximize[{f[x, y, w], 0 <= w <= 10}, w, Method -> DifferentialEvolution]]
But when I run code, the following error appears:
NMaximize::nnum: The function value -((0.0029955 (-x + (0.89724 + 0.441543 I) (x + 0.005 y) + 0.005 y))/((0.120832 -0.165872 I) + 0.0029955 ( -x + (0.89724 + <<20>> I) (<<1>>)+0.005 y)))[x,y,0.457318] is not a number at {w} = {0.457318}. >>
I try different intervals for $w$ but nothing changed.
What's wrong with it?
{x,y}
, and that is precisely the sort of thing covered at the links I posted. $\endgroup$ – Daniel Lichtblau Jan 23 '14 at 15:51f[x_,p_Real,n_]
means the functionf[]
will not evaluate UNLESS that argument is an explicit real number, e.g. f[x,5.3,2]. This is useful for preventing a calling function like` NMinimize` from treatingf[x,p,n]
as symnolic, attempting preprocessing to find say a gradient, that sort of thing. $\endgroup$ – Daniel Lichtblau Jan 23 '14 at 16:46