Ask Your Question
0

Functions order truncation (linearization)

asked 2019-10-22 14:25:00 +0100

I want from from expression like

$$e = (1 + h + \frac{\partial h}{\partial x}) (1 + h + \frac{\partial h}{\partial y})$$

arrive to

$$e \approx 1 + 2h + \frac{\partial h}{\partial x} + \frac{\partial h}{\partial y} + O(\dots)$$

by assumptions $h \ll 1; \frac{\partial h}{\partial x} \ll 1; \frac{\partial h}{\partial y} \ll 1$

Is there instrument for such transformations in sagemath? The problem I'm running into is $h$ being function of some vairables, while every occurance of big O notation in documentation operates on some ring variable.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-24 22:30:04 +0100

eric_g gravatar image

In such a case, I would introduce a "small" parameter, t say, substitute t*h for h, perform the expansion in term of t, and set t=1 in the final result. Here is the corresponding code:

sage: x, y = var('x y')
sage: h = function('h')
sage: H = h(x, y)
sage: e = (1 + H + diff(H, x)) * (1 + H + diff(H, y))
sage: e
(h(x, y) + diff(h(x, y), x) + 1)*(h(x, y) + diff(h(x, y), y) + 1)
sage: t = var('t')
sage: th(x, y) = t*H
sage: et = e.substitute_function(h, th)
sage: et
(t*h(x, y) + t*diff(h(x, y), x) + 1)*(t*h(x, y) + t*diff(h(x, y), y) + 1)
sage: taylor(et, t, 0, 1).subs({t: 1})
2*h(x, y) + diff(h(x, y), x) + diff(h(x, y), y) + 1
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

1 follower

Stats

Asked: 2019-10-22 14:25:00 +0100

Seen: 658 times

Last updated: Oct 24 '19