Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!tr22g12.aset.psu.edu!news.mathforum.org!not-for-mail
From: Torsten Hennig <Torsten.Hennig@umsicht.fhg.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: minimize cost function optimize integral gain
Date: Fri, 12 Mar 2010 09:50:30 EST
Organization: The Math Forum
Lines: 32
Message-ID: <197792925.369583.1268405460122.JavaMail.root@gallium.mathforum.org>
References: <hndj3h$gpr$1@fred.mathworks.com>
NNTP-Posting-Host: gallium.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1268405460 28567 144.118.94.39 (12 Mar 2010 14:51:00 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Fri, 12 Mar 2010 14:51:00 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:616276


> hi paul,
> it really helps.i have one more question, i have the
> differential equations(state space equations)for the
> system and i can solve the diff equations using ode
> and calculate the cost function. but the parameter
> integral gain is in the diff equations which is to be
> optimized.
> let me explain the problem(for example)
> minimize C=integral(x1^2+x2^2)dt
> where x1 and x2 state variables
> the state equations looks like
> 
> dx1/dt=-x1+ki/100;
> dx2/dt=-x1+x2+ki/20
> 
> here i want to find the value of ki which minimize
> the cost function.

Define a third differential equation by
dI/dt = x1^2 + x2^2, I(0)=0.
At t = tend, I(tend) gives you 
integral_{0}^{tend} (x1^2+x2^2) dt.
You see: 
For a given set of parameters ki, call ODE45 
from within the optimizer, integrate 
(including the ODE for I) and hand 
I(tend) to the optimizer.
It will then (hopefully) adjust the ki such that
the integral in question is minimized.

Best wishes
Torsten.