How can i write this Lyapunov equation in Matlab?

3 views (last 30 days)
Hello,
I would like to ask you how can i write this equation? I am new in Matlab, and i tried this code:
n = 100000;
x0 = 0.1;
step = 0.001;
e = exp(1);
a = [0.001 : step : 0.05];
a * e.^(n * lyap(a)) == abs(f.^n .* (x0 + a) - f.^n .* (x0));
e.^(n.* lyap(a)) == abs(f.^n .*(x0+a) - f.^n .* (x0));
lyap(a) == (1/n) .* ln((abs(f.^n * (x0+a) - f .^n * (x0))/a));
but i have this error:
>> Lyapunov
Error using lyap (line 23)
Not enough input arguments.
Error in Lyapunov (line 7)
a * e.^(n * lyap(a)) == abs(f.^n .* (x0 + a) - f.^n .* (x0));
Is it completely wrong or do i miss something?
Thank you!

Answers (1)

Shivang Srivastava
Shivang Srivastava on 25 Mar 2021
Hi Eleni,
As per my understanding you are having trouble using lyap function. As the error suggest you have not sent sufficient parameters in lyap function.
X = lyap(A,Q)
This is the correct syntax for lyap function. You may refer to lyap documentation for more information.

Categories

Find more on Matrix Computations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!