# doc-cache created by Octave 4.0.0
# name: cache
# type: cell
# rows: 3
# columns: 15
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
assumptions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1257
 -- Function File: A = assumptions ()
 -- Function File: A = assumptions (X)
 -- Function File: [V, D] = assumptions (X, 'dict')
 -- Function File: L = assumptions ('possible')
     List assumptions on symbolic variables.

     The assumptions are returned as a cell-array of strings:
          >> syms x y positive
          >> syms n integer
          >> assumptions
             ⇒ ans =
               {
                 [1,1] = n: integer
                 [1,2] = x: positive
                 [1,3] = y: positive
               }
          >> f = sin(n*x);
          >> assumptions(f)
             ⇒ ans =
               {
                 [1,1] = n: integer
                 [1,2] = x: positive
               }
          >> assumptions(n)
             ⇒ ans =
               {
                 [1,1] = n: integer
               }

     With the optional second argument set to the string ‘'dict'’,
     return the assumption dictionaries in D corresponding to the
     variables in V.

     You can also get a list of possible assumptions:
          >> A = assumptions('possible');
          >> sprintf('%s ', A{:})
             ⇒ ans = real positive negative integer even odd rational finite

     See also: sym, syms, assume, assumeAlso.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
List assumptions on symbolic variables.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
bernoulli


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 448
 -- Function File: B = bernoulli (N)
 -- Function File: P = bernoulli (N, X)
     Return Bernoulli numbers and polynomials.

     Examples:
          >> bernoulli(6)
             ⇒ (sym) 1/42
          >> bernoulli(7)
             ⇒ (sym) 0

     Polynomial example:
          >> syms x
          >> bernoulli(2, x)
             ⇒ (sym)
                 2       1
                x  - x + ─
                         6

     See also: euler.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Return Bernoulli numbers and polynomials.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
catalan


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 170
 -- Function File: catalan ()
     Return Catalan constant.

          vpa (catalan ())
          ⇒ (sym) 0.91596559417721901505460351493238

     See also: eulergamma.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Return Catalan constant.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
digits


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 479
 -- Function File: N = digits ()
 -- Function File: digits (N)
 -- Function File: OLDN = digits (N)
     Get/set number of digits used in variable precision arith.

     Examples:
          >> n_orig = digits(7);
          >> vpa('pi')
             ⇒ (sym) 3.141593

          >> digits(42)
          >> vpa('pi')
             ⇒ (sym) 3.14159265358979323846264338327950288419717

          >> digits(n_orig)   # reset digits to saved value

     See also: sym, vpa, vpasolve.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Get/set number of digits used in variable precision arith.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
eulergamma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 182
 -- Function File: eulergamma ()
     Return Euler-Mascheroni constant.

          vpa (eulergamma ())
          ⇒ (sym) 0.57721566490153286060651209008240

     See also: catalan.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Return Euler-Mascheroni constant.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
evalpy


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2327
 -- Function File: evalpy (CMD)
 -- Function File: evalpy (CMD, X, Y, …)
     Run Python code, automatically transferring results.

     Examples:
          >> x = -4;
          >> evalpy ('y = 2*x', x)
             ⇒ y = -8
          >> y
             ⇒ y = -8

     You can replace ‘x’ with a new value in the Python code:
          >> syms x
          >> evalpy ('y = 3*x; x = -1.5; z = x**2', x)
             ⇒
               x = -1.5000
               y = (sym) 3⋅x
               z =  2.2500

     All arguments can be accessed as ‘i0’, ‘i1’, etc.  This is useful
     if they don’t have inputnames:
          >> x = 10;
          >> evalpy ('y = ", ".join( (str(x),str(i0),str(i1)) )', x, 5)
             ⇒ y = 10.0, 10.0, 5.0

     If you need a variable in Python but don’t want it passed back to
     Octave, put an ‘_’ (underscore) at the beginning or end.
          >> x = 20;
          >> evalpy ('_y = 3*x; z_ = _y/6; my = z_/2;', x)
             ⇒ Variables effected: my
          >> _y
             ⇒ ??? '_y' undefined near line 1 column 1
          >> z_
             ⇒ ??? 'z_' undefined near line 1 column 1

     The final few characters of CMD effect the verbosity:
        • 2 semicolons ‘;;’, very quiet, no output.
        • 1 semicolon ‘;’, a one-line msg about variables assigned.
        • no semicolon, display each variable assigned.

     Multiline code should be placed in a cell array, see the
     ‘python_cmd’ documentation.

     Warning: evalpy is probably too smart for its own good.  It is
     intended for interactive use.  In your non-interactive code, you
     might want ‘python_cmd’ instead.

     Notes:
        • if you assign to X but don’t change its value, it will not be
          assigned to and will not appear in the Variables effected:"
          list.
        • using print is probably a bad idea.  For now, use ‘dbout(x)’
          to print ‘x’ to stderr which should appear in the terminal
          (FIXME: currently broken on windows).
        • evalpy is a bit of a work-in-progress and subject to change.
          For example, with a proper IPC mechanism, you could grab the
          values of X etc when needed and not need to specify them as
          args.

     See also: python_cmd.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Run Python code, automatically transferring results.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
fibonacci


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 505
 -- Function File: F = fibonacci (N)
 -- Function File: P = fibonacci (N, X)
     Return Fibonacci numbers and polynomials.

     Examples:
          >> fibonacci(15)
             ⇒ (sym) 610
          >> syms n
          >> fibonacci(n)
             ⇒ (sym) fibonacci(n)

     Polynomial example:
          >> syms x
          >> fibonacci(10, x)
             ⇒ (sym)
                9      7       5       3
               x  + 8⋅x  + 21⋅x  + 20⋅x  + 5⋅x

     See also: euler, bernouilli.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Return Fibonacci numbers and polynomials.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
findsymbols


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 800
 -- Function File: L = findsymbols (X)
     Return a list (cell array) of the symbols in an expression.

     The list is sorted alphabetically.  *Note symvar::, for details.

     If two variables have the same symbol but different assumptions,
     they will both appear in the output.  It is not well-defined in
     what order they appear.

     X could be a sym, sym array, cell array, or struct.

          >> syms x y z
          >> C = {x, 2*x*y, [1 x; sin(z) pi]};
          >> findsymbols (C)
             ⇒
               {
                 (sym) x
                 (sym) y
                 (sym) z
               }

     Note E, I, pi, etc are not counted as symbols.

     Note only returns symbols actually appearing in the RHS of a
     ‘symfun’.

     See also: symvar, findsym.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Return a list (cell array) of the symbols in an expression.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
octsympy_tests


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 452
 -- Function File: R = octsympy_tests ()
     Run the OctSymPy tests, log results, and return true if passing.

     I threw this together by modifying "__run_test_suite__.m" which is
     Copyright (C) 2005-2013 David Bateman and part of GNU Octave, GPL
     v3.

     FIXME: once we no longer try to support Octave 3.6, drop most of
     this and call "__run_test_suite({'@sym', '@symfun'}, {})" instead.
     See https://savannah.gnu.org/bugs/?41215


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Run the OctSymPy tests, log results, and return true if passing.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
poly2sym


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 725
 -- Function File: P = poly2sym (C)
 -- Function File: P = poly2sym (C, X)
     Create a symbolic polynomial expression from coefficients.

     If X is not specified, the free variable is set to ‘x’.  C may be a
     vector of doubles or syms.  It can also be a cell array vector.  X
     may be a symbolic expression or something that converts to one.
     The coefficients correspond to decreasing exponent of the free
     variable.

     Example:
          x = sym ('x');
          y = sym ('y');
          poly2sym ([2 5])
             ⇒ (sym) 2⋅x + 5
          poly2sym ({2*y 5 -3}, x)
             ⇒ (sym)
                   2
                2⋅x ⋅y + 5⋅x - 3

     See also: sym2poly, polyval, roots.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Create a symbolic polynomial expression from coefficients.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
python_cmd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2821
 -- Function File: [A, B, …] = python_cmd (CMD, X, Y, …)
     Run some Python command on some objects and return other objects.

     Here CMD is a string of Python code.  Inputs X, Y, … can be a
     variety of objects (possible types listed below).  Outputs A, B, …
     are converted from Python objects: not all types are possible, see
     below.

     Example:
          >> x = 10; y = 2;
          >> cmd = '(x,y) = _ins; return (x+y,x-y)';
          >> [a, b] = python_cmd (cmd, x, y)
             ⇒ a =  12
             ⇒ b =  8

     The inputs will be in a list called ’_ins’.  The command should end
     by outputing a tuple of return arguments.  If you have just one
     return value, you probably want to append an extra comma.  Either
     of these approaches will work:
          >> cmd = '(x,y) = _ins; return (x+y,)';
          >> a = python_cmd (cmd, x, y)
             ⇒ a =  12
          >> cmd = '(x,y) = _ins; return x+y,';
          >> a = python_cmd (cmd, x, y)
             ⇒ a =  12
     (Python gurus will know why).

     Instead of ‘return’, you can append to the Python list ‘_outs’:
          >> cmd = '(x,y) = _ins; _outs.append(x**y)';
          >> a = python_cmd (cmd, x, y)
             ⇒ a =  100

     You can also pass a cell-array of lines of code.  But be careful
     with whitespace: its Python!
          >> cmd = { '(x,) = _ins'
          ..         'if x.is_Matrix:'
          ..         '    return (x.T,)'
          ..         'else:'
          ..         '    return (x,)' };
     The cell array can be either a row or a column vector.  Each of
     these strings probably should not have any newlines (other than
     escaped ones e.g., inside strings).  An exception might be Python
     triple-quoted """ multiline strings """.  FIXME: test this.  It
     might be a good idea to avoid blank lines as they can cause
     problems with some of the IPC mechanisms.

     Possible input types:
        • sym objects
        • strings (char)
        • scalar doubles
     They can also be cell arrays of these items.  Multi-D cell arrays
     may not work properly.

     Possible output types:
        • SymPy objects (Matrix and Expr at least)
        • int
        • float
        • string
        • unicode strings
        • bool
        • dict (converted to structs)
        • lists/tuples (converted to cell vectors)
     FIXME: add a py_config to change the header?  The python
     environment is defined in python_header.py.  Changing it is
     currently harder than it should be.

     Note: if you don’t pass in any syms, this shouldn’t need SymPy.
     But it still imports it in that case.  If you want to run this w/o
     having the SymPy package, you’d need to hack a bit.

     See also: evalpy.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Run some Python command on some objects and return other objects.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
sympref


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3754
 -- Function File: R = sympref ()
 -- Function File: R = sympref (CMD)
 -- Function File: sympref CMD
 -- Function File: sympref CMD ARGS
     Preferences for the OctSymPy symbolic computing package.

     ‘sympref’ can set or get various preferences and configurations.
     The various choices for CMD and ARGS are documented below.

     *Python executable* path/command:
          >> sympref python '/usr/bin/python'       >> sympref python 'C:\Python\python.exe'  >> sympref python 'N:\myprogs\py.exe'     
     Default is an empty string; in which case OctSymPy just runs
     ‘python’ and assumes the path is set appropriately.

     *Display* of syms:
          >> sympref display
             ⇒ ans = unicode
          >> syms x
          >> sympref display flat
          >> sin(x/2)
             ⇒ (sym) sin(x/2)

          >> sympref display ascii
          >> sin(x/2)
             ⇒ (sym)
                       /x\
                    sin|-|
                       \2/

          >> sympref display unicode
          >> sin(x/2)
             ⇒ (sym)
                       ⎛x⎞
                    sin⎜─⎟
                       ⎝2⎠

          >> sympref display default
     By default OctSymPy uses the unicode pretty printer to display
     symbolic expressions.  If that doesn’t work (e.g., if you see ‘?’
     characters) then try the ‘ascii’ option.

     *Communication mechanism*:
          >> sympref ipc
             ⇒ ans = default
     The default will typically be the ‘popen2’ mechanism which uses a
     pipe to communicate with Python and should be fairly fast.  If that
     doesn’t work, try ‘sympref display system’ which is much slower, as
     a new Python process is started for each operation (many commands
     use more than one operation).  Other options for ‘sympref ipc’
     include:
        • ‘sympref ipc popen2’: force popen2 choice (e.g., on Matlab
          were it would not be the default).
        • ‘sympref ipc system’: construct a long string of the command
          and pass it directly to the python interpreter with the
          ‘system()’ command.  This typically assembles a multiline
          string for the commands, except on Windows where a long
          one-line string is used.
        • ‘sympref ipc systmpfile’: output the python commands to a
          ‘tmp_python_cmd.py’ file and then call that [for debugging,
          may not be supported long-term].
        • ‘sympref ipc sysoneline’: put the python commands all on one
          line and pass to ‘python -c’ using a call to ‘system()’.  [for
          debugging, may not be supported long-term].

     *Reset*: reset the SymPy communication mechanism.  This can be
     useful after an error occurs and the connection with Python becomes
     confused.
          >> sympref reset     

     *Snippets*: when displaying a sym object, we quote the SymPy
     representation (or a small part of it):
          >> syms x
          >> y = [pi x];
          >> sympref snippet on
          >> y
             ⇒ y = (sym 1×2 matrix)       “...([[pi, Symbol('x')]])”
                 [π  x]
          >> sympref snippet off
          >> y
             ⇒ y = (sym) [π  x]  (1×2 matrix)
          >> sympref snippet default

     *Default precision*: control the number of digits used by
     variable-precision arithmetic (see also the *note digits::
     command).
          >> sympref digits          % get
             ⇒ ans = 32
          >> sympref digits 64       % set
          >> sympref digits default

     Report the *version* number:
          >> sympref version
             ⇒ 2.2.4

     See also: sym, syms.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Preferences for the OctSymPy symbolic computing package.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
syms


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1337
 -- Function File: syms X
 -- Function File: syms X Y …
 -- Function File: syms F(X)
 -- Function File: syms X ASM
 -- Function File: syms X ASM ASM2 …
 -- Function File: syms
     Create symbolic variables and symbolic functions.

     This is a convenience function.  For example:
          >> syms x y z
     instead of:
          >> x = sym('x');
          >> y = sym('y');
          >> z = sym('z');

     The last arguments can provide one or more assumptions (type or
     restriction) on the variable (*note sym::).
          >> syms x y z positive
          >> syms n positive even

     Symfuns represent abstract or concrete functions.  Abstract symfuns
     can be created with ‘syms’:
          >> syms f(x)
     If ‘x’ does not exist in the callers workspace, it is created as a
     *side effect* in that workspace.

     Called without arguments, ‘syms’ displays a list of all symbolic
     functions defined in the current workspace.

     Caution: On Matlab, you may not want to use ‘syms’ within
     functions.  In particular, if you shadow a function name, you may
     get hard-to-track-down bugs.  For example, instead of writing ‘syms
     alpha’ use ‘alpha = sym('alpha')’ in functions.
     [https://www.mathworks.com/matlabcentral/newsreader/view_thread/237730]

     See also: sym.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Create symbolic variables and symbolic functions.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
vpa


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 697
 -- Function File: Y = vpa (X)
 -- Function File: Y = vpa (X, N)
     Create a variable-precision floating point number.

     X can be a string, a sym or a double.  Example:
          >> x = vpa('1/3', 32)
             ⇒ x = (sym) 0.33333333333333333333333333333333
          >> a = sym(1)/3;
          >> x = vpa(a, 32)
             ⇒ x = (sym) 0.33333333333333333333333333333333

     Be careful when creating a high-precision float from a double as
     you will generally only get 15 digits:
          >> vpa(1/3, 32)
             ⇒ (sym) 0.33333333333333331482961625624739

     If N is omitted it defaults to the current value of ‘digits()’.

     See also: sym, vpasolve, digits.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Create a variable-precision floating point number.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
vpasolve


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 458
 -- Function File: Y = vpasolve (E)
 -- Function File: Y = vpasolve (E, X)
 -- Function File: Y = vpasolve (E, X, X0)
     Numerical solution of a symbolic equation.

     Variable-precision numerical solution of the equation E for
     variable X using initial guess of X0.

     Example:
          >> syms x
          >> eqn = exp(x) == x + 2;
          >> vpasolve(eqn, x, 0.1)
             ⇒ (sym) 1.1461932206205825852370610285214

     See also: vpa.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Numerical solution of a symbolic equation.





