123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551 |
- Tue Apr 15 00:36:13 2008 run on win32
- *** binomial already defined as operator
- *** ~f already defined as operator
- % test file for ztrans package
- %
- operator f;
- operator g;
- operator h;
- % Examples for Z transformation
- ztrans(1,n,z);
- z
- -------
- z - 1
- ztrans(a,n,z);
- a*z
- -------
- z - 1
- ztrans((-1)^n,n,z);
- z
- -------
- z + 1
- ztrans(n,n,z);
- z
- --------------
- 2
- z - 2*z + 1
- ztrans(n^2,n,z);
- z*(z + 1)
- ---------------------
- 3 2
- z - 3*z + 3*z - 1
- ztrans(n^k,n,z);
- k
- ztrans(n ,n,z)
- % should be output=input
- ztrans((-1)^n*n^2,n,z);
- z*( - z + 1)
- ---------------------
- 3 2
- z + 3*z + 3*z + 1
- ztrans(binomial(n,m),n,z);
- z
- ------------------
- m
- (z - 1) *(z - 1)
- ztrans((-1)^n*binomial(n,m),n,z);
- z
- ---------------------
- m
- ( - z - 1) *(z + 1)
- ztrans(binomial(n+k,m),n,z);
- k
- z *z
- ------------------
- m
- (z - 1) *(z - 1)
- ztrans(a^n,n,z);
- - z
- -------
- a - z
- ztrans(a^(n-1),n,z);
- - z
- -----------
- a*(a - z)
- ztrans(a^(n+k),n,z);
- k
- - a *z
- ---------
- a - z
- ztrans((-1)^n*a^n,n,z);
- z
- -------
- a + z
- ztrans(1-a^n,n,z);
- z*(a - 1)
- ------------------
- 2
- a*z - a - z + z
- ztrans(n*a^n,n,z);
- a*z
- -----------------
- 2 2
- a - 2*a*z + z
- ztrans(n^3*a^n,n,z);
- 2 2
- a*z*(a + 4*a*z + z )
- -------------------------------------
- 4 3 2 2 3 4
- a - 4*a *z + 6*a *z - 4*a*z + z
- ztrans(binomial(n,m)*a^n,n,z);
- m
- - a *z
- ------------------
- m
- (z - a) *(a - z)
- ztrans(1/(n+1),n,z);
- z
- log(-------)*z
- z - 1
- ztrans(1/(n+2),n,z);
- z
- z*(log(-------)*z - 1)
- z - 1
- ztrans((-1)^(n)/(n+1),n,z);
- z
- - log(-------)*z
- z + 1
- ztrans((-1)^(n)/(n+2),n,z);
- z
- z*(log(-------)*z + 1)
- z + 1
- ztrans(a^(n-1)/(n+1),n,z);
- - z
- log(-------)*z
- a - z
- ----------------
- 2
- a
- ztrans(a^(n+k)/(n+1),n,z);
- k - z
- a *log(-------)*z
- a - z
- -------------------
- a
- ztrans(a^n/factorial(n),n,z);
- a/z
- e
- ztrans((n+1)*a^n/factorial(n),n,z);
- a/z
- e *(a + z)
- --------------
- z
- ztrans(1/factorial(n-1),n,z);
- 1
- ***** ERROR: zero divisor in sum(---------------------,n,0,infinity)
- n
- z *factorial(n - 1)
- % ERROR message o.k.
- ztrans((-1)^n/factorial(2*n+1),n,z);
- 1
- sqrt(z)*sin(---------)
- sqrt(z)
- ztrans((-1)^n/factorial(2*n),n,z);
- 1
- cos(---------)
- sqrt(z)
- ztrans(1/factorial(2*n+1),n,z);
- 1
- sqrt(z)*sinh(---------)
- sqrt(z)
- ztrans(1/factorial(2*n-1),n,z);
- 1
- ztrans(--------------------,n,z)
- factorial(2*n - 1)
- ztrans(1/factorial(2*n+3),n,z);
- 1
- z*(sqrt(z)*sinh(---------) - 1)
- sqrt(z)
- ztrans(1/factorial(2*n),n,z);
- 1
- cosh(---------)
- sqrt(z)
- ztrans(1/factorial(2*n+2),n,z);
- 1
- z*(cosh(---------) - 1)
- sqrt(z)
- ztrans(a^n/factorial(2*n+1),n,z);
- sqrt(a)
- sqrt(z)*sinh(---------)
- sqrt(z)
- -------------------------
- sqrt(a)
- ztrans(a^n/factorial(2*n),n,z);
- sqrt(a)
- cosh(---------)
- sqrt(z)
- ztrans(e^(a*n),n,z);
- - z
- --------
- a
- e - z
- ztrans(e^(a*(n+k)),n,z);
- a*k
- - e *z
- -----------
- a
- e - z
- ztrans(sinh(a*n),n,z);
- - sinh(a)*z
- ----------------------
- 2
- 2*cosh(a)*z - z - 1
- ztrans(cosh(a*n),n,z);
- z*(cosh(a) - z)
- ----------------------
- 2
- 2*cosh(a)*z - z - 1
- ztrans(sinh(a*n+p),n,z);
- - z*(sinh(a - p) + sinh(p)*z)
- --------------------------------
- 2
- 2*cosh(a)*z - z - 1
- ztrans(cosh(a*n+p),n,z);
- z*(cosh(a - p) - cosh(p)*z)
- -----------------------------
- 2
- 2*cosh(a)*z - z - 1
- ztrans(a^n*sinh(a*n),n,z);
- - sinh(a)*a*z
- -------------------------
- 2 2
- 2*cosh(a)*a*z - a - z
- ztrans(a^n*cosh(a*n),n,z);
- z*(cosh(a)*a - z)
- -------------------------
- 2 2
- 2*cosh(a)*a*z - a - z
- ztrans(n*sinh(a*n),n,z);
- 2
- sinh(a)*z*(z - 1)
- ------------------------------------------------------------
- 2 2 3 4 2
- 4*cosh(a) *z - 4*cosh(a)*z - 4*cosh(a)*z + z + 2*z + 1
- ztrans(n*cosh(a*n),n,z);
- 2
- z*(cosh(a)*z + cosh(a) - 2*z)
- ------------------------------------------------------------
- 2 2 3 4 2
- 4*cosh(a) *z - 4*cosh(a)*z - 4*cosh(a)*z + z + 2*z + 1
- ztrans(n^2*a^n*sinh(b*n),n,z);
- 2 4 2 2 2 4 3 3 6
- (sinh(b)*a*z*( - 4*cosh(b) *a *z - 4*cosh(b) *a *z + 16*cosh(b)*a *z + a
- 4 2 2 4 6 4 4 4 3 5 3
- - 5*a *z - 5*a *z + z ))/(16*cosh(b) *a *z - 32*cosh(b) *a *z
- 3 3 5 2 6 2 2 4 4
- - 32*cosh(b) *a *z + 24*cosh(b) *a *z + 48*cosh(b) *a *z
- 2 2 6 7 5 3 3 5
- + 24*cosh(b) *a *z - 8*cosh(b)*a *z - 24*cosh(b)*a *z - 24*cosh(b)*a *z
- 7 8 6 2 4 4 2 6 8
- - 8*cosh(b)*a*z + a + 4*a *z + 6*a *z + 4*a *z + z )
- ztrans(sin(b*n),n,z);
- - sin(b)*z
- ---------------------
- 2
- 2*cos(b)*z - z - 1
- ztrans(cos(b*n),n,z);
- z*(cos(b) - z)
- ---------------------
- 2
- 2*cos(b)*z - z - 1
- ztrans(sin(b*n+p),n,z);
- - z*(sin(b - p) + sin(p)*z)
- ------------------------------
- 2
- 2*cos(b)*z - z - 1
- ztrans(cos(b*n+p),n,z);
- z*(cos(b - p) - cos(p)*z)
- ---------------------------
- 2
- 2*cos(b)*z - z - 1
- ztrans(e^(a*n)*sin(b*n),n,z);
- a
- - e *sin(b)*z
- ---------------------------
- a 2*a 2
- 2*e *cos(b)*z - e - z
- ztrans(e^(a*n)*cos(b*n),n,z);
- a
- z*(e *cos(b) - z)
- ---------------------------
- a 2*a 2
- 2*e *cos(b)*z - e - z
- ztrans((-1)^n*e^(a*n)*sin(b*n),n,z);
- a
- - e *sin(b)*z
- ---------------------------
- a 2*a 2
- 2*e *cos(b)*z + e + z
- ztrans((-1)^n*e^(a*n)*cos(b*n),n,z);
- a
- z*(e *cos(b) + z)
- ---------------------------
- a 2*a 2
- 2*e *cos(b)*z + e + z
- ztrans(n*sin(b*n),n,z);
- 2
- sin(b)*z*(z - 1)
- ---------------------------------------------------------
- 2 2 3 4 2
- 4*cos(b) *z - 4*cos(b)*z - 4*cos(b)*z + z + 2*z + 1
- ztrans(n*cos(b*n),n,z);
- 2
- z*(cos(b)*z + cos(b) - 2*z)
- ---------------------------------------------------------
- 2 2 3 4 2
- 4*cos(b) *z - 4*cos(b)*z - 4*cos(b)*z + z + 2*z + 1
- ztrans(n^2*a^n*sin(b*n),n,z);
- 2 4 2 2 2 4 3 3 6
- (sin(b)*a*z*( - 4*cos(b) *a *z - 4*cos(b) *a *z + 16*cos(b)*a *z + a
- 4 2 2 4 6 4 4 4 3 5 3
- - 5*a *z - 5*a *z + z ))/(16*cos(b) *a *z - 32*cos(b) *a *z
- 3 3 5 2 6 2 2 4 4 2 2 6
- - 32*cos(b) *a *z + 24*cos(b) *a *z + 48*cos(b) *a *z + 24*cos(b) *a *z
- 7 5 3 3 5 7 8
- - 8*cos(b)*a *z - 24*cos(b)*a *z - 24*cos(b)*a *z - 8*cos(b)*a*z + a
- 6 2 4 4 2 6 8
- + 4*a *z + 6*a *z + 4*a *z + z )
- ztrans(cos(b*(n+1))/(n+1),n,z);
- z
- log(------------------------------)*z
- 2
- sqrt( - 2*cos(b)*z + z + 1)
- ztrans(sin(b*(n+1))/(n+1),n,z);
- sin(b)
- - atan(------------)*z
- cos(b) - z
- ztrans(cos(b*(n+2))/(n+2),n,z);
- z
- z*( - cos(b) + log(------------------------------)*z)
- 2
- sqrt( - 2*cos(b)*z + z + 1)
- ztrans((-1)^(n)*cos(b*(n+1))/(n+1),n,z);
- 2 3
- sqrt(2*cos(b)*z + z + 1)
- - log(----------------------------)*z
- sqrt(z)
- ztrans((-1)^(n)*sin(b*(n+1))/(n+1),n,z);
- sin(b)
- atan(------------)*z
- cos(b) + z
- ztrans(cos(b*n)/factorial(n),n,z);
- cos(b)/z sin(b)
- e *cos(--------)
- z
- ztrans(sin(b*n)/factorial(n),n,z);
- cos(b)/z sin(b)
- e *sin(--------)
- z
- ztrans(a*f(n)+b*g(n)+c*h(n),n,z);
- ztrans(f(n),n,z)*a + ztrans(g(n),n,z)*b + ztrans(h(n),n,z)*c
- ztrans(sum(f(k)*g(n-k),k,0,n),n,z);
- ztrans(f(n),n,z)*ztrans(g(n),n,z)
- ztrans(sum(f(k),k,0,n),n,z);
- ztrans(f(n),n,z)*z
- --------------------
- z - 1
- ztrans(sum(f(k),k,-2,n),n,z);
- 2
- (z*( - f(-1)*z + f(-1) - f(-2)*z + f(-2) + ztrans(f(n - 2),n,z)
- 2
- + ztrans(f(n - 2),n,z)*z - ztrans(f(n - 2),n,z)))/(z - 1)
- ztrans(sum(f(k),k,3,n),n,z);
- 2 2
- - f(2) - f(1)*z - f(0)*z + ztrans(f(n),n,z)*z
- --------------------------------------------------
- z*(z - 1)
- ztrans(sum(f(k),k,0,n+2),n,z);
- 2 2
- (z*( - f(1)*z + f(1) - f(0)*z + f(0) + ztrans(f(n),n,z) + ztrans(f(n),n,z)*z
- - ztrans(f(n),n,z)))/(z - 1)
- ztrans(sum(f(k),k,0,n-3),n,z);
- 2 2
- ztrans(f(n),n,z)*z - ztrans(f(n),n,z)*z + ztrans(f(n),n,z)
- --------------------------------------------------------------
- 2
- z *(z - 1)
- ztrans(sum(f(k),k,-2,n+3),n,z);
- 2 3 4
- (z*( - f(2)*z + f(2) - f(1)*z + f(1) - f(0)*z + f(0) - f(-1)*z + f(-1)
- 5 5
- - f(-2)*z + f(-2) + ztrans(f(n - 2),n,z) + ztrans(f(n - 2),n,z)*z
- - ztrans(f(n - 2),n,z)))/(z - 1)
- ztrans(sum(1/factorial(k),k,0,n),n,z);
- 1/z
- e *z
- --------
- z - 1
- ztrans(sum(1/factorial(k+2),k,0,n),n,z);
- 2 1/z
- z *(e *z - z - 1)
- ---------------------
- z - 1
- ztrans(n^2*sum(1/factorial(k),k,0,n),n,z);
- 1/z 3 2
- e *(2*z + 2*z - 3*z + 1)
- ------------------------------
- 3 2
- z*(z - 3*z + 3*z - 1)
- ztrans(sum(n^2/factorial(k),k,0,n),n,z);
- 1/z 3 2
- e *(2*z + 2*z - 3*z + 1)
- ------------------------------
- 3 2
- z*(z - 3*z + 3*z - 1)
- ztrans(sum(1/k,k,0,n),n,z);
- 1
- ***** ERROR: zero divisor in sum(------,n,0,infinity)
- n
- z *n
- % ERROR o.k.
- ztrans(sum(1/(k+1),k,0,n),n,z);
- z 2
- log(-------)*z
- z - 1
- -----------------
- z - 1
- ztrans(sum(1/(k+3),k,0,n),n,z);
- 2 z 2
- z *(2*log(-------)*z - 2*z - 1)
- z - 1
- ----------------------------------
- 2*(z - 1)
- ztrans(f(n+k),n,z);
- ztrans(f(k + n),n,z)
- % output=input
- ztrans(f(n+2),n,z);
- z*( - f(1) - f(0)*z + ztrans(f(n),n,z)*z)
- ztrans(f(n-k),n,z);
- ztrans(f( - k + n),n,z)
- % output=input
- ztrans(f(n-3),n,z);
- ztrans(f(n - 3),n,z)
- % output=input
- ztrans(a^n*f(n),n,z);
- z
- ztrans(f(n),n,---)
- a
- ztrans(n*f(n),n,z);
- - df(ztrans(f(n),n,z),z)*z
- ztrans(1/a^n,n,z);
- a*z
- ---------
- a*z - 1
- ztrans(1/a^(n+1),n,z);
- z
- ---------
- a*z - 1
- ztrans(1/a^(n-1),n,z);
- 2
- a *z
- ---------
- a*z - 1
- ztrans(2*n+n^2-3/4*n^3,n,x);
- 2
- x*(9*x - 28*x + 1)
- --------------------------------
- 4 3 2
- 4*(x - 4*x + 6*x - 4*x + 1)
- ztrans(n^2*cos(n*x),n,z);
- 3 4 3 2 6 4 2
- (z*( - 4*cos(x) *z + 4*cos(x) *z + cos(x)*z + 9*cos(x)*z - 9*cos(x)*z
- 5 4 4 3 5 3 3
- - cos(x) - 4*z + 4*z))/(16*cos(x) *z - 32*cos(x) *z - 32*cos(x) *z
- 2 6 2 4 2 2 7 5
- + 24*cos(x) *z + 48*cos(x) *z + 24*cos(x) *z - 8*cos(x)*z - 24*cos(x)*z
- 3 8 6 4 2
- - 24*cos(x)*z - 8*cos(x)*z + z + 4*z + 6*z + 4*z + 1)
- ztrans((1+n)^2*f(n),n,z);
- 2
- df(ztrans(f(n),n,z),z,2)*z - df(ztrans(f(n),n,z),z)*z + ztrans(f(n),n,z)
- ztrans(n^2*f(n),n,z);
- z*(df(ztrans(f(n),n,z),z,2)*z + df(ztrans(f(n),n,z),z))
- ztrans(n/factorial(n),n,z);
- 1/z
- e
- ------
- z
- ztrans(n^2/factorial(n),n,z);
- 1/z
- e *(z + 1)
- --------------
- 2
- z
- ztrans(a^n/factorial(n),n,z);
- a/z
- e
- ztrans(1/(a^n*factorial(n)),n,z);
- 1/(a*z)
- e
- ztrans(sum(f(k)*g(n-k),k,0,n),n,z);
- ztrans(f(n),n,z)*ztrans(g(n),n,z)
- ztrans(sum(f(k),k,0,n-1),n,z);
- ztrans(f(n),n,z)
- ------------------
- z - 1
- ztrans(sum(f(k),k,0,n),n,z);
- ztrans(f(n),n,z)*z
- --------------------
- z - 1
- ztrans(sum(1/factorial(k),k,0,n),n,z);
- 1/z
- e *z
- --------
- z - 1
- ztrans(sum(k/factorial(k),k,0,n),n,z);
- 1/z
- e
- -------
- z - 1
- ztrans(sum(a^k*k^2/factorial(k),k,0,n),n,z);
- a/z
- e *a*(a + z)
- ----------------
- z*(z - 1)
- ztrans(a^n*f(n),n,z);
- z
- ztrans(f(n),n,---)
- a
- ztrans(binomial(n,k),n,z);
- z
- ------------------
- k
- (z - 1) *(z - 1)
- ztrans(1/(n+1),n,z);
- z
- log(-------)*z
- z - 1
- ztrans(n/factorial(2*n+1),n,z);
- 1 1
- sqrt(z)*cosh(---------) - sinh(---------)*z
- sqrt(z) sqrt(z)
- ---------------------------------------------
- 2*sqrt(z)
- ztrans(a^n*sin(n*x+y),n,z);
- - z*(sin(x - y)*a + sin(y)*z)
- --------------------------------
- 2 2
- 2*cos(x)*a*z - a - z
- ztrans(n^3*sin(n*x+y),n,z);
- 3 4 2 4 2 2
- (z*(8*cos(x) *sin(y)*z + 4*cos(x) *sin(x - y)*z - 4*cos(x) *sin(x - y)*z
- 2 5 2 3 5
- + 16*cos(x) *sin(y)*z - 16*cos(x) *sin(y)*z + 8*cos(x)*sin(x - y)*z
- 6 4
- - 8*cos(x)*sin(x - y)*z + 2*cos(x)*sin(y)*z - 36*cos(x)*sin(y)*z
- 2 6 4 2
- + 10*cos(x)*sin(y)*z + sin(x - y)*z - 23*sin(x - y)*z + 23*sin(x - y)*z
- 5 3 4 4
- - sin(x - y) - 8*sin(y)*z + 32*sin(y)*z - 8*sin(y)*z))/(16*cos(x) *z
- 3 5 3 3 2 6 2 4
- - 32*cos(x) *z - 32*cos(x) *z + 24*cos(x) *z + 48*cos(x) *z
- 2 2 7 5 3
- + 24*cos(x) *z - 8*cos(x)*z - 24*cos(x)*z - 24*cos(x)*z - 8*cos(x)*z
- 8 6 4 2
- + z + 4*z + 6*z + 4*z + 1)
- ztrans((n+1)/factorial(n),n,z);
- 1/z
- e *(z + 1)
- --------------
- z
- ztrans(factorial(n)/(factorial(k)*factorial(n-k)),n,z);
- z
- ------------------
- k
- (z - 1) *(z - 1)
- % Examples for inverse Z transformation
- invztrans(z/(z-1),z,n);
- 2*n
- ( - 1)
- invztrans(z/(z+1),z,n);
- n
- ( - 1)
- invztrans(z/(z-1)^2,z,n);
- n
- invztrans(z*(z+1)/(z-1)^3,z,n);
- 2
- n
- invztrans(z/(z-1)^m,z,n);
- 2*n
- ( - 1) *binomial(n,m - 1)
- -----------------------------
- 2*m
- ( - 1)
- % invztrans(z/(z-1)^(m+1),z,n);
- % not yet supported
- invztrans(z/(z-1)^4,z,n);
- 2
- n*(n - 3*n + 2)
- ------------------
- 6
- invztrans((-1)^m*z/(z+1)^m,z,n);
- m
- ( - 1) *z
- invztrans(-----------,z,n)
- m
- (z + 1)
- % not yet supported
- invztrans(z/(z+1)^4,z,n);
- n 2
- ( - 1) *n*( - n + 3*n - 2)
- -----------------------------
- 6
- % invztrans(z^(k+1)/(z-1)^(m+1),z,n);
- % not yet supported
- invztrans(z^4/(z-1)^m,z,n);
- 2*n
- ( - 1) *binomial(n + 3,m - 1)
- ---------------------------------
- 2*m
- ( - 1)
- % invztrans(z^4/(z-1)^(m+1),z,n);
- % not yet supported
- % invztrans(z^4/(z-1)^m,z,n);
- % not yet supported
- % invztrans(z^(k+1)/(z-1)^5,z,n);
- % not yet supported
- invztrans(z^3/(z-a)^4,z,n);
- n 2
- a *n*(n + 3*n + 2)
- ---------------------
- 6*a
- invztrans(z/(z-a),z,n);
- n
- a
- invztrans(z/(z+a),z,n);
- n n
- a *( - 1)
- invztrans(z*(1-a)/((z-1)*(z-a)),z,n);
- n
- - a + 1
- invztrans(z*a/(z-a)^2,z,n);
- n
- a *n
- invztrans(z*3/(z-3)^2,z,n);
- n
- 3 *n
- % invztrans(a^m*z/(z-a)^(m+1),z,n);
- % not yet supported
- % invztrans(a^m*z/(z-a)^m,z,n);
- % not yet supported
- % invztrans(4^m*z/(z-4)^(m+1),z,n);
- % not yet supported
- invztrans(a^3*z/(z-a)^5,z,n);
- n 3 2
- a *n*(n - 6*n + 11*n - 6)
- -----------------------------
- 24*a
- invztrans(z*log(z/(z-1)),z,n);
- 2*n
- ( - 1)
- -----------
- n + 1
- invztrans(z*log(1+1/z),z,n);
- n
- ( - 1)
- ---------
- n + 1
- invztrans(z*log(z/(z-a)),z,n);
- n 2*n
- a *( - 1) *a
- ----------------
- n + 1
- invztrans(e^(a/z),z,n);
- n
- a
- --------------
- factorial(n)
- invztrans(e^(1/(a*z)),z,n);
- 1
- -----------------
- n
- a *factorial(n)
- invztrans((1+a/z)*e^(a/z),z,n);
- n
- a *(n + 1)
- --------------
- factorial(n)
- invztrans(e^(a/z)*(a+z)/z,z,n);
- n
- a *(n + 1)
- --------------
- factorial(n)
- invztrans(sqrt(z)*sin(1/sqrt(z)),z,n);
- n
- ( - 1)
- --------------------
- factorial(2*n + 1)
- invztrans(cos(1/sqrt(z)),z,n);
- n
- ( - 1)
- ----------------
- factorial(2*n)
- invztrans(sqrt(z)*sinh(1/sqrt(z)),z,n);
- 1
- --------------------
- factorial(2*n + 1)
- invztrans(cosh(1/sqrt(z)),z,n);
- 1
- ----------------
- factorial(2*n)
- invztrans(sqrt(z/a)*sinh(sqrt(a/z)),z,n);
- n
- a
- --------------------
- factorial(2*n + 1)
- invztrans(cosh(sqrt(a/z)),z,n);
- n
- a
- ----------------
- factorial(2*n)
- invztrans(z/(z-e^a),z,n);
- a*n
- e
- invztrans(z*sinh(a)/(z^2-2*z*cosh(a)+1),z,n);
- sinh(a*n)
- invztrans(z*(z-cosh(a))/(z^2-2*z*cosh(a)+1),z,n);
- cosh(a*n)
- invztrans(z*(z*sinh(p)+sinh(a-p))/(z^2-2*z*cosh(a)+1),z,n);
- cosh(a*n)*sinh(a)*sinh(p) + cosh(a)*sinh(a*n)*sinh(p) + sinh(a - p)*sinh(a*n)
- -------------------------------------------------------------------------------
- sinh(a)
- % trigsimp(ws);
- % trigsimp(ws,combine);
- invztrans(z*(z*cosh(p)-cosh(a-p))/(z^2-2*z*cosh(a)+1),z,n);
- ( - cosh(a - p)*sinh(a*n) + cosh(a*n)*cosh(p)*sinh(a)
- + cosh(a)*cosh(p)*sinh(a*n))/sinh(a)
- % trigsimp(ws);
- % trigsimp(ws,combine);
- invztrans(a*z*sinh(a)/(z^2-2*a*z*cosh(a)+a^2),z,n);
- n
- a *sinh(a*n)
- invztrans(z*(z-a*cosh(a))/(z^2-2*a*z*cosh(a)+a^2),z,n);
- n
- a *cosh(a*n)
- invztrans(z*(z^2-1)*sinh(a)/(z^2-2*z*cosh(a)+1)^2,z,n);
- 2
- sinh(a*n)*sinh(a) *n
- ----------------------
- 2
- cosh(a) - 1
- % trigsimp(ws);
- invztrans(z*((z^2+1)*cosh(a)-2*z)/(z^2-2*z*cosh(a)+1)^2,z,n);
- cosh(a*n)*n
- invztrans(z*sin(b)/(z^2-2*z*cos(b)+1),z,n);
- sin(b*n)
- invztrans(z*(z-cos(b))/(z^2-2*z*cos(b)+1),z,n);
- cos(b*n)
- invztrans(z*(z*sin(p)+sin(b-p))/(z^2-2*z*cos(b)+1),z,n);
- cos(b*n)*sin(b)*sin(p) + cos(b)*sin(b*n)*sin(p) + sin(b - p)*sin(b*n)
- -----------------------------------------------------------------------
- sin(b)
- % trigsimp(ws);
- % trigsimp(ws,combine);
- invztrans(z*(z*cos(p)-cos(b-p))/(z^2-2*z*cos(b)+1),z,n);
- - cos(b - p)*sin(b*n) + cos(b*n)*cos(p)*sin(b) + cos(b)*cos(p)*sin(b*n)
- --------------------------------------------------------------------------
- sin(b)
- % trigsimp(ws);
- % trigsimp(ws,combine);
- invztrans(z*e^(a)*sin(b)/(z^2-2*z*e^a*cos(b)+e^(2*a)),z,n);
- a*n
- e *sin(b*n)
- invztrans(z*(z-e^a*cos(b))/(z^2-2*z*e^a*cos(b)+e^(2*a)),z,n);
- a*n
- e *cos(b*n)
- invztrans(-z*e^a*sin(b)/(z^2+2*z*e^a*cos(b)+e^(2*a)),z,n);
- a*n n
- e *( - 1) *sin(b*n)
- invztrans(z*(z+e^a*cos(b))/(z^2+2*z*e^a*cos(b)+e^(2*a)),z,n);
- a*n n
- e *( - 1) *cos(b*n)
- invztrans(z*(z^2-1)*sin(b)/(z^2-2*z*cos(b)+1)^2,z,n);
- 2
- (sqrt(cos(b) - 1)*sin(b)*n
- 2 n 2 n
- *( - (cos(b) - sqrt(cos(b) - 1)) + (cos(b) + sqrt(cos(b) - 1)) ))/(2
- 2
- *(cos(b) - 1))
- % trigsimp(ws,expon);
- % trigsimp(ws,trig);
- invztrans(z*((z^2+1)*cos(b)-2*z)/(z^2-2*z*cos(b)+1)^2,z,n);
- 2 n 2 n
- n*((cos(b) - sqrt(cos(b) - 1)) + (cos(b) + sqrt(cos(b) - 1)) )
- -------------------------------------------------------------------
- 2
- % trigsimp(ws,expon);
- % trigsimp(ws,trig);
- invztrans(z*log(z/sqrt(z^2-2*z*cos(b)+1)),z,n);
- cos(b*n + b)
- --------------
- n + 1
- invztrans(z*atan(sin(b)/(z-cos(b))),z,n);
- sin(b*n + b)
- --------------
- n + 1
- invztrans(z*log(sqrt(z^2+2*z*cos(b)+1)/z),z,n);
- n
- ( - 1) *cos(b*n + b)
- ----------------------
- n + 1
- invztrans(z*atan(sin(b)/(z+cos(b))),z,n);
- n
- ( - 1) *sin(b*n + b)
- ----------------------
- n + 1
- invztrans(cos(sin(b)/z)*e^(cos(b)/z),z,n);
- cos(b*n)
- --------------
- factorial(n)
- invztrans(sin(sin(b)/z)*e^(cos(b)/z),z,n);
- sin(b*n)
- --------------
- factorial(n)
- invztrans((f+a*z+b*z^2)/(c+d*z+e*z^2),z,n);
- 2 n 2 n
- (2*(sqrt( - 4*c*e + d ) + d) *sqrt( - 4*c*e + d )*( - 1) *a*c*e
- 2 n 2 n
- - (sqrt( - 4*c*e + d ) + d) *sqrt( - 4*c*e + d )*( - 1) *b*c*d
- 2 n 2 n
- - (sqrt( - 4*c*e + d ) + d) *sqrt( - 4*c*e + d )*( - 1) *d*e*f
- 2 n n 2
- + 4*(sqrt( - 4*c*e + d ) + d) *( - 1) *b*c *e
- 2 n n 2
- - (sqrt( - 4*c*e + d ) + d) *( - 1) *b*c*d
- 2 n n 2
- - 4*(sqrt( - 4*c*e + d ) + d) *( - 1) *c*e *f
- 2 n n 2
- + (sqrt( - 4*c*e + d ) + d) *( - 1) *d *e*f
- 2 n 2
- - 2*(sqrt( - 4*c*e + d ) - d) *sqrt( - 4*c*e + d )*a*c*e
- 2 n 2
- + (sqrt( - 4*c*e + d ) - d) *sqrt( - 4*c*e + d )*b*c*d
- 2 n 2
- + (sqrt( - 4*c*e + d ) - d) *sqrt( - 4*c*e + d )*d*e*f
- 2 n 2 2 n 2
- + 4*(sqrt( - 4*c*e + d ) - d) *b*c *e - (sqrt( - 4*c*e + d ) - d) *b*c*d
- 2 n 2 2 n 2
- - 4*(sqrt( - 4*c*e + d ) - d) *c*e *f + (sqrt( - 4*c*e + d ) - d) *d *e*f)/(2
- n n 2
- *e *2 *c*e*(4*c*e - d ))
- % Example 1 in Bronstein/Semendjajew, p. 651
- f(0):=0;
- f(0) := 0
- f(1):=0;
- f(1) := 0
- f(2):=9;
- f(2) := 9
- f(3):=-2;
- f(3) := -2
- f(4):=23;
- f(4) := 23
- equation:=ztrans(f(n+5)-2*f(n+3)+2*f(n+2)-3*f(n+1)+2*f(n),n,z);
- 5 3 2
- equation := ztrans(f(n),n,z)*z - 2*ztrans(f(n),n,z)*z + 2*ztrans(f(n),n,z)*z
- 3 2
- - 3*ztrans(f(n),n,z)*z + 2*ztrans(f(n),n,z) - 9*z + 2*z - 5*z
- ztransresult:=solve(equation,ztrans(f(n),n,z));
- 2
- z*(9*z - 2*z + 5)
- ztransresult := {ztrans(f(n),n,z)=----------------------------}
- 5 3 2
- z - 2*z + 2*z - 3*z + 2
- result:=invztrans(part(first(ztransresult),2),z,n);
- n n n n n
- - i *( - 1) + 2*( - 1) *2 - i + 4*n
- result := -----------------------------------------
- 2
- % Example 2 in Bronstein/Semendjajew, p. 651
- clear(f);
- operator f;
- f(0):=0;
- f(0) := 0
- f(1):=1;
- f(1) := 1
- equation:=ztrans(f(n+2)-4*f(n+1)+3*f(n)-1,n,z);
- 3 2
- equation := (ztrans(f(n),n,z)*z - 5*ztrans(f(n),n,z)*z + 7*ztrans(f(n),n,z)*z
- 2
- - 3*ztrans(f(n),n,z) - z )/(z - 1)
- ztransresult:=solve(equation,ztrans(f(n),n,z));
- 2
- z
- ztransresult := {ztrans(f(n),n,z)=---------------------}
- 3 2
- z - 5*z + 7*z - 3
- result:=invztrans(part(first(ztransresult),2),z,n);
- n
- 3*3 - 2*n - 3
- result := ----------------
- 4
- % Other example:
- clear(f);
- operator f;
- f(0):=1;
- f(0) := 1
- f(1):=1;
- f(1) := 1
- operator tmp;
- equation:=ztrans((n+1)*f(n+1)-f(n),n,z);
- 2
- equation := - (df(ztrans(f(n),n,z),z)*z + ztrans(f(n),n,z))
- equation:=sub(ztrans(f(n),n,z)=tmp(z),equation);
- 2
- equation := - (df(tmp(z),z)*z + tmp(z))
- load_package odesolve;
- *** airy_ai already defined as operator
- *** airy_bi already defined as operator
- *** ci already defined as operator
- *** si already defined as operator
- oderesult:=odesolve(equation,tmp(z),z);
- 1/z
- oderesult := {tmp(z)=e *arbconst(1)}
- preresult:=invztrans(part(first(oderesult),2),z,n);
- arbconst(1)
- preresult := --------------
- factorial(n)
- solveresult:=
- solve({sub(n=0,preresult)=f(0),sub(n=1,preresult)=f(1)},arbconst(1));
- solveresult := {arbconst(1)=1}
- result:=preresult where solveresult;
- 1
- --------------
- factorial(n)
- end;
- Time for test: 2380 ms, plus GC time: 179 ms
|