顯示具有 maxima 標籤的文章。 顯示所有文章
顯示具有 maxima 標籤的文章。 顯示所有文章

2021年3月25日 星期四

maxima command

algebra

ratsimp() 化簡
expand() 展開
factor()    因式分解
kill(x)      kill the x variable
kill(all)     kill all variables
 
x:123        assign x=123
f(x):=x^2+2*x+1    define function of x =x^2+2x+1

sum(i,i,1,10)   sum i , i from 1 to 10

%i            image number
%pi         
%e
%phi        the  golden mean (1+sqrt(5))/2
%gamma    the Euler-Mascheroni constant
inf              real positive  inifinity
minf          real negative inifinity

abs()        absolute
sqrt()       square root
float()      float number
compare()  compare numbers
is()
load("filename")
solve([equation],[variable])
round()
floor()
print()

%i1) powerdisp;
(%o1)                                false
(%i2) x^2+2*x+1;
                                           2
(%o2)                            x  + 2 x + 1
(%i3) powerdisp: true;
(%o3)                                true
(%i4) x^2+2*x+1;
                                                             2
(%o4)                            1 + 2 x + x

radexpand
 
evaluate
 
Option variable: radexpand

Default value: true

radexpand controls some simplifications of radicals.

When radexpand is all, causes nth roots of factors of a product which are powers of n to be pulled outside of the radical. E.g. if radexpand is all, sqrt (16*x^2) simplifies to 4*x.

More particularly, consider sqrt (x^2).

  • If radexpand is all or assume (x > 0) has been executed, sqrt(x^2) simplifies to x.
  • If radexpand is true and domain is real (its default), sqrt(x^2) simplifies to abs(x).
  • If radexpand is false, or radexpand is true and domain is complex, sqrt(x^2) is not simplified.

Note that domain only matters when radexpand is true 

reference

https://maxima.sourceforge.io/docs/manual/maxima_46.html. 

 

evaluate

 

8.1 Functions and Variables for Evaluation


4.2 Functions and Variables for Command Line

 

3. Entering commands

ctl-j
ctl-u
alt-p  to search backwards
alt-n  to search forward


 
cabs                           absolute of complex number
conjugate
carg                           angle of complex number
realpart
imagpart
polarform
rectform
 
For further ways to compute with complex numbers, see the functions rectform, realpart, imagpart, carg, conjugate and polarform.
 
Matrix
 
matrix()
determinant()
invert()
transpose() 
length()

Plot
plot2d([equation],[x,lower, upper])
plot3d([equation],[x,lower,upper],[y,lower,upper])

vector

 https://maxima.sourceforge.io/docs/manual/maxima_116.html#Vectors

a.b        a dot b

axb        a cross b

         load("vect" );

         express(a~b);

 

https://maxima.sourceforge.io/docs/manual/maxima_131.html#Sums-Products-and-Series


permutation/ combination

 

load(functs)

permutation (nr)

combination (nr)


sequence/ series

arithmetic (adn)

geometric (arn)

harmonic (abcn)

geosum (arn)


Set

https://maxima.surceforge.io/docs/manualo/maxima_156.html#Sets

 

Differential/Integrate

 

diff()

integrate()

limit()

 



2021年1月5日 星期二

maxima polynomial command

 https://maxima.sourceforge.io/docs/manual/maxima_76.html#Functions-and-Variables-for-Polynomials

https://flex.phys.tohoku.ac.jp/texi/maxima/maxima_12.html

https://sysplay.in/blog/mathematics/2014/05/polynomials-in-maxima/

 

 

 

 

maxima vector command

 

Maxima vector magnitude and cross product

https://math.stackexchange.com/questions/1029762/maxima-vector-magnitude-and-cross-product/1180712


http://www.scotchildress.com/wxmaxima/VectorArithmetic/VectorArithmetic.html

 

vector command in maxima

  • a.b      a.b;
  • axb

         load("vect" );

         express(a~b);

  • |a|

           sqrt(a.a); 

          or

          norm(x):=sqrt(x.x);

  • a hat

           a/sqrt(a.a) ;

           or

           hat(x):=x/norm(x); 

  •  a proj b 

            proj(a,b):=a.b/norm(b)^2 *b ;

example:

kill(all);
load("vect" );
express(a~b);
norm(x):=sqrt(x.x);
hat(x):=x/norm(x);
proj(a,b):=a.b/norm(b)^2 *b ;

a:[1,2];
b:[3,4];
a.b;
express(a~b);
norm(a);
hat(a);
proj(a,b);

 


 

 

 


2020年4月21日 星期二

微分應用


c IV 13 (3-4 微分應用) 109.4.21

3.2

f(x):=-x^2+6*x-8; has max or min?

g:diff(f(x));

solve(g);


4. f(x):=3*x-x^3; has max , min=?

g:diff(f(x));

solve(g);

f(1);

f(-1);


calculate

1. f(x)=3+4*x-x^2, 圖形, 遞增 遞減的區域

f(x):=3+4*x-x^2;

g:diff(f(x));

solve(g);


2. x+y=30, solve (xy)max=?

x,x-30

f(x):=x(x-30);

g:diff(f(x));

solve(g);


3.f(x)=2x^3+ax^2+bx+25 ,x=-3,x=2 has 

related extreme value, solve a,b=?

f(x):=2*x^3+a*x^2+b*x+25;

g:diff(f(x),x);



4. f(x)=5x^2+4x+1,x=a has fmin=b, solve 

a,b=?



2018年5月27日 星期日

maxima教學

Edwin L. (Ted) Woollett
屏東教育大學
屏東教育大學 應數系
http://www.math.nptu.edu.tw/ezfiles/115/1115/img/626/JHmathG11.pdf 

施文奇的教學檔案


De Morgan Law (迪摩根定理)

(AUB)'=A'nB'
(AnB)'=A'U B'

U:{1,2,3,4,5,6,7,8,9,10}; 
A:{1,2,4,6};B:{1,3,4};

Ap:setdifference(U,A);

Bp:setdifference(U,B);

AuB;union(A,B);

AnB:intersect(A,B);

setdifference(U,AuB);
intersect(Ap,Bp);

setdifference(U,AnB);
union(Ap,Bp);




2018年4月10日 星期二

集合,等比數列,等差數列,permutation,combination

 集合(Set)
U:{1,2,3,4,5,6,7,8,9,10};
A:{1,2,4,6};B:{1,3,4};
cardinality(U);
cardinality(A);
cardinality(B);
 
AuB:union(A,B);

AnB:intersect(A,B);

powerset(A);
cardinality(%);
 
Ap:setdifference(U,A);

Bp:setdifference(U,B);

AminusB:setdifference(A,B);

BminusA:setdifference(B,A);

ApnBp:intersect(Ap,Bp);

ApuBp:union(Ap,Bp);


setequalp (a, b)


Returns true if sets a and b have the same number of elements and is(x = y) is true for x in the elements of a and y in the elements of b, considered in the order determined by listify. Otherwise, setequalp returns false.


setequalp(setdifference(U,AuB),ApnBp);

 setequalp(setdifference(U,AnB),ApuBp);

disjoin(A,B); 

disjoin(B,A); 
 
 http://maxima.sourceforge.net/docs/manual/maxima_35.html#SEC188

排列(permutation), 組合(combination)
Function: permutation (n, r)
Returns the number of permutations of r objects selected from a set of n objects.
To use this function write first load(functs).
Function: combination (n, r)
Returns the number of combinations of n objects taken r at a time.
To use this function write first load(functs).

 load(functs);
 permutation(5,3);

combination(5,3);

級數和

Function: arithmetic (a, d, n)
Returns the n-th term of the arithmetic series a, a + d, a + 2*d, ..., a + (n - 1)*d.
To use this function write first load(functs).
Categories:  Package functs · Sums and products

Function: geometric (a, r, n)
Returns the n-th term of the geometric series a, a*r, a*r^2, ..., a*r^(n - 1).
To use this function write first load(functs).
Categories:  Package functs · Sums and products

Function: harmonic (a, b, c, n)
Returns the n-th term of the harmonic series a/b, a/(b + c), a/(b + 2*c), ..., a/(b + (n - 1)*c).
To use this function write first load(functs).
Categories:  Package functs · Sums and products

Function: arithsum (a, d, n)
Returns the sum of the arithmetic series from 1 to n.
To use this function write first load(functs).
Categories:  Package functs · Sums and products

Function: geosum (a, r, n)
Returns the sum of the geometric series from 1 to n. If n is infinity (inf) then a sum is finite only if the absolute value of r is less than 1.
To use this function write first load(functs).
  
load(functs);
 a:1;d:2;n:10;
arithmetic(a,d,n); 
/*an=a+(n-1)d*/
a+(n-1)*d;


r:2;n:10;
geometric (a, r, n)  ;
/*an=ar^(n-1)*/
a*r^(n-1);


b:2;c:3;
harmonic (a, b, c, n);

d:2;n:10;
 arithsum (a, d, n);
/*a+(a+d)+(a+2d)+...+(a+(n-1)d) */
/*Sn=n/2(2a+(n-1)d) */
n/2*(2*a+(n-1)*d);

r:2;n:10;
 geosum (a, r, n);
/*a+ar+ar^2+...+ar^(n-1) */ 
/* Sn=a(1-r^n)/(1-r) */
a*(1-r^n)/(1-r);