Re: Lyapunov Equation
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg947] Re: Lyapunov Equation
- From: Allan Hayes <hay%haystack at christensen.cybernetics.net>
- Date: Wed, 3 May 1995 00:26:32 -0400
A few days ago I posted a method of solution for Lyapunov's
equation (I called it LpSolve2) that uses LinearSolve and was quick
but ran into probems because it required the precision of the
input to be set higher than $MachinePrecision so as to force the use
of arbitrary precision arithmetic.
I hear from wri that this is due to a bug in LinearSolve that will
be corrected in the next version of Mma.
LpSolve2 may be then be expected to be speeded up as indicated by
the following ratios of the timings of LpSolve with
$MachinePrecision+1 and with $MachinePrecision inputs.
In[1]:=
Do[
Print[
{ n,
test[n];
Timing[LpSolve@@SetPrecision[{a,q},
$MachinePrecision +1
]][[1]]/
Timing[LpSolve[a,q]][[1]]
}
],
{n,2,9}]
Out[1]=
{2, 1.18182}
3, 1.66667}
{4, 1.67073}
{5, 1.83051}
{6, 1.92676}
{7, 1.95706}
{8, 1.99026}
{9, 2.14372}
On this basis the LpSolve2 time for n = 9 shown in the table that I
gave would be decreased to
26.0833/2.14372 = 12.1673 (seconds)
compared to 30.4167 seconds for the method LpSolve, which uses Solve,
and there will be no reduction of precision in the output with
increasing n --- but that is another issue.
Allan Hayes
hay at haystack.demon.co.uk