X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/9f4798446bbb3ac43f7b8291ddae095af3818299..161d0ced692386a866e55aea673d991e2e95f753:/examples/nsad2010.py?ds=sidebyside diff --git a/examples/nsad2010.py b/examples/nsad2010.py index e2cacc7..1bf97d8 100755 --- a/examples/nsad2010.py +++ b/examples/nsad2010.py @@ -2,17 +2,13 @@ from pypol import * -def affine_derivative_closure(T, x0s): +def affine_derivative_closure(T, x0s, xs): - xs = [Symbol("{}'".format(x0.name)) for x0 in x0s] - dxs = [Symbol('d{}'.format(x0.name)) for x0 in x0s] - k = Symbol('k') + dxs = [x0.asdummy() for x0 in x0s] + k = Dummy('k') for x in T.symbols: assert x in x0s + xs - for dx in dxs: - assert dx.name not in T.symbols - assert k.name not in T.symbols T0 = T @@ -48,5 +44,5 @@ i0, j0, i, j = symbols(['i', 'j', "i'", "j'"]) T = Eq(i, i0 + 2) & Eq(j, j0 + 1) print('T =', T) -Tstar = affine_derivative_closure(T, [i0, j0]) +Tstar = affine_derivative_closure(T, [i0, j0], [i, j]) print('T* =', Tstar)