Ask Your Question
0

Generating a Jacobian matrix for a set of multivariate polynomials

asked 2013-02-21 11:26:45 +0100

GaryMak gravatar image

Hi I can see that this is implemented for schemes but I do not want it in such vast generality - I have a (long) list of variables vee=var('a b c d ... ') and a long list of explicit polynomials f1(vee), f2(vee), ... in those variables. What please is the neatest way in which to construct the Jacobian matrix of first derivatives in such a way that I obtain the symbolic matrix (and can calculate a symbolic determinant say), and also am able to evaluate it at a particular set of values for the variables? Thanks for any ideas.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-02-21 11:38:20 +0100

kcrisman gravatar image

Am I missing something? I feel like I'm under-interpreting your question with this answer.

sage: var('a,b,c,d')
(a, b, c, d)
sage: f1 = a*b+c^2+d
sage: f2 = b+c^2+d*8
sage: f3 = b+c^2+c*8
sage: f4 = d*b+c+c*8
sage: jacobian( [f1,f2,f3,f4], [a,b,c,d])
[      b       a     2*c       1]
[      0       1     2*c       8]
[      0       1 2*c + 8       0]
[      0       d       9       b]
edit flag offensive delete link more

Comments

no - you're just missing that i was too dumb to find this in the manual!! Thanks - and sorry!!

GaryMak gravatar imageGaryMak ( 2013-02-21 11:51:12 +0100 )edit

No problem. Don't forget, tab-completion is VERY useful here; you could have done `jac<tab>` and it would have auto-completed to include this command (presumably among several others).

kcrisman gravatar imagekcrisman ( 2013-02-21 22:12:28 +0100 )edit
2

thanks - i have never used that - will check it out. also i finally learnt what < and > is all about! That had been mystifying me for years!!

GaryMak gravatar imageGaryMak ( 2013-02-22 05:33:28 +0100 )edit

Hah, I didn't realize it would show up that way! Testing... jac<tab> works, but in the back ticks it doesn't.

kcrisman gravatar imagekcrisman ( 2013-02-22 08:51:04 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-02-21 11:26:45 +0100

Seen: 2,449 times

Last updated: Feb 21 '13