Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ode-solver-2021
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Величко Арсений Александрович
ode-solver-2021
Commits
9a166934
Commit
9a166934
authored
Dec 25, 2021
by
Величко Арсений Александрович
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented welcome interface
parent
2a1cb5a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
main.py
src/main.py
+70
-0
No files found.
src/main.py
View file @
9a166934
import
typing
as
tp
import
static_solvers
import
dynamic_solvers
import
functions
from
tabulate
import
tabulate
import
typer
STATIC_METHODS
=
[
static_solvers
.
left_rectangle_method
,
static_solvers
.
right_rectangle_method
,
static_solvers
.
trapezium_method
,
static_solvers
.
parabola_method
,
]
DYNAMIC_METHODS
=
[
dynamic_solvers
.
cordic_method
,
dynamic_solvers
.
double_recalculate_method
,
dynamic_solvers
.
runge_kutty_method
,
dynamic_solvers
.
euler_method
,
dynamic_solvers
.
mysterious_method
,
]
ALL_METHODS
=
[
*
STATIC_METHODS
,
*
DYNAMIC_METHODS
,
]
ALL_FUNCTIONS
=
[
functions
.
fn_sin
,
functions
.
fn_cos
,
functions
.
fn_ln
,
functions
.
fn_sqrt
,
functions
.
fn_square
,
functions
.
fn_cube
,
]
def
list_methods
()
->
None
:
headers
=
[
"№"
,
"Название метода"
]
method_names
=
[
method
.
__doc__
for
method
in
ALL_METHODS
]
method_table
=
tabulate
(
tabular_data
=
[[
no
,
name
]
for
no
,
name
in
enumerate
(
method_names
,
start
=
1
)],
headers
=
headers
,
)
typer
.
echo
(
"Доступные методы с постоянным и переменным шагом:"
)
typer
.
echo
(
method_table
+
"
\n
"
)
def
list_functions
()
->
None
:
headers
=
[
"№"
,
"Функция"
]
function_names
=
[
function
.
__doc__
for
function
in
ALL_FUNCTIONS
]
function_table
=
tabulate
(
tabular_data
=
[[
no
,
name
]
for
no
,
name
in
enumerate
(
function_names
,
start
=
1
)],
headers
=
headers
,
)
typer
.
echo
(
"Доступные функции для интегрирования:"
)
typer
.
echo
(
function_table
+
"
\n
"
)
def
main
()
->
None
:
typer
.
echo
(
"ЛР1: Система решения ОДУ"
)
typer
.
echo
(
"Работу выполнили: Величко А.А., Галкин И.Ю., Егоров С.А., Адаев Р.М. ИВТ 2 курс
\n
"
)
list_methods
()
list_functions
()
if
__name__
==
"__main__"
:
typer
.
run
(
main
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment