Równania rekurencyjne Table []
Transkrypt
Równania rekurencyjne Table []
Równaniarekurencyjne ? RSolve RSolve[eqn , a[n ], n ] solves a recurrence equation for a[n ]. RSolve[{eqn 1 , eqn 2 , …}, {a 1 [n ], a 2 [n ], …}, n ] solves a system of recurrence equations. RSolve[eqn , a[n 1 , n 2 , …], {n 1 , n 2 , …}] solves a partial recurrence equation. Zadanie Rozwiąż równania rekurencyjne a) an a(n-2) + a(n-1) z warunkami początkowymi a0 0,a1 1 b) an a(n-2) + a(n-1) z warunkami początkowymi a0 2,a1 1 c) an -9 a(n-2) - 6 a(n-1) z warunkami początkowymi d) a0 1,a1 -9 an -20 a(n-4) +4 a(n-3) +15a(n-2) +2 a(n-1) z warunkami początkowymi a0 6,a1 3,a2 71,a3 203 Table [] ? Table Table[expr , {i max }] generates a list of i max copies of expr . Table[expr , {i, i max }] generates a list of the values of expr when i runs from 1 to i max . Table[expr , {i, i min , i max }] starts with i = i min . Table[expr , {i, i min , i max , di }] uses steps di . Table[expr , {i, {i 1 , i 2 , …}}] uses the successive values i 1 , i 2 , …. Table[expr , {i, i min , i max }, {j, j min , j max }, …] gives a nested list. The list associated with i is outermost. Zadanie Wypisz przy pomocy funkcji Table listy funkcji LucasL[i] i Fibonacci[i] dla i od 1 do 10 2 Powtorka.nb Do[] ? Do Do[expr , {i max }] evaluates expr i max times. Do[expr , {i, i max }] evaluates expr with the variable i successively taking on the values 1 through i max (in steps of 1). Do[expr , {i, i min , i max }] starts with i = i min . Do[expr , {i, i min , i max , di }] uses steps di . Do[expr , {i, {i 1 , i 2 , …}}] uses the successive values i 1 , i 2 , …. Do[expr , {i, i min , i max }, {j, j min , j max }, …] evaluates expr looping over different values of j, etc. for each i. Zadanie Wypisz przy pomocy pętli Do i funkcji Print funkcje LucasL[i] i Fibonacci[i] dla i od 1 do 10 Moduł ? Module Module[{x , y , …}, expr ] specifies that occurrences of the symbols x , y , … in expr should be treated as local. Module[{x = x 0 , …}, expr ] defines initial values for x , …. Zadanie Napisz funkcję modułową FunkcjaModulowa[n_,funkcja_] która - pobiera jako argument liczbę n oraz funkcję funkcja - niech moduł ma zmienną lokalną a 1 - policz wewnatrz modułu a=∫-1 Pn (t) funkcja dt (Pn - funkcja Legendre’a) - niech moduł zwraca wykres funkcji a * Jn (t) (Jn - funkcja Bessela) t∈(0,10) Równaniaróżniczkowe ? DSolve DSolve[eqn , y , x ] solves a differential equation for the function y , with independent variable x . DSolve[eqn , y , {x , x min , x max }] solves a differential equation for x between x min and x max . DSolve[{eqn 1 , eqn 2 , …}, {y 1 , y 2 , …}, …] solves a list of differential equations. DSolve[eqn , y , {x 1 , x 2 , …}] solves a partial differential equation. Zadanie Rozwiąż równania różniczkowe a) (1 + t ^ 2) x ' (t ) + t x (t ) = t Powtorka.nb b) x ′ (t ) + x (t ) t sin(t ) z warunkiem poczatowym x(π)1 c) x ′ (t ) -y (t ) x ′ (t ) 5 y (t ) - 2 x (t ) z warunkiem poczatowym x(0)1 SzeregiFouriera ? FourierTrigSeries FourierTrigSeries[expr , t , n ] gives the n th-order Fourier trigonometric series expansion of expr in t . FourierTrigSeries[expr , {t 1 , t 2 , …}, {n 1 , n 2 , …}] gives the multidimensional Fourier trigonometric series of expr . ? FourierSeries FourierSeries[expr , t , n ] gives the n th-order Fourier series expansion of expr in t . FourierSeries[expr , {t 1 , t 2 , …}, {n 1 , n 2 , …}] gives the multidimensional Fourier series. Zadanie Rozwin w szereg Fouriera i w trygonometryczny szereg Fouriera a) t (2 - t ) sin(t ) b) cos(2 t ) sin(t ) c) θ(t ) (theta Heaviside’a) d) H3 (t ) (funkcja Hermite’a) do 3. rzędu TransformacjaFouriera In[3]:= ? FourierTransform FourierTransform[expr , t , ω] gives the symbolic Fourier transform of expr . FourierTransform[expr , {t 1 , t 2 , …}, {ω1 , ω2 , …}] gives the multidimensional Fourier transform of expr . ? InverseFourierTransform InverseFourierTransform[expr , ω, t ] gives the symbolic inverse Fourier transform of expr . InverseFourierTransform[expr , {ω1 , ω2 , …}, {t 1 , t 2 , …}] gives the multidimensional inverse Fourier transform of expr . Oblicz transformacje Fouriera i odwrotne transformacje Fouriera funkcji z poprzedniego zadania : a) t (2 - t ) sin(t ) b) cos(2 t ) sin(t ) 3 4 Powtorka.nb c) θ(t ) (theta Heaviside’a) Splot ? Convolve Convolve[f , g , x , y ] gives the convolution with respect to x of the expressions f and g . Convolve[f , g , {x 1 , x 2 , …}, {y 1 , y 2 , …}] gives the multidimensional convolution. Zadanie Oblicz splot funkcji cos(2 t ) sin(t ) i θ(t )