Sponsored links: Algebra eBooks
 

Related

last-matrix-plot2d-ratsimp-solve-sqrt
plot2d([[discrete, [o, list_matrix_entries(p), list_matrix_entries(q), list_matrix_entries(ratsimp(f(f(f(o))))), list_matrix_entries(ratsimp(f(f(f(f(o)))))),list_matrix_entries(ratsimp(f(f(f(f(f(o)))))))] ],[discrete, [o, list_matrix_entries(p), list_matrix_entries(q), list_matrix_entries(r), list_matrix_entries(s), list_matrix_entries(n)] ],g(x)], [x, -10, 15], [y, -10, 15], [style, lines, points, lines]);

f(x):= (1/2)*matrix([...

o: [0,0];

p: ratsimp(f(o));

Calculate

last-map-plot2d-rhs-solve-sort
plot2d([rhs(Parabel)],[x,0,og]);

A:[0,1000];

B:[50,3000];

C:[80,6000];

Calculate

last-rk

g:10;

ro: rk([v,-g],[x,v],[...

last(ro);

Calculate

last

last([1]);

Calculate

last-matrix-plot2d-ratsimp-solve-sqrt
plot2d([[discrete, [o, list_matrix_entries(p), list_matrix_entries(q), list_matrix_entries(ratsimp(f(f(f(o))))), list_matrix_entries(ratsimp(f(f(f(f(o)))))),list_matrix_entries(ratsimp(f(f(f(f(f(o)))))))] ],[discrete, [o, list_matrix_entries(p), list_matrix_entries(q), list_matrix_entries(r), list_matrix_entries(s), list_matrix_entries(n)] ],g(x)], [x, -10, 15], [y, -10, 15], [style, lines, points, lines]);

f(x):= (1/2)*matrix([...

o: [0,0];

p: ratsimp(f(o));

Calculate

last-numer-rk

g:10;

r0:rk([v,-g],[x,v],[0...

last(r0);

Calculate

last-length

koe:[1,2,5,8];

loppukaksi(lista):=[l...

loppukaksi(koe);

Calculate

last-map-plot2d-rhs-solve-sort
plot2d([rhs(Parabel)],[x,0,og]);

A:[0,1000];

B:[50,3000];

C:[80,6000];

Calculate

last-numer-rk

g:10;

r0:rk([v,-g],[x,v],[0...

last(r0);

Calculate

last

Run Example
(%i1)seq(start,stop,stepping,[shift]) := block([                                            n, y:[],                                             shift: (if (not(emptyp(shift)))                                                         then float(first(shift))                                                            else (0.0))                                            ],            (n:floor((float(stop-start)/float(stepping)))),            (if (start <
 stop)            then            (y:flatten(append([y],                                         makelist(float(start+shift+(stepping*(i-start))),                                         i, start, n+start))))            else            (y:flatten(append([y],                                         makelist(-(float(stop-shift-(stepping*(i-stop)))),                                         i, -(n+stop), stop)))))            (if (n>
1.0)                then return(y)                else return([])));
(%o1) seq(start, stop, stepping, [shift]) := 
block([n, y : [], shift : if not emptyp(shift) then float(first(shift))
                      float(stop - start)
 else 0.0], n : floor(-------------------), 
                        float(stepping)
if start < stop then y : flatten(append([y], 
makelist(float(start + shift + stepping (i - start)), i, start, n + start)))
 else y : flatten(append([y], makelist(- float(stop - shift
 - stepping (i - stop)), i, - (n + stop), stop)))(if n > 1.0 then return(y)
 else return([])))
(%i2) kill(pairs);
(%o2)                                done
(%i3) pairs(items):=block([result],result:if (emptyp(items)) then [] elseif (listp(items)) then     if(emptyp(rest(items))) then cons(last(items), []) else    cons(cons(first(items),  [second(items)]),                     [pairs(rest(rest(items)))]));
(%o3) pairs(items) := block([result], result : 
if emptyp(items) then [] elseif listp(items)
 then (if emptyp(rest(items)) then cons(last(items), [])
 else cons(cons(first(items), [second(items)]), [pairs(rest(rest(items)))])))
(%i4) pairs([1, 2, 3, 4, 5]);
(%o4)                       [[1, 2], [[3, 4], [5]]]
(%i5) kill(pairs);
(%o5)                                done
(%i6) pairs(items):=block([result],result:if (emptyp(items)) then [] elseif (listp(items)) then     if(emptyp(rest(items))) then [last(items), []] else    cons(cons(first(items),  [second(items)]),                     [pairs(rest(rest(items)))]));
(%o6) pairs(items) := block([result], result : 
if emptyp(items) then [] elseif listp(items)
 then (if emptyp(rest(items)) then [last(items), []]
 else cons(cons(first(items), [second(items)]), [pairs(rest(rest(items)))])))
(%i7) pairs([1, 2, 3, 4, 5]);
(%o7)                     [[1, 2], [[3, 4], [5, []]]]
(%i8) first(pairs(seq(1, 10, 1)));
(%o8)                             [1.0, 2.0]
(%i9) test([list]):=map(lambda([x], [first(x), second(x)]),list);
(%o9)    test([list]) := map(lambda([x], [first(x), second(x)]), list)
(%i10) find_root(sin(x), x, 0, %pi);
(%o10)                                0.0
(%i11) 
Run Example
seq(start,stop,stepping,[shift]) := block([                                            n, y:[],                                             shift: (if (not(emptyp(shift)))                                                         then float(first(shift))                                                            else (0.0))                                            ],            (n:floor((float(stop-start)/float(stepping)))),            (if (start <
 stop)            then            (y:flatten(append([y],                                         makelist(float(start+shift+(stepping*(i-start))),                                         i, start, n+start))))            else            (y:flatten(append([y],                                         makelist(-(float(stop-shift-(stepping*(i-stop)))),                                         i, -(n+stop), stop)))))            (if (n>
1.0)                then return(y)                else return([])));
(%o1) seq(start, stop, stepping, [shift]) := 
block([n, y : [], shift : if not emptyp(shift) then float(first(shift))
                      float(stop - start)
 else 0.0], n : floor(-------------------), 
                        float(stepping)
if start < stop then y : flatten(append([y], 
makelist(float(start + shift + stepping (i - start)), i, start, n + start)))
 else y : flatten(append([y], makelist(- float(stop - shift
 - stepping (i - stop)), i, - (n + stop), stop)))(if n > 1.0 then return(y)
 else return([])))
(%i2) kill(pairs);
(%o2)                                done
(%i3) pairs(items):=block([result],  result: if (emptyp(items)) then [] else           if(listp(items)) then          if(emptyp(rest(items))) then [last(items)] else          cons(cons(first(items),  [second(items)]),          pairs(rest(rest(items)))));
(%o3) pairs(items) := block([result], result : 
if emptyp(items) then [] else (if listp(items)
 then (if emptyp(rest(items)) then [last(items)]
 else cons(cons(first(items), [second(items)]), pairs(rest(rest(items)))))))
(%i4) pairs(seq(1, 10, 1));
(%o4)    [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0], [9.0, 10.0]]
(%i5) test(list):=block([val:''list, result, m, n],m:first(first(val)), n:second(first(val)),find_root(sin(x), x, m, n));
(%o5) test(list) := block([val : list, result, m, n], m : first(first(val)), 
                            n : second(first(val)), find_root(sin(x), x, m, n))
(%i6) test(pairs(seq(0, 10, 1)));
(%o6)                                 0.0
(%i7) a:pairs(seq(0, 10, 1));
(%o7) [[0.0, 1.0], [2.0, 3.0], [4.0, 5.0], [6.0, 7.0], [8.0, 9.0], 10.0]
(%i8) for i in a do print(i);
[0.0, 1.0] 
[2.0, 3.0] 
[4.0, 5.0] 
[6.0, 7.0] 
[8.0, 9.0] 
10.0 
(%o8)                                done
(%i9) test2(list):=block([val:''list, result:[], m, n, l], for i in val do (m:first(i),n:second(i),result:errcatch(find_root(sin(x), x, m, n))));
(%o9) test2(list) := block([val : list, result : [], m, n, l], 
for i in val do (m : first(i), n : second(i), 
result : errcatch(find_root(sin(x), x, m, n))))
(%i10) test2(pairs(seq(0, 9, 1)));

find_root: function has same sign at endpoints: f(2.0) = 0.90929742682568, 
                                                      f(3.0) = 0.14112000805987
find_root: function has same sign at endpoints: f(4.0) = - 0.75680249530793, 
                                                    f(5.0) = - 0.95892427466314
find_root: function has same sign at endpoints: f(8.0) = 0.98935824662338, 
                                                      f(9.0) = 0.41211848524176
(%o10)                               done
(%i11) errcatch(find_root(sin(x), x, 2, 3));

find_root: function has same sign at endpoints: f(2.0) = 0.90929742682568, 
                                                      f(3.0) = 0.14112000805987
(%o11)                                []
(%i12) 
Run Example
t:[3/12,9/12,15/12];
                                    1  3  5
(%o1)                              [-, -, -]
                                    4  4  4
(%i2)  r:[0.10,0.105,0.11];
(%o2)                         [0.1, 0.105, 0.11]
(%i3)  Q:100000000;
(%o3)                              100000000
(%i4) Bfixed:sum(0.08/2*Q*exp(-r[i]*t[i]),i,1,length(r))+Q*exp(-last(r)*last(t));
(%o4)                        9.8237895901037157E+7
(%i5) Bfloating:0.102/2*Q*exp(-r[1]*t[1])+Q*exp(-r[1]*t[1]);
(%o5)                        1.0250507175417776E+8
(%i6) V:Bfixed-Bfloating;
(%o6)                         - 4267175.853140608
(%i7) 
[addrow,last,length,matrix] [append,block,buildq,declare,delete,do,false,first,floor,if,last,length,map,not,return,show,simp,true,while] [append,block,buildq,do,first,last,length,map,return,show,simp,true] [append,block,buildq,emptyp,ev,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,buildq,emptyp,find_root,first,flatten,floor,kill,lambda,last,listp,makelist,not,rest,second,sin] [append,block,buildq,emptyp,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,charlist,delete,last,length,makelist,map,next_prime,string] [append,block,cons,delete,do,emptyp,first,float,lambda,last,listp,load,makelist,numberp,ratprint,rest,return,reverse] [append,block,cons,delete,do,emptyp,first,float,lambda,last,listp,load,map,ratprint,rest,return,reverse] [append,block,cons,delete,do,emptyp,first,float,last,listp,ratprint,rest,return] [append,block,cons,delete,do,emptyp,first,float,last,listp,ratprint,rest] [append,block,cons,emptyp,find_root,first,flatten,floor,if,kill,last,listp,makelist,not,rest,second,sin] [append,block,cons,emptyp,first,flatten,floor,if,kill,last,listp,makelist,not,rest,second] [append,block,do,emptyp,errcatch,find_root,first,flatten,floor,if,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,errcatch,find_root,first,flatten,floor,if,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,errcatch,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,lambda,last,listp,makelist,map,not,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,last,length,listp,makelist,not,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,last,listp,makelist,not,print,rest,second,sin] [append,block,emptyp,find_root,first,flatten,floor,kill,last,listp,makelist,not,rest,second,sin] [append,block,emptyp,first,flatten,floor,kill,lambda,last,listp,makelist,map,not,rest,second] [append,block,emptyp,first,flatten,floor,kill,last,listp,makelist,not,rest,second] [append,charlist,delete,last,length,map,next_prime,string] [append,last,next_prime] [apply,cons,lambda,last,let,sum] [apply,cons,lambda,last,let] [bftorat,block,cons,delete,do,emptyp,first,float2bf,fpprec,lambda,last,listp,map,maplist,mod,ratepsilon,ratprint,rest,return,second] [bftorat,block,cons,delete,do,emptyp,first,float2bf,fpprec,lambda,last,listp,map,maplist,mod,ratepsilon,ratprint,rest,return] [bftorat,block,cons,delete,do,emptyp,first,float2bf,fpprec,lambda,last,listp,map,mod,ratepsilon,ratprint,rest,return] [block,compile,emptyp,first,if,kill,last,let,listp,rest,second] [block,cons,delete,do,emptyp,first,float,if,last,length,listp,not,ratprint,rem,rest] [block,cons,delete,do,emptyp,first,float,if,last,length,listp,ratprint,rem,rest] [block,delete,emptyp,if,last,length,makelist,map,not,subst] [block,delete,if,last,length,makelist,map,subst,true] [block,delete,if,last,length,makelist,map,subst] [block,emptyp,errcatch,find_root,first,if,last,listp,makelist,rest,second,sin] [block,emptyp,first,if,kill,last,listp,rest,second] [block,emptyp,first,if,last,listp,makelist,rest,second] [divide,factor,last,num] [ev,first,kill,last,length,numer,plot2d,rhs,second,solve,sqrt,sum] [exp,last,length,sum] [first,kill,last,length,plot2d,rhs,second,solve,sum] [float,last,matrix,plot2d,ratsimp,solve,sqrt] [float,last,matrix,plot2d,ratsimp,solve] [float,last,matrix,ratsimp,solve,sqrt] [float,last,matrix,ratsimp,solve] [last,length] [last,matrix,plot2d,ratsimp,solve,sqrt] [last,numer,rk] [last]

Related Help

Help for Last