Ticket #11541 (new enhancement)
Opened 2 years ago
Add example with solution_dict and substituting in a matrix
| Reported by: | kcrisman | Owned by: | mvngu |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-5.11 |
| Component: | documentation | Keywords: | beginner matrix solve symbolic |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
See this ask.sagemath.org question. The poster wants an example something like
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
but showing 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]
sage: H(x,y).subs(solutions[2])
[-1 0]
[ 0 2]
This seems like a reasonable request.
Note: See
TracTickets for help on using
tickets.
