12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547 |
- Sun Aug 18 20:47:47 2002 run on Windows
- *** 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
- ( - a + z) *(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;
- oderesult:=odesolve(equation,tmp(z),z);
- *** ci already defined as operator
- *** si already defined as operator
- 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: 69056 ms, plus GC time: 1482 ms
|