Question: 2d input glitch

Spawned from here. The code itself is perfectly fine, but if the definition of TD is in the same cell with the rest of the code, TD gives an error. The same definition in a separate cell works.

ans := dsolve({diff(y(t), `$`(t, 2)) = y(t), y(0) = a, (D(y))(0) = 0}, numeric, parameters = [a]); td := proc (x, tt) option remember; ans(parameters = [a = x]); eval([t, y(t), diff(y(t), t)], ans(tt)) end proc; TD := proc (k::{1, 2, 3}) options operator, arrow; proc (x, tt) options operator, arrow; td(x, tt)[k] end proc end proc

(TD(1))(.2, .2)

Error, (in unknown) invalid keyword expression

 

TD := proc (k::{1, 2, 3}) options operator, arrow; proc (x, tt) options operator, arrow; td(x, tt)[k] end proc end proc

(TD(1))(.2, .2)

.2

(1)

Download td.mw

Please Wait...