how to handle an asymptote/discontinuity

By using masked arrays you can avoid plotting selected regions of a curve. To remove the singularity at x=2: import matplotlib.numerix.ma as M # for older versions, prior to .98 #import numpy.ma as M # for newer versions of matplotlib from pylab import * figure() xx = np.arange(-0.5,5.5,0.01) vals = 1/(xx-2) vals = M.array(vals) mvals … Read more

Solve an equation using a python numerical solver in numpy

In conventional mathematical notation, your equation is The SciPy fsolve function searches for a point at which a given expression equals zero (a “zero” or “root” of the expression). You’ll need to provide fsolve with an initial guess that’s “near” your desired solution. A good way to find such an initial guess is to just … Read more

Equation parsing in Python

Python’s own internal compiler can parse this, if you use Python notation. If your change the notation slightly, you’ll be happier. import compiler eq= “sin(x)*x**2” ast= compiler.parse( eq ) You get an abstract syntax tree that you can work with.

Math equations on the web

The other answers are out-of-date. As of 2012, beautiful math is easy to write and render. The technology is called MathJax. You can see it in quiet action on MathOverflow and hundreds of math blogs. MathJax is an open source JavaScript display engine for mathematics that works in all modern browsers. No more setup for … Read more

number several equations with only one number

First of all, you probably don’t want the align environment if you have only one column of equations. In fact, your example is probably best with the cases environment. But to answer your question directly, used the aligned environment within equation – this way the outside environment gives the number: \begin{equation} \begin{aligned} w^T x_i + … Read more

How to label each equation in align environment?

You can label each line separately, in your case: \begin{align} \lambda_i + \mu_i = 0 \label{eq:1}\\ \mu_i \xi_i = 0 \label{eq:2}\\ \lambda_i [y_i( w^T x_i + b) – 1 + \xi_i] = 0 \label{eq:3} \end{align} Note that this only works for AMS environments that are designed for multiple equations (as opposed to multiline single equations).

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)