Sponsored links: Algebra eBooks
 

Related

display-do-factor-linsolve-mod

eq1:x*4+y-2=y;

eq2:x+2=y;

linsolve([eq1,eq2],[x...

Calculate

display-invert-matrix-pfeformat-true

pfeformat: true;

m:matrix([1,2,3],[a,...

display(invert(m));

Calculate

display-matrix

display(matrix([a,b],...

Calculate

display-do-linsolve-mod

eq1:x*4+y-2=y;

eq2:x+2=y;

linsolve([eq1,eq2],[x...

Calculate

display

a: [];

display(a);

for indice:0 step 1 t...

Calculate

display-do-linsolve-mod

eq1:x*4+y-2=y;

eq2:x+2=y;

linsolve([eq1,eq2],[x...

Calculate

display-do

for n : 2 thru 6 do( ...

Calculate

display-do-float

eq1:0;

for m:1 thru 2000 do(...

display (float(eq1));

Calculate

display-do

eq1:0;

for m:1 thru 2000 do(...

display (eq1);

Calculate

display-length-makelist-numer-random-sqrt-sum-true

numer:true;

x:makelist(random(38)...

n:length(x);

Calculate

display

Run Example
(%i1)numer:true;
(%o1)                                true
(%i2) x:[166,187,169,191,175,161,176,170,195,197,187,168,171,161,173];
(%o2) [166, 187, 169, 191, 175, 161, 176, 170, 195, 197, 187, 168, 171, 161, 
                                                                           173]
(%i3) n:length(x);
(%o3)                                 15
(%i4) m:1/n*sum(x[i],i,1,n);
(%o4)                          176.4666666666667
(%i5) v:1/n*sum((x[i]-m)^2,i,1,n);
(%o5)                          133.3155555555556
(%i6) s:sqrt(v);
(%o6)                          11.54623555777187
(%i7) display(m,v,s);
                             m = 176.4666666666667

                             v = 133.3155555555556

                             s = 11.54623555777187

(%o7)                                done
(%i8) 
Run Example
numer:true;
(%o1)                                true
(%i2) ln(x):=log(x)/log(%e);
                                        log(x)
(%o2)                          ln(x) := -------
                                        log(%e)
(%i3) redondeo(num,decimales):=block(       [a:0],   a:round(num*10^decimales)*10^-decimales,    return(a));
(%o3) redondeo(num, decimales) := block([a : 0], 
                                           decimales    - decimales
                          a : 'round(num 10         ) 10           , return(a))
(%i4) biseccion(a,b,expo,N):=block(       [indice:0,bool:true,fa,fp,fb,fafp,TOL,p,er,tabla:matrix(['N,'a,'b,'p,'f('a),'f('b),'f('p),'f('a)*'f('p),'error])],      fa:f(a),   fa:redondeo(fa,expo+2),   TOL:(10)^(-expo),   for i:1 step 1 while (i<
=N and bool=true) do   (      indice:i,      p:((a+b)/2),         p:redondeo(p,expo+2),      fp:f(p),         fp:redondeo(fp,expo+2),      fb:f(b),         fb:redondeo(fb,expo+2),      er:((b-a)/2),         er:redondeo(er,expo+2),      fafp:redondeo(fa*fp,expo+2),            if ( (fa<
0 and fb<
0) or (fa>
0 and fb>
0) ) then      (	           print("No hay cambio de signo"),	 bool:false      ),      tabla:addrow(tabla,[i,a,b,p,fa,fb,fp,fafp,er]),            if ((fp=0) or (er <
 TOL)) then      (         print("tolerancia cumplida"),	 bool:false      )      elseif (fafp>
0) then      (         a:p,         fa:fp      )      else      (         b:p      )   ),      if (indice=N) then    (      print(concat("Parametro N=",N," se cumplio. Hay cambios de signo f(a) f(b)")),      print("en las iteraciones hechas.")   ),   display(indice,N),   return(tabla));
(%o4) biseccion(a, b, expo, N) := block([indice : 0, bool : true, fa, fp, fb, 
fafp, TOL, p, er, tabla : matrix(['N, 'a, 'b, 'p, 'f('a), 'f('b), 'f('p), 
'f('a) 'f('p), 'error])], fa : f(a), fa : redondeo(fa, expo + 2), 
        - expo
TOL : 10      , for i while (i <= N) and (bool = true) 
                    a + b
do (indice : i, p : -----, p : redondeo(p, expo + 2), fp : f(p), 
                      2
fp : redondeo(fp, expo + 2), fb : f(b), fb : redondeo(fb, expo + 2), 
     b - a
er : -----, er : redondeo(er, expo + 2), fafp : redondeo(fa fp, expo + 2), 
       2
if ((fa < 0) and (fb < 0)) or ((fa > 0) and (fb > 0))
 then (print("No hay cambio de signo"), bool : false), 
tabla : addrow(tabla, [i, a, b, p, fa, fb, fp, fafp, er]), 
if (fp = 0) or (er < TOL) then (print("tolerancia cumplida"), bool : false)
 elseif fafp > 0 then (a : p, fa : fp) else b : p), 
if indice = N then (print(concat("Parametro N=", N, 
" se cumplio. Hay cambios de signo f(a) f(b)")), 
print("en las iteraciones hechas.")), display(indice, N), return(tabla))
(%i5) f(x):=x-2^-x;
                                            - x
(%o5)                          f(x) := x - 2
(%i6) biseccion(0,1,3,3);
Parametro N=3 se cumplio. Hay cambios de signo f(a) f(b) 
en las iteraciones hechas. 
                                  indice = 3

                                     N = 3

      [ N   a    b      p      f(a)      f(b)     f(p)     f(a) f(p)  error ]
      [                                                                     ]
      [ 1   0    1     0.5     - 1.0     0.5    - 0.20711   0.20711    0.5  ]
(%o6) [                                                                     ]
      [ 2  0.5   1    0.75   - 0.20711   0.5     0.1554    - 0.03218  0.25  ]
      [                                                                     ]
      [ 3  0.5  0.75  0.625  - 0.20711  0.1554  - 0.02342   0.00485   0.125 ]
(%i7) 
Run Example
z:3113;
(%o1)                                3113
(%i2) z:charlist(string(z));
(%o2)                            [3, 1, 1, 3]
(%i3) n:length(z);
(%o3)                                  4
(%i4) if mod(n,2)=0 then block(l1:makelist(z[i],i,1,n/2), l2:makelist(z[i],i,n/2+1,n),display(l1,l2));
                                  l1 = [3, 1]

                                  l2 = [1, 3]

(%o4)                                done
(%i5) 
[abs,asin,display,do,numer,while] [abs,block,display,fpprec,fpprintprec,return] [addrow,block,concat,display,false,if,log,matrix,numer,print,return,round,true,while] [append,display,length,next_prime] [append,display] [array,display] [asin,display,do,while] [augcoefmatrix,backsubst,display,do,linsolve,mat_unblocker,max,ptriangularize,rowswap,true] [augcoefmatrix,display,do,eliminate,linsolve,mat_unblocker,max,ptriangularize,rowswap] [augcoefmatrix,display,do,eliminate,mat_unblocker,max,ptriangularize,rowswap,solve] [augcoefmatrix,display,do,mat_unblocker,max,ptriangularize,rowswap] [bfloat,define_variable,display,do,float,floor,fpprec,sum] [bfloat,display,ratsimp,subst] [block,display,fpprec,fpprintprec,jacobi,printf,return] [block,display,fpprec,fpprintprec,return] [charlist,display,floor,length,makelist,reverse,string] [charlist,display,floor,length,makelist,string] [col,display,do,row] [col,display,do] [cos,display,linsolve,sin] [create_list,display,do] [denom,display,factor,num,ratsimp,subst] [diff,display,do,ev,exp,fullratsimp] [diff,display,do,ev,exp] [diff,display,do] [diff,display,ev,numer,sin] [diff,display,limit,plot2d,remvalue,solve] [diff,display,log,ratsimp] [diff,display,plot2d,solve] [diff,display] [display,do,factor,linsolve,mod] [display,do,float] [display,do,floor,linsolve,plot2d] [display,do,kill,numer] [display,do,linsolve,mod] [display,do,load] [display,do,numer] [display,do,while] [display,do] [display,float,ratsimp,subst] [display,floor,length,matrix,numer,print,sqrt,sum,transpose] [display,length,listify,makelist,map,powerset,setify,sort,sqrt] [display,linsolve] [display,matrix] [display,pi] [display,random] [display,ratsimp,subst] [display,solve] [display,sqrt] [display]

Related Help

Help for Display