something to toy with, a symbolic dll that allows you to do basic
symbolic math. (beware of the taylor function, it may take forever)
http://www.mb.hs-wismar.de/~pawel/Uwe/casE.htmlexample of use:
Code:
; Thorsten Pawletta, University of Wismar, Dep. of Mechanical-, Process- and Environmental Eng.,
; --------------------------------------------------------------------------------
;
; Interpreter for symbolic manipulation of mathematical expressions
;
; Author: Jens- Uwe Dolinsky (other projects)
; Students' group: I93
; E-mail u.dolinsky@iname.com
;
; http://www.mb.hs-wismar.de/~pawel/Uwe/casE.html
; Win32 dynamic link library (DLL) (Last Built: Mon 05.02.01)
; http://www.mb.hs-wismar.de/~pawel/Uwe/win32symbolic.zip
; Conventions and function reference:(last update: Wed 12.09.01)
; New feature: Equation solving !
; Next update (~10/01): incl. e.g. symbolic solution of linear equation systems
; Identifiers of variables und functions consist of at least one letter followed by several letters or digits. Note that in e.g. DIFF(xxx,x) the expression xxx is an individual identifier and not x*x*x. Also e.g. ax is not a*x. This rule holds for all identifiers.
; If identifiers and numbers exceed 80 characters in length, they will be truncated down to 80 characters.
; If the interpreter encounters unknown functions or known functions with a number of arguments different from the specification below, those functions remain unevaluated! solve(3x+2,x) remains unevaluated since 3x+2 is no equation. Instead solve(3x+2=0,x) solves the equation 3x+2=0 for x.
; Convention Explanation
; operators +,-,*,/,^ basic operations
; constants PI circle's circumference
; basic functions SQRT(x) square root
; EXP(x) e- function
; LN(x) natural logarithm
; SIN(x),COS(x),TAN(x),COT(x) trigonometric functions
; ASIN(x),ACOS(x),ATAN(x) inverse trigonometric functions
; SINH(x),COSH(x) hyperbolic functions
; ABS(x) absolute value of x
; FAK(x) factorial of x
; substitution SUBST(a,x,expr) substitutes in expression a the subexpression x trough expression expr
; Equation solving SOLVE(expr1=expr2,x) The linear or quadratic equation expr1-expr2=0 will be solved symbolically for variable x.
; differentiation DIFF(f,x) derivative of f with respect to x
; DIFF(f,x,n) n- th order derivative of f with respect to x
; integration INT(f,x) indefinite integral of f with respect to x
; INT(f,x,i1,i2) definite integral of f with respect to x in the interval i1 to i2
; Taylor approximation TAYLOR(f,x,x0,n) Taylor approximation of f with respect to x on x=x0 in n-th order
; Fourieranalysis FOURIER(f,x,t1,t2,n) Fourier series of f with respect to x for the interval t1 to t2 in n-th order
; Floating Point Calculation APPROX(x) The constant expression x will be calculated using float numbers
; examples:
;
; Differentiation: DIFF(-1/5*x^2*TAN(LN(x)/2),x)
; DIFF(SIN(t^x),t)
; Partial derivation: DIFF(DIFF(1/(x^2 + y^2),x),y)
; Integration: INT(x^4*SIN(PI*x),x)
; INT(3*x^4+SIN(x),x,0,4)
; Numeric calculation: (8+123)*67-6
; APPROX(SIN(23)*COS(3*0.7))
; Evaluation of
; Polynomials: SUBST(2x^2+x-3,x,4)
; (value of polynomial 2x^2+x-3 at x=4);
; Taylor series: TAYLOR(SINH(x^2),x,0,5)
; Fourier analysis: FOURIER(x,x,0,1,6)
; Equation solving: SOLVE(3*x^2-8 = x-9+x^2,x)
err.l
a$=Space(63999)
If OpenLibrary(1, "symbolic.dll")
Debug "floating point numbers:"
err=CallFunction(1, "symbolic_calculate","approx(ln(2))",a$,63999)
Debug "approx(ln(2)) --> "+a$
Debug "fractions and large integers:"
err=CallFunction(1, "symbolic_calculate","1-1/3+1/5-1/7",a$,63999)
Debug "1-1/3+1/5-1/7 --> "+a$
err=CallFunction(1, "symbolic_calculate","FAK(33)",a$,63999)
Debug "FAK(33) --> "+a$
Debug "symbolic"
err=CallFunction(1, "symbolic_calculate","x+2*x",a$,63999)
Debug "x+2*x --> "+a$
CloseLibrary(1)
EndIf