Maxima

From NikkiWiki
Jump to: navigation, search
Image: WXMaxima screenshot.[1][2]
Image: Maxima command-line interface (CLI).

(WX)Maxima is a free open-source computer-algebra system (CAS) and is the basis for commercial softwares such as Wolfram Mathematica and Waterloo Maple.

manuals

installation

examples

See also Maxima constants.

  • Approximate the Napier constant (e) to sixty-four (64 = 26, sixth power of two) digits:
    • bfloat(%e),fpprec:2^6;
    • 2.718281828459045235360287471352662497757247093699959574966967628b0
  • Find all of the prime numbers equal to or less than sixty-four:
    • primes(0,2^6);
    • [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61]
    • Find the next prime after sixty-four:
      • next_prime(2^6);
      • 67
    • Find the largest prime less than the eighth power of two (28 = 256):
      • prev_prime(2^8);
      • 251
    • Is 257 a prime number?
      • primep(257);
      • true
  • Find the results of sixteen (16 = 24, the fourth power of two) coin tosses:
    • makelist(random(2),2^4);
    • [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0]
  • Find the results of sixteen rolls of a six-sided die:
    • makelist(random(6)+1,2^4);
    • [5, 1, 1, 1, 3, 2, 3, 5, 4, 1, 6, 4, 4, 5, 1, 1]
  • Find the volume of a sphere with radius two (V = 4πr3/3):
    • float(4*%pi*2^3/3);
    • 33.51032163829112
  • Generate the first sixteen powers of two:
    • makelist(2^n,n,2^4);
    • [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536]

  1. wikipedia:WXMaxima
  2. commons:WXMaxima