Sponsored links: Algebra eBooks
 

Related

concat-denom-floor-mod-num-rat-string

x:1.875 /* Eingabe ei...

x:rat(x);

z:num(x);

Calculate

concat-do-if-kill-numer-true

kill(all);

numer:true;

jahr:365;

Calculate

concat-diff-sum

k:2;

n:0;

f:2*k*%pi*s^2*(1+2*(1...

Calculate

concat

create_number_from_li...

create_number_from_li...

Calculate

concat-makelist-sum

k:2;

n:1;

acl:makelist(concat('...

Calculate

concat-length-random

liste:["+","-","/","*...

a(x):="x"+liste[rando...

a(2);

Calculate

concat-example-first-second

/* cislo jako [[p1,k1...

/* example: */ get_nu...

/* vypis cislo ze se...

Calculate

concat-pi-sin-subst

eq1:"sin(x*pi)";

eq2:"world! ";

aa:concat(eq1,eq2,"si...

Calculate

concat

write_number_from_lis...

write_number_from_lis...

Calculate

concat-do-if-kill-numer-true

kill(all);

numer:true;

jahr:365;

Calculate

concat

Run Example
(%i1)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
get_number_from_list(P):=(s:0,for i in P do s:s+first(i)^second(i),s);
(%o1) get_number_from_list(P) := (s : 0, 
                                                                  second(i)
                                    for i in P do s : s + first(i)         , s)
(%i2) write_number_from_list(P):=(s:"1",for i in P do s:concat(s,"*",first(i),"^",second(i)),s);
(%o2) write_number_from_list(P) := (s : "1", 
                 for i in P do s : concat(s, "*", first(i), "^", second(i)), s)
(%i3) create_number_from_list(P,name):=(s:"",for i in P do s:concat(s,"append(",name,",[[",first(i),",",second(i),"]]),"),s);
(%o3) create_number_from_list(P, name) := 
(s : "", for i in P do s : concat(s, "append(", name, ",[[", first(i), ",", 
second(i), "]]),"), s)
(%i4) create_number_from_list([[2,3],[3,2]],"a");
(%o4)                append(a,[[2,3]]),append(a,[[3,2]]),
(%i5) a:[];
(%o5)                                 []
(%i6) a:append(a,[[2,3]]);
(%o6)                              [[2, 3]]
(%i7)  a:append(a,[[3,2]]);
(%o7)                          [[2, 3], [3, 2]]
(%i8) a;
(%o8)                          [[2, 3], [3, 2]]
(%i9) 
Run Example
base(n,d):=block([q:0, r:n, obase:d], while((n>
=d)) do (q:q+1, r:r-d, concat(q,r)));
(%o1) base(n, d) := block([q : 0, r : n, obase : d], 
                         while n >= d do (q : q + 1, r : r - d, concat(q, r)))
(%i2) 
[addrow,block,concat,display,false,if,log,matrix,numer,print,return,round,true,while] [addrow,block,concat,display,if,log,matrix,numer,print,return,round,true,while] [addrow,block,concat,false,if,log,matrix,numer,print,return,round,true,while] [algsys,coeff,concat,diff,expand,makelist,subst,sum] [append,apply,block,color,concat,cos,flatten,float,length,makelist,map,numer,obase,sin] [append,ascii,block,concat,copylist,delete,divsum,first,if,make_random_state,next_prime,second,set_random_state,slength,substring,true] [append,ascii,block,concat,delete,divsum,first,if,make_random_state,next_prime,second,set_random_state,slength,substring,true] [append,ascii,block,concat,delete,divsum,first,if,random,second,slength,substring] [append,ascii,block,concat,divsum,first,if,return,second,slength,substring] [append,ascii,block,concat,divsum,first,if,second,slength,substring] [append,ascii,concat,first,second,slength,substring] [append,ascii,concat,first,second] [append,concat,first,second] [append,concat] [ascii,block,concat,eval_string,fpprintprec,is,printf,return,split,sremove,string] [ascii,concat,eval_string,printf,split,string] [block,ceiling,charlist,concat,length,print,tokens] [block,charlist,concat,length,print,tokens] [block,concat,cos,depends,diff,display2d,expand,false,kill,lambda,map,solve,subst] [block,concat,cos,depends,diff,display2d,expand,false,kill,lambda,map,subst] [block,concat,delete,if,make_random_state,set_random_state,true] [block,concat,dependencies,depends,diff,display2d,expand,false,kill,lambda,map,subst] [block,concat,depends,diff,display2d,expand,false,kill,lambda,map,subst] [block,concat,do,kill,makelist,obase,return,stringdisp,true,while] [block,concat,do,kill,makelist,obase,return,while] [block,concat,do,makelist,obase,return,while] [block,concat,if] [charlist,concat,ev,load,numer,pi] [charlist,concat,fib,length,load] [charlist,concat,length,load,primep,sum] [charlist,concat,load,primep,sum] [coeff,concat,diff,expand,makelist,subst,sum] [coeff,concat,diff,subst,sum] [concat,cos,draw,explicit,plot2d,sin] [concat,denom,false,floor,length,makelist,map,mod,num,ratprint,transpose] [concat,denom,floor,mod,num,rat,string] [concat,diff,sum] [concat,disp,expand,hipow,listofvars,makelist,part,ratcoef,slength,string,subst,sum,taylor] [concat,do,if,kill,numer,true] [concat,erf,log,numer,sqrt,true] [concat,example,first,second] [concat,first,second] [concat,floor,makelist,numer,string] [concat,length,random] [concat,makelist] [concat,max,min,print,random,round] [concat,pi,sin,subst] [concat,sconcat,solve] [concat,sum] [concat]

Related Help

Help for Concat