mXparser - Tutorial

MathParser.org - mXparser - logo - Tutorial

 

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

- Printing the license

  • mXparser.consolePrintln( mXparser.LICENSE );

Using internal help

  • Full help content
  • In-line help searching

- Simple expressions

  • Simple calculation
  • Changing expression string
  • Using operators
  • Power function
  • Using numbers in scientific notation

- Evaluating relations

  • Binary relation "="
  • Binary relation "<"
  • Boolean operator "OR"
  • Boolean operator "AND"

- Using built-in functions

  • Unary function
  • Binary function
  • Function with 3 arguments
  • Function with n-arguments
  • Function with even number of arguments

- User defined arguments

  • Dealing with free arguments
  • Defining dependent arguments

- Summation & Product iterated operators

  • SIGMA summation operator
  • PI product operator
  • SIGMA summation operator - Approximating sin(x) by Taylor series
  • SIGMA summation operator - Approximating pi value by integrating sqrt(1-x^2)

- Derivatives & Integrals

  • General derivative
  • Left / right derivative
  • Derivative from more complex function
  • Integrals - calculating pi by integration sqrt(1-x^2)

- Built-in constants

  • Using built-in constants
  • Estimating Moon gravitational acceleration
  • Getting list of constants

- Built-in Units

  • Units of length / distance
  • Units of time
  • Units of information
  • Units of volume
  • List of supported units

- Built-in Metric prefixes

  • Example: 10 Millions / Kilo
  • List of supported metric prefixes

- Bitwise Operators

  • Bitwise unary complement
  • Bitwise AND
  • Bitwise exclusive OR
  • Bitwise inclusive OR
  • Signed left / right shift

- User defined functions

  • Fast function definition (performance of creation)
  • Handy function constructor, but slower proces of function creation (performance of
  • creation slower, but calculation the same)
  • Function with more parameters
  • Function in function
  • Implementing your own Function Extension

- User defined constants

  • Defining constant - various options

- Fast (limited) user defined recursion

  • Fibonacci numbers using fast recursion

- User defined recursion - not limited

  • Fibonacci numbers using user defined recursive function
  • Number of recursive parameters is not limited - binomial coefficient definition using user defined recursive function
  • Mixing function parameters - part causing recursive calls, other part as 'typical' parameter. Below example is presenting definition of Chebyshev polynomial using recursive function.
  • Indirect recursion - approximating sin(x) and cos(x)

Prime Numbers

  • Primality test function
  • Primes counting function
  • Using built-in primes cache to accelerate calculations
  • Estimating number of primes using Offset logarithmic integral function

- Inspecting calculation process

  • Setting the verbose mode
  • Syntax checking
  • Lexical syntax checking
  • Getting computing time

- Random numbers

  • Random number from uniform continuous distribution
  • Random number from uniform discrete distribution
  • Random number from normal distribution
  • Random number from a given list
  • Estimating mean of Normal distribution
  • Estimating standard deviation of Normal distribution
  • Estimating variance of Normal distribution

- PDF, CDF and Quantile functions

  • Expected value estimation using Probability Distribution Function
  • Probability estimation using Cumulative Distribution Function - the law of 3*SIGMA
  • Calculating quantiles using Inverse Cumulative Distribution Function - males height example assuming males height distribution N(170, 15)

- Solving equation f(x) = 0

  • Solve 2x-4 = 0 for x in [0, 10]
  • Solve cos(x) = 0 for x in [0, pi]
  • Solve cos(x) = 0 for x in [pi, pi] (root not bracketed)
  • Solve x-y = 0 for x in [0, 10] and y = 4
  • Solve sin'(x) = 0 for x in [0, pi]

- Built-in Random Variables

  • Random integer
  • Random integer N: -10^k <= N <= 10^k for k = 1, 2, ...,9
  • Random natural number
  • Random natural number N <= 10^k for k = 1, 2, ...,9
  • Uniform continuous distribution U(0,1)
  • Normal distribution N(0,1)

User defined Random Variables

  • Dependent argument as user defined random variable
  • User defined function as user defined random variable - random walk example

Playing with expression tokens

  • Printing expression tokens
  • Using tokens to print expression in a fancy way
  • Playing with invalid tokens

*** If you found the software useful donation is something you might consider 🙂 ***

If you found the software useful donation is something you might consider :-)

Enjoy 🙂

Best regards,

Mariusz Gromada

Download latest release – v.4.0.0.2: bin + doc + src (.zip 10.7 MB)

Download latest release – v.4.0.0.2: bin only (.zip 3.04 MB) – separate binaries for java: 1.5, 1.6, 1.7, 1.8; .NET: 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, .NET Core, .NET Standard, .NET PCL, Xamarin.Android, Xamarin.iOS

Source code .zipSource code .tar.gz View on GitHubMathSpace.pl