octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60786] mpower: negative scalar to power of ma


From: anonymous
Subject: [Octave-bug-tracker] [bug #60786] mpower: negative scalar to power of matrix containing decimals returns nan
Date: Wed, 16 Jun 2021 09:48:44 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0

URL:
  <https://savannah.gnu.org/bugs/?60786>

                 Summary: mpower: negative scalar to power of matrix
containing decimals returns nan
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 16 Jun 2021 01:48:43 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 6.2.0
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

If a negative scalar A is raised to a matrix power A^P that contains decimals
(tried integers for a simple example first and it worked) mpower returns a
matrix of NaN. A Taylor series approximation of A^P and expm(log(A)*P) return
the expected result.


A=-2;
P=[.5 0;0 .5];
#Taylor expected result
v=zeros(2);
for k=0:10
  v+=(P*log(A))^k/factorial(k);
end
v
#explog expected result
expm(log(A)*P)
#mpower incorrect all NaN
A^P
mpower(A,P)





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60786>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]