Sponsored links: Algebra eBooks
 

Related

ratnumer

ratnumer(0.5);

Calculate

ratnumer-solve

H1(z):=((z-2/3)*(z+3/...

l:solve(ratnumer(H1(z...

nu;

Calculate

ratnumer

ratnumer(0.5);

ratnumer(1.7);

Calculate

ratnumer

ratnumer(0.5);

Calculate

ratnumer-solve

H1(z):=((z-2/3)*(z+3/...

l:solve(ratnumer(H1(z...

nu;

Calculate

ratnumer

ratnumer(0.5);

ratnumer(1.7);

Calculate

ratnumer

Run Example
(%i1)H(z):=(z+1/3)*(z-3/2)*(z-2)/z^3;
                                     1       3
                                (z + -) (z - -) (z - 2)
                                     3       2
(%o1)                   H(z) := -----------------------
                                           3
                                          z
(%i2) Ha1(z):=(z-3/2)*(z-2)/((z-2/3)*(z-1/2));
                                          3
                                     (z - -) (z - 2)
                                          2
(%o2)                      Ha1(z) := ---------------
                                          2       1
                                     (z - -) (z - -)
                                          3       2
(%i3) Hm1(z):=(z+1/3)*(z-1/2)*(z-2/3)/z^3;
                                      1       1       2
                                 (z + -) (z - -) (z - -)
                                      3       2       3
(%o3)                  Hm1(z) := -----------------------
                                            3
                                           z
(%i4) Ha2(z):=(z+1/3)*(z-3/2)*(z-2)/((z+3)*(z-2/3)*(z-1/2));
                                      1       3
                                 (z + -) (z - -) (z - 2)
                                      3       2
(%o4)                  Ha2(z) := -----------------------
                                              2       1
                                 (z + 3) (z - -) (z - -)
                                              3       2
(%i5) Hm2(z):=(z+3)*(z-2/3)*(z-1/2)/(z^3);
                                              2       1
                                 (z + 3) (z - -) (z - -)
                                              3       2
(%o5)                  Hm2(z) := -----------------------
                                            3
                                           z
(%i6) l:solve(ratnumer(H(z)),z);
                                   1      3
(%o6)                       [z = - -, z = -, z = 2]
                                   3      2
(%i7) nullst:[];
(%o7)                                 []
(%i8) re(x):=abs(x)*cos(carg(x));
(%o8)                    re(x) := abs(x) cos(carg(x))
(%i9) im(x):=abs(x)*sin(carg(x));
(%o9)                    im(x) := abs(x) sin(carg(x))
(%i10) for i:1 thru length(l) step 1 do(    a:rhs(l[i]),    nullst:append(nullst,[[re(a),im(a)]]));
(%o10)                               done
(%i11) l:solve(denom(H(z)),z);
(%o11)                              [z = 0]
(%i12) pole:[];
(%o12)                                []
(%i13) for i:1 thru length(l) step 1 do(    a:rhs(l[i]),    pole:append(pole,[[re(a),im(a)]]));
(%o13)                               done
(%i14) concat("usprüngliche Funktion H(z)");
(%o14)                    uspr?ngliche Funktion H(z)
(%i15) plot2d([sqrt(1-x^2),-sqrt(1-x^2),[discrete,nullst],[discrete,pole]],[x,-3,3],[y,-3,3],[style,[lines,0.4],[lines,0.4],[points],[points]],[point_type, circle, circle,circle,times],[color,black,black,red,blue],[legend,false],[gnuplot_preamble, "set size ratio -1"],[adapt_depth,10]);
plotplot2d([sqrt(1-x^2),-sqrt(1-x^2),[discrete,nullst],[discrete,pole]],[x,-3,3],[y,-3,3],[style,[lines,0.4],[lines,0.4],[points],[points]],[point_type, circle, circle,circle,times],[color,black,black,red,blue],[legend,false],[gnuplot_preamble, "set size ratio -1"],[adapt_depth,10]);
Run Example
ratprint:false;
(%o1)                                false
(%i2) lastdigits(fnum, lastn):=block([ratprint:false, m:fnum, ans, n:lastn], /* it doesn't help when lastn is bigger than the total digits in fnum it returns the whole digits in fnum anyway without erroring! and fnum=%pi stuff works only upto 8 digits cause num(rat(fnum)) has somuch only! */ ratprint:false, ans:mod(m, (10^(-n))), return(float(ans)));
(%o2) lastdigits(fnum, lastn) := block([ratprint : false, m : fnum, ans, 
                                                      - n
         n : lastn], ratprint : false, ans : mod(m, 10   ), return(float(ans)))
(%i3) rat(0.1234);
                                     617
(%o3)/R/                             ----
                                     5000
(%i4) lastdigits(0.12345, 2);
(%o4)                               0.00345
(%i5) lastdigits(%pi, 3);
(%o5)                        5.9265358979310179E-4
(%i6) lastdigits(3.14159, 3);
(%o6)                        5.8999999999986841E-4
(%i7) mod(0.12345678910111213, 1/100), bfloat;
(%o7)                        3.456789101112134b-3
(%i8) ratfac:false;
(%o8)                                false
(%i9) rat(0.12345), ratfac:true, ratsimp:false, simp:false;
                                     2469
(%o9)/R/                             -----
                                     20000
(%i10) ratnumer(0.12345);
(%o10)/R/                            2469
(%i11) float(mod(num(rat(0.12345))*mod(12345, 10), 1000)/(mod(12345, 10)*denom(rat(0.12345))));
(%o11)                              0.00345
(%i12) mod(12345, 10);
(%o12)                                 5
(%i13) 
Run Example
H1(z):=((z-2/3)*(z+3/4)*(z+2/5))/(z^3);
                                     2       3       2
                                (z - -) (z + -) (z + -)
                                     3       4       5
(%o1)                  H1(z) := -----------------------
                                           3
                                          z
(%i2) l:solve(ratnumer(H1(z)),z);
                                  2      2        3
(%o2)                      [z = - -, z = -, z = - -]
                                  5      3        4
(%i3) nullst:[];
(%o3)                                 []
(%i4) re(x):=abs(x)*cos(carg(x));
(%o4)                    re(x) := abs(x) cos(carg(x))
(%i5) im(x):=abs(x)*sin(carg(x));
(%o5)                    im(x) := abs(x) sin(carg(x))
(%i6) for i:1 thru length(l) step 1 do(    a:rhs(l[i]),    nullst:append(nullst,[[re(a),im(a)]]));
(%o6)                                done
(%i7) l:solve(denom(H1(z)),z);
(%o7)                               [z = 0]
(%i8) pole:[];
(%o8)                                 []
(%i9) for i:1 thru length(l) step 1 do(    a:rhs(l[i]),    pole:append(pole,[[re(a),im(a)]]));
(%o9)                                done
(%i10) plot2d([sqrt(1-x^2),-sqrt(1-x^2),[discrete,nullst],[discrete,pole]],[x,-2,2],[y,-2,2],[style,[lines,0.4],[lines,0.4],[points],[points]],[point_type, circle, circle,circle,times],[color,black,black,red,blue],[legend,false],[gnuplot_preamble, "set size ratio -1"]);
plotplot2d([sqrt(1-x^2),-sqrt(1-x^2),[discrete,nullst],[discrete,pole]],[x,-2,2],[y,-2,2],[style,[lines,0.4],[lines,0.4],[points],[points]],[point_type, circle, circle,circle,times],[color,black,black,red,blue],[legend,false],[gnuplot_preamble, "set size ratio -1"]);

Related Help

Help for Ratnumer