Ask Your Question

roah's profile - activity

2018-03-21 08:17:35 -0600 received badge  Student (source)
2017-02-04 13:47:16 -0600 received badge  Notable Question (source)
2015-10-23 02:29:00 -0600 received badge  Famous Question (source)
2013-07-27 12:17:58 -0600 received badge  Notable Question (source)
2013-05-28 18:24:41 -0600 received badge  Popular Question (source)
2012-05-07 09:55:32 -0600 received badge  Popular Question (source)
2011-06-24 00:54:32 -0600 marked best answer how to properly substitute in a matrix?

Try this:

sage: solutions=solve(list(f.diff()),[x,y],solution_dict=True)
sage: solutions
[{y: 0, x: -I}, {y: 0, x: I}, {y: -1/2, x: 0}]
sage: H.subs(solutions[2])
[(x, y) |--> -1  (x, y) |--> 0]
[ (x, y) |--> 0  (x, y) |--> 2]

Or this:

sage: H(x,y).subs(solutions[2])
[-1  0]
[ 0  2]

I'm not sure exactly what output you are looking for.

The documentation for solve has some more information about this keyword.

2011-06-24 00:54:23 -0600 commented answer how to properly substitute in a matrix?

Thanks, kcrisman! Maybe it is possible to include these lines into Sage Reference Manual? In the manual one enters the point manually... I don't know how to do this...

2011-06-24 00:52:04 -0600 commented answer how to properly substitute in a matrix?

Thanks, niles!

2011-06-23 06:12:36 -0600 asked a question how to properly substitute in a matrix?

Let's consider a modified example from Sage reference manual

f(x,y)=x^2*y+y^2+y
solutions=solve(list(f.diff()),[x,y])
the_solution=solutions[2]
H=f.diff(2);  # Hessian matrix

How can i properly substitute the_solution into H?

I have tried:

H(x,y).subs(the_solution) - does not work.

This will work for H(x,y).subs(x==0)

H(x,y).subs_expr(*the_solution) - does not work.

This will work for f(x,y).subs_expr(*the_solution)

2011-06-18 04:49:10 -0600 commented answer latex typesetting for derivatives like g'

Thanks! Will try...

2011-06-18 04:48:50 -0600 received badge  Supporter (source)
2011-06-18 04:48:47 -0600 marked best answer latex typesetting for derivatives like g'

You can try to apply the patch attached to ticket #6344.

The patch review walk through contains instructions on how to apply patches.

2011-06-18 04:48:47 -0600 received badge  Scholar (source)
2011-06-17 07:29:02 -0600 asked a question latex typesetting for derivatives like g'

When i try:

f(x) = function('f',x)

g = diff(f(x),x)

latex(g)

I get: D[0]\left(f\right)\left(x\right)

But i would like to get something like: g'\left(x\right)

How can i do this with sage?