Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

find_instance function

A point that meets a condition, or an empty list when there is none.

How to write it

find_instance(condition, variables, domain)

Over the reals or the integers; a point of a curved region comes as fractions that meet it.

condition
The condition; join several with and. Takes a condition, true or false.
variables
A variable, or a list of variables such as [x, y]. Takes a variable, or a list of variables.
domain

Examples

  • {x+y>10x−y<2x<5  (x,y)=(92,6)\displaystyle \begin{cases} x+y > 10 \\ x-y < 2 \\ x < 5 \end{cases} \; (x, y) = (\frac{9}{2}, 6)
    find_instance(x + y > 10 and x - y < 2 and x < 5, [x, y], real)

    In the solver, find_instance(x + y > 10 and x - y < 2 and x < 5, [x, y], real) gives [[x -> 9/2, y -> 6]].

    Open in the solver
  • {x2+y2=1x>35y>35  (x,y)=(2129,2029)\displaystyle \begin{cases} x^{2}+y^{2} = 1 \\ x > \frac{3}{5} \\ y > \frac{3}{5} \end{cases} \; (x, y) = (\frac{21}{29}, \frac{20}{29})
    find_instance(x^2 + y^2 = 1 and x > 3/5 and y > 3/5, [x, y], real)

    In the solver, find_instance(x^2 + y^2 = 1 and x > 3/5 and y > 3/5, [x, y], real) gives [[x -> 21/29, y -> 20/29]].

    Open in the solver
  • {x2+y2=50x>yy>0  (x,y)=(7,1)\displaystyle \begin{cases} x^{2}+y^{2} = 50 \\ x > y \\ y > 0 \end{cases} \; (x, y) = (7, 1)
    find_instance(x^2 + y^2 = 50 and x > y and y > 0, [x, y], integer)

    In the solver, find_instance(x^2 + y^2 = 50 and x > y and y > 0, [x, y], integer) gives [[x -> 7, y -> 1]].

    Open in the solver
  • find_root

    Find a root numerically, from a starting value.

  • eliminate

    Eliminate variables from a system of equations, leaving equations in the others.

  • least_squares

    The least-squares solution of A x = b.

  • solve_identity

    Find the values of the parameters that make an equation true for every value of the variable.

  • linear_solve

    Solve a linear system A x = b given by its matrix and right-hand side.

  • solve_all

    Describe the complete solution set of equations and inequalities.