Skip to content

Telegram bot that analyses mathematical functions and data

Notifications You must be signed in to change notification settings

nn-students-2021h2/Function_explorer_bot_8

Repository files navigation

Team №8

Roman Burtsev - Team Leader

Roman Yezhov - QA

Konstantin Rumyantsev - Code Reviewer


Function Explorer Bot

python pylint Telegram MongoDB Docker

Function Explorer Telegram Bot is a tool that allows you to analyse functions, get information about them and draw graphs.

What this bot can doHow to find or run the botHow to useWhat is planned to be implementedMeme

What this bot can do?

  • Might exist
  • Draw graphs with some options
  • Analyse math functions (there are many options for this)
  • Send meme
  • Disappoint you

How to run or find the bot?

If you are a normal user...

Find our bot named "Function Explorer" in Telegram:

none

Then start a conversation with the bot to check if it is activated (/start command).

If you are a normal host...

System dependencies briefly:

  • Python 3.10+
  • TeX Distribution
  • MongoDB
  1. Clone this repository. Make sure you have Python 3.10+ installed on your machine
  2. Create Telegram bot following official Telegram instructions
  3. Put your token into TOKEN variable in source/conf/default_config.json
  4. Install TeX distribution. For example, MiKTeX is recommended for Windows or TeX Live is ideal for Linux:
    • If you want to use MiKTeX, then after installing, open application 'MiKTeX Console', click 'Updates' - 'Check for updates' - 'Update now'. Install all packages. Then open your IDE, launch the Bot and type him next command:
      /analyse domain x
      IDE may ask you to install some dependencies of TeX (in popup window). Accept it and wait until installation is complete
    • If you want to use TeX Live, then you must also install texlive-latex-extra and dvipng (via apt-get or something else).
  5. Install MongoDB and start server (on Windows it starts automatically)
  6. After that you can use the bot with your token. Maybe.

If you are a superconductor...

System dependencies briefly:

  • Docker
  • Docker-compose

If you want to deploy the bot:

  1. Find a suitable machine for your bot. For instance, your PC or Azure, or AWS
  2. Install Docker and Docker Compose
  3. Do steps 1, 2 and 3 of the "If you are a normal host..." instruction above
  4. Run command docker-compose up --build (you have not to type --build option further without updating the bot) in the working directory and wait until all dependencies installed

About commands or how to use?

The commands below are an alternative way to the handy buttons, so you have not to use or know them

  • /start to back to the main menu

  • /help to... get a help? Here you can check examples of plotting and analysing and guides

  • /graph arg1, arg2, ..., option1, option2, ... draws a graph of given functions with specified options (range / domain / aspect ratio). Options are... optional. See /resources/graph_patterns.md to see all (or almost) patterns. Functions should be in math format, e.g. "x = 1", "y = x^2 + sin x", "x", "y = 1", "2 y sin x cos(x) = 0.5".
    There are several options:

    • Domain - you can add functions domain via argument "x from _ to _" or "x = [, ]", for instance, "/graph x, x from -10 to 5", "/graph x = [0.5, 1.5], x^2".
    • Range - you can also define y-limit by same syntax as domain: "y from 10 to 20", "y in (-10, 10)".
    • Aspect ratio - the ratio of the width to the height of a result image: "aspect ratio = 1", "ratio = 0.5"

    The limit on the number of functions is 10. Options can override each other. All variables except 'x' and 'y' will be replaced by 'x' and 'y' intuitively.

  • /analyse request tries to perform a user query on a function specified in the query. The function should be in math format, for example: "/analyse domain of sqrt x", "/analyse derivative of the function y * x**2 by x", "period sin x". You can find sets of patterns in file /resources/analysis_patterns.md. Supported actions:

    • Derivative
    • Domain
    • Range
    • Zeros
    • Axes intersection
    • Periodicity
    • Convexity
    • Concavity
    • Vertical asymptotes
    • Horizontal asymptotes
    • Slant asymptotes (with horizontal as a special case of slant)
    • Asymptotes (vertical, horizontal and slant)
    • Evenness and oddness
    • Maximum value
    • Minimum value
    • Stationary points
    • Monotonicity

What is planned to be implemented?

  • More actions for analysis
  • Better function plotting. New features, functionality and customizable canvas
  • Sample analysis. Statistics. Probability theory. Drawing a graph from the data and subsequent analysis
  • New and more user-friendly commands for interaction with the bot

Meme

About C language meme

About

Telegram bot that analyses mathematical functions and data

Topics

Resources

Stars

Watchers

Forks

Languages