bugGNU Octave - Bugs: bug #54934, [octave forge] (symbolic) jacobian...

 
 

bug #54934: [octave forge] (symbolic) jacobian with second argument omitted

Submitter:  None
Submitted:  Thu 01 Nov 2018 05:16:02 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Need Info Assigned to:  None
Originator Name:  abuelo Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Release:  Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 02 Nov 2018 05:39:41 AM UTC, comment #2: 


> Does Matlab's 'jacobian' do something different in this case?


Unlikely, unless they special case for polar somehow.  `symvar` follows them pretty closely.

Colin Macdonald <cbm>
Thu 01 Nov 2018 07:07:47 PM UTC, comment #1: 

You haven't given jacobian a second argument to tell it what to take the derivative with respect to. In this case, the function calls 'symvar' on your input.

Since the input is simply an array of variables, symvar is a permutation of those same variables:


>> symvar ([r, phi, theta])
ans = (sym) [φ  r  θ]  (1×3 matrix)
>> symvar ([r, theta, phi])
ans = (sym) [φ  r  θ]  (1×3 matrix)


So the jacobian is taken with respect to [phi, r, theta], at least on my system with SymPy 1.3:


>> jacobian ([r, theta, phi], [phi, r, theta])
ans = (sym 3×3 matrix)

  ⎡0  1  0⎤
  ⎢       ⎥
  ⎢0  0  1⎥
  ⎢       ⎥
  ⎣1  0  0⎦


Does Matlab's 'jacobian' do something different in this case?

Mike Miller <mtmiller>
Group Member
Thu 01 Nov 2018 05:16:02 PM UTC, original submission:  

I am using
Symbolic pkg v2.7.1: Python communication link active, SymPy v1.3.

    syms x y z r theta phi
    x = r * cos(theta) * sin(phi)
    y = r * sin(theta) * sin(phi)
    z = r * cos(phi)
    jacobian([r theta phi])

returns:
ans = (sym 3×3 matrix)

  ⎡0  1  0⎤
  ⎢       ⎥
  ⎢0  0  1⎥
  ⎢       ⎥
  ⎣1  0  0⎦

¿should it not return?


  ⎡1  0  0⎤
  ⎢       ⎥
  ⎢0  1  0⎥
  ⎢       ⎥
  ⎣0  0  1⎦





Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cbm (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-01 mtmiller Summary[octave forge] (symbolic) jacobian [octave forge] (symbolic) jacobian with second argument omitted
    2018-11-01 mtmiller CategoryOctave Function Octave Package
        StatusNone Need Info
        Release4.2.2 dev
        SummaryUsing jacobian [octave forge] (symbolic) jacobian

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code