Sponsored links: Algebra eBooks
 

Related

get-properties-put-qput

foo: aa;

bar: bb;

baz: cc;

Calculate

get-properties-put

put (foo, (a+b)^5, ex...

put (foo, "Hello", s...

properties (foo);

Calculate

get

get(vcalc, 'version);

T(x):=x*y^2;

Calculate

get-properties-put-qput

foo: aa;

bar: bb;

baz: cc;

Calculate

get-properties-put

put (foo, (a+b)^5, ex...

put (foo, "Hello", s...

properties (foo);

Calculate

get

get(vcalc, 'version);

T(x):=x*y^2;

Calculate

get

Run Example
(%i1)dd(fun, vec, [point]):=block([dim:length(vec)],   if(get(vect, 'version)=false) then load(vect),   declare(express, evfun),   if(dim=3) then scalefactors([x, y, z])             else if(dim=2) then scalefactors([x, y])             else if(dim=1) then scalefactors([x]),   directional_derivative:ev((grad(fun) . vec)/sqrt(vec . vec), diff, express),   if(not(emptyp(point))) then return(at(directional_derivative,                                               [x=point[1], y=point[2]]))   else return(directional_derivative));
(%o1) dd(fun, vec, [point]) := block([dim : length(vec)], 
if get(vect, 'version) = false then load(vect), declare(express, evfun), 
if dim = 3 then scalefactors([x, y, z])
 else (if dim = 2 then scalefactors([x, y])
 else (if dim = 1 then scalefactors([x]))), 
                            grad(fun) . vec
directional_derivative : ev(---------------, diff, express), 
                            sqrt(vec . vec)
if not emptyp(point) then return(at(directional_derivative, 
[x = point , y = point ])) else return(directional_derivative))
          1           2
(%i2) f(x, y):=x^2*y+x*y^2;
                                        2        2
(%o2)                       f(x, y) := x  y + x y
(%i3) v:[3, 4];
(%o3)                               [3, 4]
(%i4)  P:[-1, 2];
(%o4)                              [- 1, 2]
(%i5) dd(f(x,y), v);
                            2                        2
                        3 (y  + 2 x y) + 4 (2 x y + x )
(%o5)                   -------------------------------
                                       5
(%i6) dd(f(x,y), v, -1, 2);
                                       12
(%o6)                                - --
                                       5
(%i7) grad(f(-1,2)), diff,express;
(%o7)                               [0, 0]
(%i8) 
Run Example
dd('fun, vec, [point]):=block([points, vars, gradient], if(get(vect, 'version)=false) then load(vect),declare(express, evfun), vars:makelist(part(fun, i), i, 1, length(fun)), gradient:makelist(ev(diff(fun, temp)), temp, vars), if(not(emptyp(point))) then points:makelist(part(point, i), i, 1, length(point)),  directional_derivative:ev(gradient.vec/sqrt(vec.vec), express),  if(not(emptyp(point))) then     return(at(directional_derivative, map("=", vars, points))) else return(directional_derivative));
(%o1) dd('fun, vec, [point]) := block([points, vars, gradient], 
if get(vect, 'version) = false then load(vect), declare(express, evfun), 
vars : makelist(part(fun, i), i, 1, length(fun)), 
gradient : makelist(ev(diff(fun, temp)), temp, vars), 
if not emptyp(point) then points : makelist(part(point, i), i, 1, 
                                            gradient . vec
length(point)), directional_derivative : ev(---------------, express), 
                                            sqrt(vec . vec)
if not emptyp(point) then return(at(directional_derivative, 
map("=", vars, points))) else return(directional_derivative))
(%i2) f(x,y):=(x^2)*y+x*(y^2);
                                        2        2
(%o2)                       f(x, y) := x  y + x y
(%i3) P:[-1,2];
(%o3)                              [- 1, 2]
(%i4)  v:[3,4];
(%o4)                               [3, 4]
(%i5) dd(f(x,y),v);
                            2                        2
                        3 (y  + 2 x y) + 4 (2 x y + x )
(%o5)                   -------------------------------
                                       5
(%i6) dd(f(x,y), v, -1, 2);
                                       12
(%o6)                                - --
                                       5
(%i7) g(x,y,z):=sqrt(x^2+y^2+z^2);
                                           2    2    2
(%o7)                  g(x, y, z) := sqrt(x  + y  + z )
(%i8) P:[2,6,-3];
(%o8)                             [2, 6, - 3]
(%i9)  u:[1,1,1];
(%o9)                              [1, 1, 1]
(%i10) dd(g(x,y,z),u);
                 z                    y                    x
         ------------------ + ------------------ + ------------------
               2    2    2          2    2    2          2    2    2
         sqrt(z  + y  + x )   sqrt(z  + y  + x )   sqrt(z  + y  + x )
(%o10)   ------------------------------------------------------------
                                   sqrt(3)
(%i11) dd(g(x,y,z),u,2,6,-3);
                                       5
(%o11)                             ---------
                                   7 sqrt(3)
(%i12) h(w,x,y,z):=w*x+w*y+w*z+x*y+x*z+y*z;
(%o12)        h(w, x, y, z) := w x + w y + w z + x y + x z + y z
(%i13) P:[2,0,-1,-1];
(%o13)                         [2, 0, - 1, - 1]
(%i14)  s:[1,-1,1,-1];
(%o14)                         [1, - 1, 1, - 1]
(%i15) dd(h(w,x,y,z),s);
                                 z - y + x - w
(%o15)                           -------------
                                       2
(%i16) dd(h(w,x,y,z),s,2,0,-1,-1);
(%o16)                                - 1
(%i17) 
Run Example
load(vect);
(%o1)           /usr/share/maxima/5.21.1/share/vector/vect.mac
(%i2) dd(fun, vec, [point]):=block([dim:length(vec)],   if(get(vect, 'version)=false) then load(vect),   declare(express, evfun),   if(dim=3) then scalefactors([x, y, z])             else if(dim=2) then scalefactors([x, y])             else if(dim=1) then scalefactors([x]),   directional_derivative:ev((grad(fun) . vec)/sqrt(vec . vec)), diff, express,   if(not(emptyp(point))) then return(at(directional_derivative,                                               [x=point[1], y=point[2]]))   else return(directional_derivative));
(%o2) dd(fun, vec, [point]) := block([dim : length(vec)], 
if get(vect, 'version) = false then load(vect), declare(express, evfun), 
if dim = 3 then scalefactors([x, y, z])
 else (if dim = 2 then scalefactors([x, y])
 else (if dim = 1 then scalefactors([x]))), 
                            grad fun . vec
directional_derivative : ev(---------------), diff, express, 
                            sqrt(vec . vec)
if not emptyp(point) then return(at(directional_derivative, 
[x = point , y = point ])) else return(directional_derivative))
          1           2
(%i3) f(x, y):=x^2*y+x*y^2;
                                        2        2
(%o3)                       f(x, y) := x  y + x y
(%i4) v:[3, 4];
(%o4)                               [3, 4]
(%i5)  P:[-1, 2];
(%o5)                              [- 1, 2]
(%i6) dd(f(x,y), v);
                                            2    2
                          [3, 4] . grad (x y  + x  y)
(%o6)                     ---------------------------
                                       5
(%i7) dd(f(x,y), v, -1, 2);
                               2 (grad 1 . [3, 4])
(%o7)                        - -------------------
                                        5
(%i8) 

Related Help

Help for Get