Test_D_ODE_tools.mw

Examples illustrating the  D_ODE_Tools Maple Package. 

 

Clara MASSE, John MASSE, François OLLIVIER 

 

> read
 

> with(D_ODE_tools); -1
 

Fonction that translates from one syntax to another. Diffalg does it too. And even much more. 

 

> resu1 := translate21([`+`(diff(f(x), x, x, x), `*`(theta, `*`(g(x))), diff(f(x), x, x))], x, [[f, 3], [g, 2]]); 1
 

[`+`(((`@@`(D, 3))(f))(x), `*`(theta, `*`(g(x))), ((`@@`(D, 2))(f))(x))] (1)
 

Differentiating with respect to a derivative. 

> safe_diff(`*`(`^`(diff(f(x), x, x), 2)), diff(f(x), x, x)); 1
 

`+`(`*`(2, `*`(diff(diff(f(x), x), x)))) (2)
 

The result here contains 3 lists: differential equations, initial conditions, times at which limit (or "initial") conditions are given. 

> DTOutput := 3; 1
 

3 (3)
 

> D_ODE([(D[1, 1, 1](f))(x) = 0], [(D[1, 1](f))(x2) = a2, (D(f))(x1) = a1, f(x0) = a0], 2, [a1, x0], [`*`(`^`(x0, 2)), `*`(`^`(a1, 2))]); 1
 

[((`@@`(D, 3))(f))(x) = 0, ((`@@`(D, 3))(f[x0]))(x) = 0, ((`@@`(D, 3))(f[a1]))(x) = 0, ((`@@`(D, 3))(f[`*`(a1, `*`(x0))]))(x) = 0], [((`@@`(D, 2))(f))(x2) = a2, (D(f))(x1) = a1, f(x0) = a0, ((`@@`(D, ...
[((`@@`(D, 3))(f))(x) = 0, ((`@@`(D, 3))(f[x0]))(x) = 0, ((`@@`(D, 3))(f[a1]))(x) = 0, ((`@@`(D, 3))(f[`*`(a1, `*`(x0))]))(x) = 0], [((`@@`(D, 2))(f))(x2) = a2, (D(f))(x1) = a1, f(x0) = a0, ((`@@`(D, ...
[((`@@`(D, 3))(f))(x) = 0, ((`@@`(D, 3))(f[x0]))(x) = 0, ((`@@`(D, 3))(f[a1]))(x) = 0, ((`@@`(D, 3))(f[`*`(a1, `*`(x0))]))(x) = 0], [((`@@`(D, 2))(f))(x2) = a2, (D(f))(x1) = a1, f(x0) = a0, ((`@@`(D, ...
(4)
 

This allows the formal resolution of systems including limit conditions at different times. 

We consider derivatives up to order 2, and exclude differentiating 2 times with respect to x0 or a1 with the list [x0^2 , a1^2] that will describe some "e-set" using the Gröbner package. 

The general solution is printed and the user is asked whever he wishes to continue, which would be useless but possibly time consuming if the general solution is not in closed form or very complicated. 

 

> Symb_Dsolve(D_ODE([(D[1, 1, 1](f))(x) = 0], [(D[1, 1](f))(x2) = a2, (D(f))(x1) = a1, f(x0) = a0], 2, [a1, x0], [`*`(`^`(x0, 2)), `*`(`^`(a1, 2))]), 1); 1
Symb_Dsolve(D_ODE([(D[1, 1, 1](f))(x) = 0], [(D[1, 1](f))(x2) = a2, (D(f))(x1) = a1, f(x0) = a0], 2, [a1, x0], [`*`(`^`(x0, 2)), `*`(`^`(a1, 2))]), 1); 1
 

 

{f(x) = `+`(`*`(`/`(1, 2), `*`(_C10, `*`(`^`(x, 2)))), `*`(_C11, `*`(x)), _C12), f[a1](x) = `+`(`*`(`/`(1, 2), `*`(_C7, `*`(`^`(x, 2)))), `*`(_C8, `*`(x)), _C9), f[x0](x) = `+`(`*`(`/`(1, 2), `*`(_C4,...
{f(x) = `+`(`*`(`/`(1, 2), `*`(_C10, `*`(`^`(x, 2)))), `*`(_C11, `*`(x)), _C12), f[a1](x) = `+`(`*`(`/`(1, 2), `*`(_C7, `*`(`^`(x, 2)))), `*`(_C8, `*`(x)), _C9), f[x0](x) = `+`(`*`(`/`(1, 2), `*`(_C4,...
[{f(x) = `+`(`*`(`/`(1, 2), `*`(a2, `*`(`^`(x, 2)))), `*`(`+`(`-`(`*`(a2, `*`(x1))), a1), `*`(x)), `-`(`*`(`/`(1, 2), `*`(a2, `*`(`^`(x0, 2))))), `*`(a2, `*`(x0, `*`(x1))), `-`(`*`(a1, `*`(x0))), a0),...
[{f(x) = `+`(`*`(`/`(1, 2), `*`(a2, `*`(`^`(x, 2)))), `*`(`+`(`-`(`*`(a2, `*`(x1))), a1), `*`(x)), `-`(`*`(`/`(1, 2), `*`(a2, `*`(`^`(x0, 2))))), `*`(a2, `*`(x0, `*`(x1))), `-`(`*`(a1, `*`(x0))), a0),...
(5)
 

We may check the result is fine.