Questions tagged [equation]

A statement that the values of two expressions are equal indicated by the sign = .

A statement that the values of two s are equal indicated by the sign =.

1925 questions
122
votes
24 answers

Equation (expression) parser with precedence?

I've developed an equation parser using a simple stack algorithm that will handle binary (+, -, |, &, *, /, etc) operators, unary (!) operators, and parenthesis. Using this method, however, leaves me with everything having the same precedence - it's…
Adam Davis
  • 91,931
  • 60
  • 264
  • 330
105
votes
6 answers

How to label each equation in align environment?

I wonder how to label each equation in align environment? For example \begin{align} \label{eq:lnnonspbb} \lambda_i + \mu_i = 0 \\ \mu_i \xi_i = 0 \\ \lambda_i [y_i( w^T x_i + b) - 1 + \xi_i] = 0 \end{align} only label the first equation and only…
Tim
  • 1
  • 141
  • 372
  • 590
63
votes
7 answers

How to write equations in html?

I want to write some complex mathematical equation in my web page. Is there any plugin or anything for this?
anan_xon
  • 1,102
  • 1
  • 11
  • 21
54
votes
2 answers

number several equations with only one number

How can I number several equations in a align environment using only one number? For example \begin{align} w^T x_i + b \geqslant 1-\xi_i \text{ if } y_i=1, \nonumber \\ w^T x_i + b \leqslant -1+\xi_i \text{ if } y_i=-1, \end{align} The numbering…
Tim
  • 1
  • 141
  • 372
  • 590
47
votes
16 answers

Math equations on the web

How can I render Math equations on the web? I am already familiar with LaTeX's Math mode.
Justin R.
  • 23,435
  • 23
  • 108
  • 157
44
votes
7 answers

Equation parsing in Python

How can I (easily) take a string such as "sin(x)*x^2" which might be entered by a user at runtime and produce a Python function that could be evaluated for any value of x?
WalkingRandomly
  • 4,537
  • 5
  • 34
  • 34
40
votes
2 answers

Solve an equation using a python numerical solver in numpy

I have an equation, as follows: R - ((1.0 - np.exp(-tau))/(1.0 - np.exp(-a*tau))) = 0. I want to solve for tau in this equation using a numerical solver available within numpy. What is the best way to go about this? The values for R and a in this…
stars83clouds
  • 795
  • 1
  • 8
  • 25
40
votes
5 answers

How can I solve equations in Python?

Let's say I have an equation: 2x + 6 = 12 With algebra we can see that x = 3. How can I make a program in Python that can solve for x? I'm new to programming, and I looked at eval() and exec() but I can't figure out how to make them do what I want.…
user1221937
  • 513
  • 2
  • 6
  • 7
39
votes
6 answers

Is it possible to plot implicit equations?

I would like to plot implicit equations (of the form f(x, y)=g(x, y) eg. X^y=y^x) in Matplotlib. Is this possible?
Geddes
  • 1,191
  • 2
  • 11
  • 25
35
votes
7 answers

Latex: how to break a line inside $$

I want to manually break a line inside $$: $$something something something else$$ I tried \\, \newline, and \linebreak but none work. Ideas?
Guy
  • 14,178
  • 27
  • 67
  • 88
33
votes
4 answers

how to handle an asymptote/discontinuity with Matplotlib

When plotting a graph with a discontinuity/asymptote/singularity/whatever, is there any automatic way to prevent Matplotlib from 'joining the dots' across the 'break'? (please see code/image below). I read that Sage has a [detect_poles] facility…
Geddes
  • 1,191
  • 2
  • 11
  • 25
27
votes
16 answers

Simplest way to solve mathematical equations in Python

I want to solve a set of equations, linear, or sometimes quadratic. I don't have a specific problem, but often, I have been in this situation often. It is simple to use wolframalpha.com, the web equivalent of Mathematica, to solve them. But that…
lprsd
  • 84,407
  • 47
  • 135
  • 168
26
votes
4 answers

How do I break a long equation over lines?

I am trying to add an equation in a new line. The problem is that the equation is too long for the line, and I need to break it manually. Otherwise, it just overlaps to the right column, or to the right margins (and looks ugly...). Is there a way…
Anna
  • 4,099
  • 4
  • 24
  • 26
26
votes
2 answers

Documenting equations with deqn and roxygen

I'm using \deqn{}{} with roxygen2 to document equations for a function in a package. The LaTeX (the 1st argument to deqn) renders fine because white space is ignored in LaTeX equations, but I have a problem with the ASCII (the 2nd argument to deqn)…
Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
21
votes
5 answers

JavaScript equation solver library

Is there a JavaScript library or function that will solve equations for variables? Such as 9 = 3 + x and solve for x. But it should also solve more advanced equations that include sine, cosine, and tangent.
Will
  • 19,661
  • 7
  • 47
  • 48
1
2 3
99 100