Ask Your Question
0

How to read this code?

asked 2012-08-16 22:29:28 +0100

yangzb gravatar image

updated 2012-08-16 23:11:32 +0100

calc314 gravatar image

In sage, I performed the laplace transformation:

de=diff(y,t,2)-diff(y,x,2)==k*sin(pi*x);de.laplace(t,s)

and got such a code:

s^2L(y(x,t),t,s)-D[0](y)(x,t)2D[0,0]L(y(x,t),t,s)?sy(x,0)?D[0]L(y(x,t),t,s)D[0,0](y)(x,t)?D[1](y)(x,0)=sksin(?x)

Can someone tells me what D[0](y)(x,t)2D[0,0]L(y(x,t),t,s) and D[0]L(y(x,t),t,s)D[0,0](y)(x,t) mean?
Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2012-08-16 23:18:44 +0100

calc314 gravatar image

updated 2012-08-19 08:57:21 +0100

Here is what I get.

var('y t s k')
y=function('y',x,t)
de=diff(y,t,2)-diff(y,x,2)==k*sin(pi*x)
de.laplace(t,s)

gives

s^2*laplace(y(x, t), t, s) - D[0](y)(x, t)^2*D[0, 0](laplace)(y(x, t), t, s) - s*y(x, 0) - D[0](laplace)(y(x, t), t, s)*D[0, 0](y)(x, t) - D[1](y)(x, 0) == k*sin(pi*x)/s

Within this expression, the meanings are:

$\frac{\partial y}{\partial t}$ = D[1](y)(x, t)

$\frac{\partial y}{\partial x}$ = D[0](y)(x, t)

$\frac{\partial^2 y}{\partial t^2}$ = D[1, 1](y)(x, t)

$\frac{\partial^2 y}{\partial x^2}$ = D[0, 0](y)(x, t)

So, D[0](y)(0, x) is $\frac{\partial y}{\partial t}|_{t=0}$.

You can check the first one above by doing diff(y,t).

edit flag offensive delete link more

Comments

But,shouldn't it be :s^2*L(y(t,x),t,s)-s*y(0,x)-D[0](y)(0,x)-D[1,1]L(y(t,x),t,s). on the left side?

yangzb gravatar imageyangzb ( 2012-08-18 03:24:47 +0100 )edit

If you scroll over to the right, I think it's all there.

calc314 gravatar imagecalc314 ( 2012-08-18 08:43:21 +0100 )edit

I think they are different between -D[0](Laplace)(y(t,x),t,s)*D[1,1](y)(t,x)-D[0,0](laplace)(y(t,x),t,s)*D[1](y)(t,x)^2 and -D[1,1]L(y(t,x),t,s).

yangzb gravatar imageyangzb ( 2012-08-19 02:53:54 +0100 )edit

I changed my answer above to so that we have y(x,t) like your question, rather than y(t,x).

calc314 gravatar imagecalc314 ( 2012-08-19 08:58:21 +0100 )edit

I got it. Thanks!

yangzb gravatar imageyangzb ( 2012-08-19 09:59:47 +0100 )edit
2

answered 2012-08-16 23:16:56 +0100

benjaminfjones gravatar image

What you're seeing is the displayed notation for symbolic partial derivatives. D[0] means "apply the derivative operator with respect to variable number 0" and D[0,0] represents two successive derivatives with respect to the variable. Observe:

sage: f = function('f', x)
sage: f.diff(x)
D[0](f)(x)
sage: f.diff(x).diff(x)
D[0, 0](f)(x)
edit flag offensive delete link more

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: 2012-08-16 22:29:28 +0100

Seen: 626 times

Last updated: Aug 19 '12