Click here to Skip to main content
15,886,422 members
Articles / Programming Languages / C#

An extensible math expression parser with plug-ins

Rate me:
Please Sign up or sign in to vote.
4.92/5 (147 votes)
13 Mar 2008CPOL51 min read 1.4M   29K   364  
Design and code for an extensible, maintainable, robust, and easy to use math parser.
<?xml version="1.0" encoding="utf-8" ?>
<LibraryInfo schema="2" type="plugin" data1="MTNumAlgoPlugin.dll" data2="{1F6C2D74-1023-4E0F-8A6B-DBA19E6585E3}" version="1">
	<Resource LCID="en">
		<library title="Numerical algorithms" description="Various numerical algorithms" />
		
		<function id="derivate" symbol="derivate" args="expression,var,point" argDescs="the math expression to differenciate,a variable in the expression,the variable's value where the expression will be differenciated" description="Differentiate the expression with respect to one variable at the specified point" />
		<function id="trapezoid" symbol="trapezoid" args="expression,var,a,b,[step=0.1]" argDescs="the math expression to integrate,a variable in the expression,the lower bound,the upper bound,numerical step for the integration (optional)" description="Compute a numerical approximation to the integral between a and b" />
		<function id="solve" symbol="solve" args="expression,var,result,[v0=0],[tol=0.01],[maxIter=100]" argDescs="the math expression to solve,a variable in the expression,the expected result,an initial guess for the variable's value (optional),the error tolerance (optional),the maximum number of iterations before abording (optional)" description="Finds the variable's value that yields the desired result using the Newton's numerical approximation method" />
				
	</Resource>
	<Resource LCID="fr">
		<library title="Algorithmes numriques" description="Algorithmes d'approximation num�riques" />
		
		<function id="derivate" symbol="derivate" args="expression,var,point" argDescs="la fonction à dériver,la variable selon laquelle la fonction sera dérivée,le point où la fonction sera dérivée" description="Calcule la dérivée de la fonction en un point selon une variable" />
		<function id="trapezoid" symbol="trapezoid" args="expression,var,a,b,[delta=0.1]" argDescs="la fonction à intégrer,la variable selon laquelle la fonction sera intégrée,la borne inférieure,la borne supérieure,résolution de l'intégration (optionnel)" description="Calcule l'intégrale de la fonction selon une variable dans l'intervalle a et b" />
		<function id="solve" symbol="solve" args="expression,var,resultat,[v0=0],[tol=0.01],[maxIter=100]" argDescs="la fonction à résoudre,la variable pour laquelle on doit résoudre la fonction,le résultat attendu,valeur initiale de la variable (optionnel),la tolérance d'erreur (optionnel),le nombre maximum d'itération avant d'arrêter (optionnel)" description="Trouve la valeur de la variable qui donne le résultat attendu" />
		
	</Resource>
</LibraryInfo>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Canada Canada
Software Engineer working at a fun and smart startup company

Comments and Discussions