Sie sind auf Seite 1von 4

log(exp(x)-exp(y))

f(x,y)=log(exp(x)-exp(-y))
fx=f(x,y).diff(x)
fy=f.diff
fxx=f.diff(x,2)
fyy=f.diff(y,2)
fxy=fx.diff(y)
fyx=fy.diff(x)
#fxy.show(); fyx.show() # fxy=fyx
H(x,y)=matrix([[fxx,fxy],[fyx,fyy]]); H.show()
(x, y) x e (y)
e e

(x, y)

(x, y)

e(2 x)

(ex e(y) )
e(xy)

(ex e(y) )

(x, y)
(x, y)

e(y)
ex e(y)

e(xy)

(ex e(y) )
e(2 y)

(ex e(y) )

#diff(2)
f(x,y)=log(exp(x)-exp(-y))
grad = f.diff()
H = f.diff(2)
print H
[
(x, y) |--> e^x/(e^x - e^(-y)) - e^(2*x)/(e^x - e^(-y))^2
(x, y) |--> -e^(x - y)/(e^x - e^(-y))^2]
[
(x, y) |--> -e^(x - y)/(e^x - e^(-y))^2
(x, y) |--> -e^(-y)/(e^x - e^(-y)) - e^(-2*y)/(e^x - e^(-y))^2]

H=matrix([[e^x/(e^x - e^(-y)) - e^(2*x)/(e^x - e^(-y))^2,-e^(x


- y)/(e^x - e^(-y))^2],
[-e^(x - y)/(e^x - e^(-y))^2,-e^(-y)/(e^x - e^(-y)) - e^(-2*y)/
(e^x - e^(-y))^2]])
Traceback (click to the left of this block for traceback)
...
AttributeError:
'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense' object has
no attribute 'show'

$$ \nabla^2 f = \begin{pmatrix} e^x/(e^x - e^(-y)) - e^(2*x)/


(e^x - e^(-y))^2,-e^(x - y)/(e^x - e^(-y))^2 \\

-e^(x - y)/(e^x - e^(-y))^2&-e^(-y)/(e^x - e^(-y)) - e^(-2*y)/


(e^x - e^(-y))^2\end{pmatrix}
WARNING: Output truncated!
full_output.txt

An error occurred.
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live
2015/Debian) (preloaded format=pdflatex 2016.1.24) 7 FEB 2016 16:41
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**\nonstopmode \input{sage19.tex}
(./sage19.tex
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document
class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2013/01/14 v2.14 AMS math features
\@mathmargin=\skip43
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2000/06/29 v2.01

(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks14
\ex@=\dimen103
))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen104
)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count87

LaTeX Info: Redefining \frac on input line 210.


\uproot@=\count88
\leftroot@=\count89
LaTeX Info: Redefining \overline on input line 306.
\classnum@=\count90
\DOTSCASE@=\count91
LaTeX Info: Redefining \ldots on input line 378.
LaTeX Info: Redefining \dots on input line 381.
LaTeX Info: Redefining \cdots on input line 466.
\Mathstrutbox@=\box26
\strutbox@=\box27
\big@size=\dimen105
LaTeX Font Info:
Redeclaring font encoding OML on input line 566.
LaTeX Font Info:
Redeclaring font encoding OMS on input line 567.
\macc@depth=\count92
...

File: umsa.fd 2013/01/14 v3.01 AMS symbols A


)
LaTeX Font Info:
Try loading font information for U+msb on input
line 37.

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
LaTeX Font Info:
Try loading font information for U+rsfs on input
line 37.
(/usr/share/texlive/texmf-dist/tex/latex/jknapltx/ursfs.fd
File: ursfs.fd 1998/03/24 rsfs font definition file (jk)
)
! Missing $ inserted.
<inserted text>
$
l.39
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Display math should end with $$.
<to be read again>
\par
l.39

The `$' that I just saw supposedly matches a previous `$$'.


So I shall assume that you typed `$$' both times.
Overfull \hbox (121.47519pt too wide) detected at line 39
\OMS/cmsy/m/n/10 r[]\OML/cmm/m/it/10 f \OT1/cmr/m/n/10 = []
[]

[1

{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./sage19.aux)
)
Here is how much of TeX's memory you used:
2798 strings out of 494544
34795 string characters out of 6172592
88119 words of memory out of 5000000
6122 multiletter control sequences out of 15000+600000
6597 words of font info for 26 fonts, out of 8000000 for 9000
264 hyphenation exceptions out of 8191
38i,7n,26p,260b,110s stack positions out of
5000i,500n,10000p,200000b,80000s
</usr/shar
e/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb>&l\
t;/usr/share/texl
ive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr\
/share/texlive/te
xmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfb></usr/share/\
texlive/texmf-dis
t/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive\
/texmf-dist/fonts
/type1/public/amsfonts/cm/cmr7.pfb></usr/share/texlive/texmf-d\
ist/fonts/type1/p
ublic/amsfonts/cm/cmsy10.pfb>
Output written on sage19.pdf (1 page, 47071 bytes).
PDF statistics:
32 PDF objects out of 1000 (max. 8388607)
22 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)

None
full_output.txt

Das könnte Ihnen auch gefallen