-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rmd
58 lines (47 loc) · 1.09 KB
/
main.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: "Contrôle Optimale"
author: "Rand ASSWAD<br>A l'attention de Mme. Rachida EL ASSOUDI"
lang: fr-FR
---
```{r setup, include=FALSE}
library(knitr)
# set directory
proj <- normalizePath('.')
opts_knit$set(root.dir = proj)
# set chunk options
opts_chunk$set(fig.pos = 'H')
opts_chunk$set(comment = NA)
opts_chunk$set(echo = FALSE)
opts_chunk$set(include = TRUE)
opts_chunk$set(eval = TRUE)
#opts_chunk$set(results = 'asis')
#opts_chunk$set(cache = TRUE)
# set reticulate options
venv <- paste(proj, "venv", sep="/")
library(reticulate)
use_virtualenv(venv, required = TRUE)
py_available(TRUE)
```
```{r child='include/math.tex'}
```
```{python}
from __future__ import division
import numpy as np
import sympy as sp
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib import rc
rcParams['savefig.transparent'] = True
rc('text', usetex=True)
from sympy import latex as tex
def mprint(expr):
print(f'$${tex(expr)}$$')
import warnings
warnings.filterwarnings('ignore')
```
```{r}
tex <- function(str) {
return(py$tex(str))
}
```