Ask Your Question
0

Generating a Jacobian matrix for a set of multivariate polynomials

asked 12 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 12 years ago

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]
Preview: (hide)
link

Comments

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

GaryMak gravatar imageGaryMak ( 12 years ago )

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 ( 12 years ago )
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 ( 12 years ago )

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 ( 12 years ago )

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: 12 years ago

Seen: 2,506 times

Last updated: Feb 21 '13