Sponsored links: Algebra eBooks
 

Related

addrow-col-invert-matrix-transpose

A: matrix([ 334.10086...

Xs: matrix([ -93.2717...

Ys: matrix([ 44.96910...

Calculate

addrow-ev-invert-log-matrix-numer-transpose

rowx:[1,log(x),(log(x...

x:1101.0;

mc:matrix(ev(rowx));

Calculate

addrow-block-cos-define-float-if-matrix-print-subst

biseccion(funcion, x0...

biseccion((cos(x) + (...

Calculate

addrow-matrix

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

addrow(m,[-1,0,0,1]);

Calculate

addrow-genmatrix-linsolve_params-random-true

linsolve_params:true;

h[i,j]:=random(5)+1;

A:genmatrix(h,2,3);

Calculate

addrow-block-concat-false-if-log-matrix-numer-print-return-round-true-while

numer:true;

ln(x):=log(x)/log(%e);

redondeo(num,decimale...

Calculate

addrow-matrix-print

m:matrix();

print(m);

addrow(m,[0,0,0,0,0]);

Calculate

addrow-block-cos-define-float-if-matrix-print-subst

biseccion(funcion,me,...

biseccion((cos(x) + %...

Calculate

addrow-col-error-load-matrix-rhs

load(lsquares);

D: matrix( [3.2, 12,...

E:matrix( [0.4, -16,...

Calculate

addrow

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
f(x):=log(x);
(%o1)                           f(x) := log(x)
(%i2) a:1;
(%o2)                                  1
(%i3) b:2;
(%o3)                                  2
(%i4) n:4;
(%o4)                                  4
(%i5) h:(b-a)/n;
                                       1
(%o5)                                  -
                                       4
(%i6) Inte:0;
(%o6)                                  0
(%i7) m:matrix(["a","f(a)","h","aproximacion a f'(a)","f'(a)","error","Simpson"]);
(%o7)     [ a  f(a)  h  aproximacion a f'(a)  f'(a)  error  Simpson ]
(%i8) for i:1 thru 4 step 1 do(p:a+h,c:ev(f(a)),d:ev(f(p)),x:(h/2)*(c+d),a:p,Inte:Inte+x,sim:(a/h)*(f(a)+4*f(a+h)+f(a+2*h)),m:addrow(m,[a,f(a),h,ader,df,er, simpson]));
(%o8)                                done
(%i9) Inte,numer;
(%o9)                          0.38369950940944
(%i10) 
Run Example
load(lsquares);
(%o1)         /usr/share/maxima/5.21.1/share/contrib/lsquares.mac
(%i2) D: matrix(  [3.2, 12, 60],  [3.2, 4, 89],  [3.2, -4, 115],  [3.2, -8, 126],  [3.2, 0, 102],  [3.2, 8, 75],  [3.2, 12, 60],  [2, -16, 99],  [2, -12, 93],  [2, -8, 86],  [2, -4, 78.5],  [2, 0, 71],  [2, 4, 63],  [2, 8, 55],  [2, 12, 46],  [1, -16, 59],  [1, -12, 56],  [1, -8, 54],  [1, -4, 50],  [1, 0, 46],  [1, 4, 42],  [1, 8, 39],  [1, 12, 34]);
                              [ 3.2   12    60  ]
                              [                 ]
                              [ 3.2   4     89  ]
                              [                 ]
                              [ 3.2  - 4   115  ]
                              [                 ]
                              [ 3.2  - 8   126  ]
                              [                 ]
                              [ 3.2   0    102  ]
                              [                 ]
                              [ 3.2   8     75  ]
                              [                 ]
                              [ 3.2   12    60  ]
                              [                 ]
                              [  2   - 16   99  ]
                              [                 ]
                              [  2   - 12   93  ]
                              [                 ]
                              [  2   - 8    86  ]
                              [                 ]
                              [  2   - 4   78.5 ]
                              [                 ]
(%o2)                         [  2    0     71  ]
                              [                 ]
                              [  2    4     63  ]
                              [                 ]
                              [  2    8     55  ]
                              [                 ]
                              [  2    12    46  ]
                              [                 ]
                              [  1   - 16   59  ]
                              [                 ]
                              [  1   - 12   56  ]
                              [                 ]
                              [  1   - 8    54  ]
                              [                 ]
                              [  1   - 4    50  ]
                              [                 ]
                              [  1    0     46  ]
                              [                 ]
                              [  1    4     42  ]
                              [                 ]
                              [  1    8     39  ]
                              [                 ]
                              [  1    12    34  ]
(%i3) E:matrix(  [0.4, -16, 42],  [0.4, -12, 41],  [0.4, -8, 39],  [0.4, -4, 37],  [0.4, 0, 35],  [0.4, 4, 33],  [0.4, 8, 31],  [0.4, 12, 29]);
                               [ 0.4  - 16  42 ]
                               [               ]
                               [ 0.4  - 12  41 ]
                               [               ]
                               [ 0.4  - 8   39 ]
                               [               ]
                               [ 0.4  - 4   37 ]
(%o3)                          [               ]
                               [ 0.4   0    35 ]
                               [               ]
                               [ 0.4   4    33 ]
                               [               ]
                               [ 0.4   8    31 ]
                               [               ]
                               [ 0.4   12   29 ]
(%i4) D : addrow(D, E);
                              [ 3.2   12    60  ]
                              [                 ]
                              [ 3.2   4     89  ]
                              [                 ]
                              [ 3.2  - 4   115  ]
                              [                 ]
                              [ 3.2  - 8   126  ]
                              [                 ]
                              [ 3.2   0    102  ]
                              [                 ]
                              [ 3.2   8     75  ]
                              [                 ]
                              [ 3.2   12    60  ]
                              [                 ]
                              [  2   - 16   99  ]
                              [                 ]
                              [  2   - 12   93  ]
                              [                 ]
                              [  2   - 8    86  ]
                              [                 ]
                              [  2   - 4   78.5 ]
                              [                 ]
                              [  2    0     71  ]
                              [                 ]
                              [  2    4     63  ]
                              [                 ]
                              [  2    8     55  ]
                              [                 ]
                              [  2    12    46  ]
                              [                 ]
(%o4)                         [  1   - 16   59  ]
                              [                 ]
                              [  1   - 12   56  ]
                              [                 ]
                              [  1   - 8    54  ]
                              [                 ]
                              [  1   - 4    50  ]
                              [                 ]
                              [  1    0     46  ]
                              [                 ]
                              [  1    4     42  ]
                              [                 ]
                              [  1    8     39  ]
                              [                 ]
                              [  1    12    34  ]
                              [                 ]
                              [ 0.4  - 16   42  ]
                              [                 ]
                              [ 0.4  - 12   41  ]
                              [                 ]
                              [ 0.4  - 8    39  ]
                              [                 ]
                              [ 0.4  - 4    37  ]
                              [                 ]
                              [ 0.4   0     35  ]
                              [                 ]
                              [ 0.4   4     33  ]
                              [                 ]
                              [ 0.4   8     31  ]
                              [                 ]
                              [ 0.4   12    29  ]
(%i5) ti:22;
(%o5)                                 22
(%i6) tamin:-30;
(%o6)                                - 30
(%i7) r:lsquares_estimates(D, [m, ta, tvl], tvl = ti+(m*b^c)*(((ti-ta)/(ti-tamin))^(a)), [a, b,c]);
*************************************************
  N=    3   NUMBER OF CORRECTIONS=25
       INITIAL VALUES
 F=  2.101931255964879D+03   GNORM=  9.218838988104815D+01
*************************************************

   I  NFN     FUNC                    GNORM                   STEPLENGTH

   1    7     1.116228467499764D+03   5.181482092741437D+02   3.792158188175497D-02  
   2   11     1.115139217279903D+03   4.517933553619771D+02   6.156039739677396D-03  
   3   15     3.772201212301974D+02   1.464357581324870D+03   1.279783986132719D+01  
   4   17     7.783971751722766D+01   1.150713443659835D+03   2.039382076736760D-01  
   5   19     5.003402304305900D+00   5.919845697246858D+01   1.995821879972414D-01  
   6   20     4.211639387760370D+00   5.820407389162347D+01   1.000000000000000D+00  
   7   21     4.088456788513105D+00   5.277714141954149D+00   1.000000000000000D+00  
   8   22     4.087286836630353D+00   2.094011852767751D-02   1.000000000000000D+00  
   9   23     4.087286523816272D+00   3.178623521461571D-05   1.000000000000000D+00  

 THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS.
 IFLAG = 0
(%o7) [[a = 0.87205051345354, b = 3.011617383235275, c = 3.585922792420821]]
(%i8) a: rhs(r[1][1]);
(%o8)                          0.87205051345354
(%i9) b: rhs(r[1][2]);
(%o9)                          3.011617383235275
(%i10) c: rhs(r[1][3]);
(%o10)                         3.585922792420821
(%i11) error(D) := (ti+(col(D, 1)*b)*((ti-col(D, 2))/(ti-tamin))^^(1/a+c*col(D, 1))) - col(D,3);
                                       ti - col(D, 2) <1/a + c col(D, 1)>
(%o11) error(D) := ti + (col(D, 1) b) (--------------)
                                         ti - tamin
                                                                    - col(D, 3)
(%i12) e(m, ta, tvl) := ti+(m*b^c)*((ti-ta)/(ti-tamin))^(a) - tvl;
                                         c    ti - ta   a
(%o12)         e(m, ta, tvl) := ti + (m b ) (----------)  - tvl
                                             ti - tamin
(%i13) for i:1 while i <
= length(first(transpose(D))) do disp (  e(D[i][1], D[i][2], D[i][3]));
                               1.600256016752056

                              - 0.88370438260647

                              - 1.887971702076186

                              - 0.77810475937126

                              - 1.239608130221058

                               0.10421852552332

                               1.600256016752056

                               2.282729637294366

                               0.95392240560348

                               0.51368452539296

                               0.44501768620238

                               0.22524491861184

                               0.32268476087096

                               0.19013657845207

                               0.75016001047003

                               2.641364818647183

                               1.976961202801739

                               0.25684226269648

                               0.47250884310119

                               0.61262245930592

                               0.66134238043548

                              - 0.40493171077397

                               0.37508000523501

                              - 4.143454072541125

                              - 4.609215518879303

                              - 4.097263094921409

                              - 3.610996462759523

                              - 3.154951016277632

                              - 2.73546304782581

                              - 2.361972684309585

                              - 2.049967997905995

(%o13)                               done
(%i14) 
[abs,addcol,addrow,floor,fullmap,matrix,mod,transpose] [abs,addrow,args,block,copymatrix,disp,do,lambda,length,map,matrix,or,rowswap,while] [abs,addrow,block,define,diff,float,matrix,print,subst] [abs,addrow,block,define,diff,matrix,print,subst] [abs,addrow,block,define,float,matrix,print,subst] [abs,addrow,cos,diff,do,ev,matrix,numer] [abs,addrow,cos,diff,do,ev,matrix] [abs,addrow,cos,diff,ev,matrix,numer] [abs,addrow,cos,do,matrix,numer,true,while] [abs,addrow,diff,do,ev,matrix,numer,sin,sqrt] [abs,addrow,diff,do,ev,matrix,numer,sin,tan] [abs,addrow,diff,do,ev,matrix,numer] [abs,addrow,do,ev,log,matrix,numer] [addcol,addrow,cos,invert,matrix,sin,transpose] [addcol,addrow,cos,matrix,sin] [addcol,addrow,diff,do,ev,genmatrix,invert,kill,load,matrix,plot2d,romberg,sqrt,submatrix] [addcol,addrow,diff,ev,genmatrix,invert,kill,length,lmax,lmin,load,matrix,plot2d,romberg,sqrt,submatrix] [addcol,addrow,diff,ev,genmatrix,invert,kill,length,load,matrix,plot2d,romberg,sqrt,submatrix] [addcol,addrow,hessian] [addcol,addrow,invert,matrix,transpose] [addrow,append,block,copylist,copymatrix,delete,error,expand,hipow,length,makelist,print,resultant,return,row,submatrix] [addrow,append,block,copylist,copymatrix,delete,error,hipow,length,makelist,print,resultant,return,row,submatrix] [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] [addrow,block,cos,define,diff,float,matrix,print,subst] [addrow,block,cos,define,float,if,matrix,print,subst] [addrow,block,cos,define,float,matrix,print,subst] [addrow,block,define,float,if,matrix,print,subst] [addrow,block,display,if,log,matrix,numer,print,return,round,true,while] [addrow,block,if,log,matrix,numer,print,return,round,true,while] [addrow,block,load,matrix,plot2d] [addrow,block,load,matrix] [addrow,col,error,first,length,load,matrix,rhs,transpose] [addrow,col,error,load,matrix,rhs] [addrow,col,invert,matrix,transpose] [addrow,cos,matrix,sin] [addrow,do,ev,log,matrix,numer] [addrow,do,genmatrix,kill,linsolve,print,random] [addrow,ev,log,matrix] [addrow,ev,matrix] [addrow,genmatrix,linsolve_params,print,random,tex1,true] [addrow,genmatrix,linsolve_params,print,random,true] [addrow,genmatrix,linsolve_params,random,true] [addrow,invert,matrix,transpose] [addrow,matrix,print] [addrow,matrix,random] [addrow,matrix,transpose] [addrow,matrix] [addrow]

Related Help

Help for Addrow