diff --git a/documentation/source/index.rst b/documentation/source/index.rst index d6a0bb7..0307234 100644 --- a/documentation/source/index.rst +++ b/documentation/source/index.rst @@ -21,7 +21,7 @@ Présentation Outil en ligne de commande pour générer puis compiler des fichiers latex. J'utilise ce programme essentiellement pour produire: - - Des DM aléatoirement avec quand c'est possible leur correction (utilise pyMath). En voici un exemple: :download:`sources <_downloads/tpl_DM.tex>` et :download:`pdf <_downloads/all_DM.pdf>` + - Des DM aléatoirement avec quand c'est possible leur correction (utilise Mapytex). En voici un exemple: :download:`sources <_downloads/tpl_DM.tex>` et :download:`pdf <_downloads/all_DM.pdf>` - Un bilan pour chaque élèves sur ce qu'il a réussi ou non. Voici un exemple: diff --git a/documentation/source/tutorial.rst b/documentation/source/tutorial.rst index bd741fd..ed5fba6 100644 --- a/documentation/source/tutorial.rst +++ b/documentation/source/tutorial.rst @@ -73,8 +73,8 @@ Quelques commandes supplémentaires Comme Opytex utilise le moteur de template Jinja2, la notion de filtre peut être utilisée. -Filtres qui marchenet bien avec pyMath --------------------------------------- +Filtres qui marchenet bien avec Mapytex +--------------------------------------- - "join": Mettre en forme un calcul sur une seule ligne diff --git a/example/1_corr_DM_0302.tex b/example/1_corr_DM_0302.tex deleted file mode 100644 index be24f8c..0000000 --- a/example/1_corr_DM_0302.tex +++ /dev/null @@ -1,308 +0,0 @@ -\documentclass[a4paper,10pt, table]{/media/documents/Cours/Prof/Enseignements/tools/style/classDS} -\usepackage{/media/documents/Cours/Prof/Enseignements/2014_2015} - -% Title Page -\titre{DM5} -% \seconde \premiereS \PSTMG \TSTMG -\classe{\premiereS} -\date{02 mars 2015} -%\duree{1 heure} -\sujet{1} -% DS DSCorr DM DMCorr Corr -\typedoc{DM} - -\printanswers - -\begin{document} - -\maketitle - -Le barème est donné à titre indicatif, il pourra être modifié. Vous rendrez le sujet avec la copie. - -\begin{questions} - - \question - Résoudre les équations suivantes - - - \begin{eqnarray*} - 6 x^{ 2 } + 7 x + 7 & > &0 \\ - \end{eqnarray*} - - \begin{solution} - On commence par calculer le discriminant de $P(x) = 6 x^{ 2 } + 7 x + 7$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Delta & = & 7^{ 2 } - 4 \times 6 \times 7 \\ -\Delta & = & 49 - 4 \times 42 \\ -\Delta & = & 49 - 168 \\ -\Delta & = & -119 - \end{eqnarray*} - - - Alors $\Delta = -119 < 0$ donc $P$ n'a pas de racine. - - - Comme $a = 6$, on en déduit le tableau de signe de $P$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, $P$/2}% - % {$-\infty$, $+\infty$} - % \tkzTabLine{, +,} - % \end{tikzpicture} - %\end{center} - On regarde maintenant où sont les $+$ dans le tableau de signe pour résoudre l'inéquation. - \end{solution} - - \begin{eqnarray*} - - 6 x^{ 2 } + 10 x + 1 & \leq &0 \\ - \end{eqnarray*} - \begin{solution} - On commence par calculer le discriminant de $Q(x) = - 6 x^{ 2 } + 10 x + 1$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Delta & = & 10^{ 2 } - 4 -6 \times 1 \\ -\Delta & = & 100 - 4 \times ( -6 ) \\ -\Delta & = & 100 - ( -24 ) \\ -\Delta & = & 124 - \end{eqnarray*} - - - comme $\Delta = 124 > 0$ donc $Q$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{10 - \sqrt{124}}{2 \times -6} = \frac{5}{6} + \frac{\sqrt{31}}{6} \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{10 + \sqrt{124}}{2 \times -6} = - \frac{\sqrt{31}}{6} + \frac{5}{6} - \end{eqnarray*} - - - - Comme $a = -6$, on en déduit le tableau de signe de $Q$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, $Q$/2}% - % {$-\infty$, - \frac{\sqrt{31}}{6} + \frac{5}{6} , \frac{5}{6} + \frac{\sqrt{31}}{6} , $+\infty$} - % \tkzTabLine{, -, z, +, z , -,} - % \end{tikzpicture} - %\end{center} - On regarde maintenant où sont les $-$ dans le tableau de signe pour résoudre l'inéquation. - \end{solution} - - \begin{eqnarray*} - 6 x^{ 2 } + 7 x + 7 & \geq & - 6 x^{ 2 } + 10 x + 1 - \end{eqnarray*} - - - - \begin{solution} - On commence par se ramener à une équation de la forme $ax^2 + bx + c \geq 0$. - \begin{eqnarray*} - 6 x^{ 2 } + 7 x + 7 \geq - 6 x^{ 2 } + 10 x + 1 & \Leftrightarrow & 6 x^{ 2 } + 7 x + 7 - (- 6 x^{ 2 } + 10 x + 1) \geq 0 \\ - & \Leftrightarrow & 6 x^{ 2 } + 7 x + 7 - ( - 6 x^{ 2 } + 10 x + 1 )\geq 0 \\ - & \Leftrightarrow & 6 x^{ 2 } + 7 x + 7 + 6 x^{ 2 } - 10 x - 1\geq 0 \\ - & \Leftrightarrow & ( 6 + 6 ) x^{ 2 } + ( 7 - 10 ) x + 7 - 1\geq 0 \\ - & \Leftrightarrow & 12 x^{ 2 } - 3 x + 6\geq 0 - \end{eqnarray*} - - - - Ensuite on étudie le signe de $R(X) = 12 x^{ 2 } - 3 x + 6$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Delta & = & -3^{ 2 } - 4 \times 12 \times 6 \\ -\Delta & = & 9 - 4 \times 72 \\ -\Delta & = & 9 - 288 \\ -\Delta & = & -279 - \end{eqnarray*} - - - Alors $\Delta = -279 < 0$ donc $R$ n'a pas de racine. - - - Comme $a = 12$, on en déduit le tableau de signe de $R$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, $R$/2}% - % {$-\infty$, $+\infty$} - % \tkzTabLine{, +,} - % \end{tikzpicture} - %\end{center} - On regarde maintenant où sont les $+$ dans le tableau de signe pour résoudre l'inéquation. - - - \end{solution} - - - \question - Tracer le tableau de variation des fonctions suivantes \textit{(Vous pouvez utiliser les nombres à virgules)} - - - \begin{parts} - \part $f:x\mapsto - 2 x^{ 3 } - 4 x^{ 2 } + x + 8$ - \begin{solution} - Pour avoir les variations de $f$, il faut connaître le signe de sa dérivé. On dérive $P$ - - \begin{eqnarray*} - f'(x) & = & 3 \times ( -2 ) x^{ 2 } + 2 \times ( -4 ) x + 1 \times 1 \\ -f'(x) & = & - 6 x^{ 2 } - 8 x + 1 - \end{eqnarray*} - - On étudie le signe de $P'$ - - Ensuite on étudie le signe de $f'(x) = - 6 x^{ 2 } - 8 x + 1$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Delta & = & -8^{ 2 } - 4 -6 \times 1 \\ -\Delta & = & 64 - 4 \times ( -6 ) \\ -\Delta & = & 64 - ( -24 ) \\ -\Delta & = & 88 - \end{eqnarray*} - - - comme $\Delta = 88 > 0$ donc $f'$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{-8 - \sqrt{88}}{2 \times -6} = - \frac{2}{3} + \frac{\sqrt{22}}{6} \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{-8 + \sqrt{88}}{2 \times -6} = - \frac{\sqrt{22}}{6} - \frac{2}{3} - \end{eqnarray*} - - - - Comme $a = -6$, on en déduit le tableau de signe de $f'$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, Signe de $f' $/2}% - % {$-\infty$, - \frac{2}{3} + \frac{\sqrt{22}}{6} , - \frac{\sqrt{22}}{6} - \frac{2}{3} , $+\infty$} - % \tkzTabLine{, -, z, +, z , -,} - % \end{tikzpicture} - %\end{center} - - \end{solution} - - - - \part $g:x\mapsto - 10 x^{ 3 } - 6 x^{ 2 } + 8 x + 7$ - - \begin{solution} - Pour avoir les variations de $g$, il faut connaître le signe de sa dérivé. On dérive $P$ - - \begin{eqnarray*} - g'(x) & = & 3 \times ( -10 ) x^{ 2 } + 2 \times ( -6 ) x + 1 \times 8 \\ -g'(x) & = & - 30 x^{ 2 } - 12 x + 8 - \end{eqnarray*} - - On étudie le signe de $P'$ - - Ensuite on étudie le signe de $g'(x) = - 30 x^{ 2 } - 12 x + 8$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Delta & = & -12^{ 2 } - 4 -30 \times 8 \\ -\Delta & = & 144 - 4 \times ( -240 ) \\ -\Delta & = & 144 - ( -960 ) \\ -\Delta & = & 1104 - \end{eqnarray*} - - - comme $\Delta = 1104 > 0$ donc $g'$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{-12 - \sqrt{1104}}{2 \times -30} = - \frac{1}{5} + \frac{\sqrt{69}}{15} \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{-12 + \sqrt{1104}}{2 \times -30} = - \frac{\sqrt{69}}{15} - \frac{1}{5} - \end{eqnarray*} - - - - Comme $a = -30$, on en déduit le tableau de signe de $g'$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, Signe de $g' $/2}% - % {$-\infty$, - \frac{1}{5} + \frac{\sqrt{69}}{15} , - \frac{\sqrt{69}}{15} - \frac{1}{5} , $+\infty$} - % \tkzTabLine{, -, z, +, z , -,} - % \end{tikzpicture} - %\end{center} - - \end{solution} - - - \part $h:x\mapsto - 7 x^{ 2 } - 5 x - 5 - f(x)$ - - - - - \begin{solution} - On commence par simplifier l'expression de $h$ - \begin{eqnarray*} - h(x) & = & - 7 x^{ 2 } - 5 x - 5 - f(x) \\ - h(x) & = & - 7 x^{ 2 } - 5 x - 5 - ( - 2 x^{ 3 } - 4 x^{ 2 } + x + 8 ) \\ -h(x) & = & - 7 x^{ 2 } - 5 x - 5 + 2 x^{ 3 } + 4 x^{ 2 } - x - 8 \\ -h(x) & = & 2 x^{ 3 } + ( -7 + 4 ) x^{ 2 } + ( -5 - 1 ) x - 5 - 8 \\ -h(x) & = & 2 x^{ 3 } - 3 x^{ 2 } - 6 x - 13 - \end{eqnarray*} - - - Pour avoir les variations de $h$, il faut connaître le signe de sa dérivé. On dérive $P$ - - \begin{eqnarray*} - h'(x) & = & 3 \times 2 x^{ 2 } + 2 \times ( -3 ) x + 1 \times ( -6 ) \\ -h'(x) & = & 6 x^{ 2 } - 6 x - 6 - \end{eqnarray*} - - On étudie le signe de $P'$ - - Ensuite on étudie le signe de $h'(x) = 6 x^{ 2 } - 6 x - 6$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Delta & = & -6^{ 2 } - 4 \times 6 \times ( -6 ) \\ -\Delta & = & 36 - 4 \times ( -36 ) \\ -\Delta & = & 36 - ( -144 ) \\ -\Delta & = & 180 - \end{eqnarray*} - - - comme $\Delta = 180 > 0$ donc $h'$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{-6 - \sqrt{180}}{2 \times 6} = - \frac{\sqrt{5}}{2} + \frac{1}{2} \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{-6 + \sqrt{180}}{2 \times 6} = \frac{1}{2} + \frac{\sqrt{5}}{2} - \end{eqnarray*} - - - - Comme $a = 6$, on en déduit le tableau de signe de $h'$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, Signe de $h' $/2}% - % {$-\infty$, - \frac{\sqrt{5}}{2} + \frac{1}{2} , \frac{1}{2} + \frac{\sqrt{5}}{2} , $+\infty$} - % \tkzTabLine{, +, z, -, z , +,} - % \end{tikzpicture} - %\end{center} - - \end{solution} - \end{parts} - - \question - Appliquer l'algorithme de tri vu en cours à la suite suivante - \begin{center} - \begin{tabular}{|*{6}{c|}} - \hline - 6914 & 6851 & 6532 & 6884 & 6164 & 6495 \\ - \hline - \end{tabular} - - \end{center} - - -\end{questions} - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "master" -%%% End: diff --git a/example/all_2ndDeg.pdf b/example/all_2ndDeg.pdf deleted file mode 100644 index c97ad52..0000000 Binary files a/example/all_2ndDeg.pdf and /dev/null differ diff --git a/example/all_corr_DM_0302.pdf b/example/all_corr_DM_0302.pdf deleted file mode 100644 index 01cb989..0000000 Binary files a/example/all_corr_DM_0302.pdf and /dev/null differ diff --git a/example/all_example.pdf b/example/all_example.pdf deleted file mode 100644 index a0c6f71..0000000 Binary files a/example/all_example.pdf and /dev/null differ diff --git a/example/poly.tex b/example/poly.tex deleted file mode 100644 index d6c4546..0000000 --- a/example/poly.tex +++ /dev/null @@ -1,23 +0,0 @@ - -\Block{set A = Expression.random("{a} / 2 + 2")} -\Block{set P = Polynom.random(["{b}","{a}"])} -\Block{set Q = Polynom.random(["{b+2}","{a}"])} -\Block{set R = P('x')*Q('x') } - -\Block{set exps = [A, P, Q, R]} -\Block{set names = ["A", "B", "C", "D"]} - - Développer et réduire les expressions suivantes: - \begin{eqnarray*} - \Block{for i in range(4)} - \Var{ names[i]} &=& \Var{exps[i]} \\ - \Block{endfor} - \end{eqnarray*} - - Solutions: - \Var{A.simplify() | calculus} - \Var{P(2).simplify() | calculus(name = "P(2)")} - \Var{Q(2).simplify() | calculus(name = "Q(2)")} - \Var{(P+Q) | calculus(name = "P(x) + Q(X)")} - \Var{(P('x')+Q('x')).simplify() | calculus(name = "P(x) + Q(X)")} - \Var{R.simplify() | calculus(name = "R(x)")} diff --git a/example/tpl_2ndDeg.tex b/example/tpl_2ndDeg.tex deleted file mode 100644 index fc31cea..0000000 --- a/example/tpl_2ndDeg.tex +++ /dev/null @@ -1,69 +0,0 @@ -\documentclass[a4paper,10pt]{article} -\RequirePackage[utf8x]{inputenc} -\RequirePackage[francais]{babel} -\RequirePackage{amssymb} -\RequirePackage{amsmath} -\RequirePackage{amsfonts} -\RequirePackage{subfig} -\RequirePackage{graphicx} -\RequirePackage{color} - -\Block{from "macros/poly2Deg.tex" import solveEquation} - -% Title Page -\title{Calcul littéral et statistiques} -\date{\today} - -\begin{document} -\maketitle - - -\section{Polynômes} - - - - \Block{set P = Polynom_deg2.random(["{a}", "{b}", "{c}"], ["{b}**2 - 4*{a}*{c} == 0"])} - Résoudre l'équation suivante - \begin{eqnarray*} - \Var{P} & = & 0 - \end{eqnarray*} - - Solution: - - \Var{solveEquation(P)} - - \bigskip - ~\dotfill - \bigskip - - - \Block{set P = Polynom_deg2.random(["{a}", "{b}", "{c}"])} - \Block{set Q = Polynom_deg2.random(["{a}", "{b}", "{c}"])} - Résoudre l'équation suivante - \begin{eqnarray*} - \Var{P} & = & \Var{Q} - \end{eqnarray*} - - Solution: - - On commence par se ramener à une équation de la forme $ax^2+bx+c = 0$. - - \Block{set R = P - Q} - - \begin{align*} - & & \Var{P} = \Var{Q} \\ - \Var{R.explain() | calculus(name = "", sep = "\\Leftrightarrow", end = "= 0")} - \end{align*} - - On cherche maintenant à résoudre l'équation $\Var{R} = 0$. - - \Var{solveEquation(R)} - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "master" -%%% End: - - diff --git a/example/tpl_corr_DM_0302.tex b/example/tpl_corr_DM_0302.tex deleted file mode 100644 index b557ba5..0000000 --- a/example/tpl_corr_DM_0302.tex +++ /dev/null @@ -1,359 +0,0 @@ -\documentclass[a4paper,10pt, table]{/media/documents/Cours/Prof/Enseignements/tools/style/classDS} -\usepackage{/media/documents/Cours/Prof/Enseignements/2014_2015} - -% Title Page -\titre{DM5} -% \seconde \premiereS \PSTMG \TSTMG -\classe{\premiereS} -\date{02 mars 2015} -%\duree{1 heure} -\sujet{\Var{infos.num}} -% DS DSCorr DM DMCorr Corr -\typedoc{DM} - -\printanswers - -\begin{document} - -\maketitle - -Le barème est donné à titre indicatif, il pourra être modifié. Vous rendrez le sujet avec la copie. - -\begin{questions} - - \question - Résoudre les équations suivantes - \Block{set P = Polynom_deg2.random(["{a}", "{b}", "{c}"], name = 'P')} - \Block{set Q = Polynom_deg2.random(["{a}", "{b}", "{c}"], name = 'Q')} - \begin{eqnarray*} - \Var{P} & > &0 \\ - \end{eqnarray*} - - \begin{solution} - On commence par calculer le discriminant de $\Var{P.name}(x) = \Var{P}$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{P.delta.explain()|calculus(name="\\Delta")} - \end{eqnarray*} - - \Block{if P.delta > 0} - comme $\Delta = \Var{P.delta} > 0$ donc $\Var{P.name}$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-P.b} - \sqrt{\Var{P.delta}}}{2 \times \Var{P.a}} = \Var{P.roots()[0] } \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-P.b} + \sqrt{\Var{P.delta}}}{2 \times \Var{P.a}} = \Var{P.roots()[1] } - \end{eqnarray*} - - - \Block{elif P.delta == 0} - Comme $\Delta = 0$ donc $\Var{P.name}$ a deux racines - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{P.roots()[0]} \\ - \end{eqnarray*} - - - \Block{else} - Alors $\Delta = \Var{P.delta} < 0$ donc $\Var{P.name}$ n'a pas de racine. - - \Block{endif} - Comme $a = \Var{P.a}$, on en déduit le tableau de signe de $\Var{P.name}$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, $P$/2}% - % \Var{P.tbl_sgn_header()} - % \Var{P.tbl_sgn()} - % \end{tikzpicture} - %\end{center} - On regarde maintenant où sont les $+$ dans le tableau de signe pour résoudre l'inéquation. - \end{solution} - - \begin{eqnarray*} - \Var{Q} & \leq &0 \\ - \end{eqnarray*} - \begin{solution} - On commence par calculer le discriminant de $Q(x) = \Var{Q}$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{Q.delta.explain()|calculus(name="\\Delta")} - \end{eqnarray*} - - \Block{if Q.delta > 0} - comme $\Delta = \Var{Q.delta} > 0$ donc $Q$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-Q.b} - \sqrt{\Var{Q.delta}}}{2 \times \Var{Q.a}} = \Var{Q.roots()[0] } \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-Q.b} + \sqrt{\Var{Q.delta}}}{2 \times \Var{Q.a}} = \Var{Q.roots()[1] } - \end{eqnarray*} - - - \Block{elif Q.delta == 0} - Comme $\Delta = 0$ donc $Q$ a une racine - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{Q.roots()[0]} \\ - \end{eqnarray*} - - \Block{else} - Alors $\Delta = \Var{Q.delta} < 0$ donc $Q$ n'a pas de racine. - - \Block{endif} - Comme $a = \Var{Q.a}$, on en déduit le tableau de signe de $Q$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, $Q$/2}% - % \Var{Q.tbl_sgn_header()} - % \Var{Q.tbl_sgn()} - % \end{tikzpicture} - %\end{center} - On regarde maintenant où sont les $-$ dans le tableau de signe pour résoudre l'inéquation. - \end{solution} - - \begin{eqnarray*} - \Var{P} & \geq & \Var{Q} - \end{eqnarray*} - - \Block{set R = P-Q} - - \begin{solution} - On commence par se ramener à une équation de la forme $ax^2 + bx + c \geq 0$. - \begin{eqnarray*} - \Var{P} \geq \Var{Q} & \Leftrightarrow & \Var{P} - (\Var{Q}) \geq 0 \\ - \Var{R.explain() | calculus(name = "", sep = "\\Leftrightarrow", end = "\\geq 0")} - \end{eqnarray*} - - \Block{set R = Polynom_deg2(R._coef)} - - Ensuite on étudie le signe de $R(X) = \Var{R}$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{R.delta.explain()|calculus(name="\\Delta")} - \end{eqnarray*} - - \Block{if R.delta > 0} - comme $\Delta = \Var{R.delta} > 0$ donc $R$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-R.b} - \sqrt{\Var{R.delta}}}{2 \times \Var{R.a}} = \Var{R.roots()[0] } \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-R.b} + \sqrt{\Var{R.delta}}}{2 \times \Var{R.a}} = \Var{R.roots()[1] } - \end{eqnarray*} - - - \Block{elif R.delta == 0} - Comme $\Delta = 0$ donc $R$ a une racine - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{R.roots()[0]} \\ - \end{eqnarray*} - - - \Block{else} - Alors $\Delta = \Var{R.delta} < 0$ donc $R$ n'a pas de racine. - - \Block{endif} - Comme $a = \Var{R.a}$, on en déduit le tableau de signe de $R$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, $R$/2}% - % \Var{R.tbl_sgn_header()} - % \Var{R.tbl_sgn()} - % \end{tikzpicture} - %\end{center} - On regarde maintenant où sont les $+$ dans le tableau de signe pour résoudre l'inéquation. - - - \end{solution} - - - \question - Tracer le tableau de variation des fonctions suivantes \textit{(Vous pouvez utiliser les nombres à virgules)} - \Block{set f = Polynom.random(["{a}", "{b}", "{c}", "{d}"], name = 'f')} - \Block{set P = f} - \begin{parts} - \part $f:x\mapsto \Var{P}$ - \begin{solution} - Pour avoir les variations de $\Var{P.name}$, il faut connaître le signe de sa dérivé. On dérive $P$ - \Block{set P1 = P.derivate()} - \begin{eqnarray*} - \Var{P1.explain() | calculus(name = P1.name + "(x)", sep = "=", end = "")} - \end{eqnarray*} - \Block{set P1 = Polynom_deg2(P1._coef, name = P1.name)} - On étudie le signe de $P'$ - - Ensuite on étudie le signe de $\Var{P1.name}(x) = \Var{P1}$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{P1.delta.explain()|calculus(name="\\Delta")} - \end{eqnarray*} - - \Block{if P1.delta > 0} - comme $\Delta = \Var{P1.delta} > 0$ donc $\Var{P1.name}$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-P1.b} - \sqrt{\Var{P1.delta}}}{2 \times \Var{P1.a}} = \Var{P1.roots()[0] } \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-P1.b} + \sqrt{\Var{P1.delta}}}{2 \times \Var{P1.a}} = \Var{P1.roots()[1] } - \end{eqnarray*} - - - \Block{elif P1.delta == 0} - Comme $\Delta = 0$ donc $\Var{P1.name}$ a une racine - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{P1.roots()[0]} \\ - \end{eqnarray*} - - - \Block{else} - Alors $\Delta = \Var{P1.delta} < 0$ donc $\Var{P1.name}$ n'a pas de racine. - - \Block{endif} - Comme $a = \Var{P1.a}$, on en déduit le tableau de signe de $\Var{P1.name}$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, Signe de $\Var{P1.name} $/2}% - % \Var{P1.tbl_sgn_header()} - % \Var{P1.tbl_sgn()} - % \end{tikzpicture} - %\end{center} - - \end{solution} - - \Block{set g = Polynom.random(["{a}", "{b}", "{c}", "{d}"], name = 'g')} - \Block{set P = g} - \part $g:x\mapsto \Var{P}$ - - \begin{solution} - Pour avoir les variations de $\Var{P.name}$, il faut connaître le signe de sa dérivé. On dérive $P$ - \Block{set P1 = P.derivate()} - \begin{eqnarray*} - \Var{P1.explain() | calculus(name = P1.name + "(x)", sep = "=", end = "")} - \end{eqnarray*} - \Block{set P1 = Polynom_deg2(P1._coef, name = P1.name)} - On étudie le signe de $P'$ - - Ensuite on étudie le signe de $\Var{P1.name}(x) = \Var{P1}$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{P1.delta.explain()|calculus(name="\\Delta")} - \end{eqnarray*} - - \Block{if P1.delta > 0} - comme $\Delta = \Var{P1.delta} > 0$ donc $\Var{P1.name}$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-P1.b} - \sqrt{\Var{P1.delta}}}{2 \times \Var{P1.a}} = \Var{P1.roots()[0] } \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-P1.b} + \sqrt{\Var{P1.delta}}}{2 \times \Var{P1.a}} = \Var{P1.roots()[1] } - \end{eqnarray*} - - - \Block{elif P1.delta == 0} - Comme $\Delta = 0$ donc $\Var{P1.name}$ a une racine - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{P1.roots()[0]} \\ - \end{eqnarray*} - - - \Block{else} - Alors $\Delta = \Var{P1.delta} < 0$ donc $\Var{P1.name}$ n'a pas de racine. - - \Block{endif} - Comme $a = \Var{P1.a}$, on en déduit le tableau de signe de $\Var{P1.name}$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, Signe de $\Var{P1.name} $/2}% - % \Var{P1.tbl_sgn_header()} - % \Var{P1.tbl_sgn()} - % \end{tikzpicture} - %\end{center} - - \end{solution} - - \Block{set R = Polynom.random(["{a}", "{b}", "{c}"])} - \part $h:x\mapsto \Var{R} - f(x)$ - - \Block{set h = R - f} - \Block{do h.give_name('h')} - - \begin{solution} - On commence par simplifier l'expression de $h$ - \begin{eqnarray*} - h(x) & = & \Var{R} - f(x) \\ - \Var{h.explain() | calculus(name = h.name + "(x)", sep = "=", end = "")} - \end{eqnarray*} - - \Block{set P = h} - Pour avoir les variations de $\Var{P.name}$, il faut connaître le signe de sa dérivé. On dérive $P$ - \Block{set P1 = P.derivate()} - \begin{eqnarray*} - \Var{P1.explain() | calculus(name = P1.name + "(x)", sep = "=", end = "")} - \end{eqnarray*} - \Block{set P1 = Polynom_deg2(P1._coef, name = P1.name)} - On étudie le signe de $P'$ - - Ensuite on étudie le signe de $\Var{P1.name}(x) = \Var{P1}$. - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{P1.delta.explain()|calculus(name="\\Delta")} - \end{eqnarray*} - - \Block{if P1.delta > 0} - comme $\Delta = \Var{P1.delta} > 0$ donc $\Var{P1.name}$ a deux racines - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-P1.b} - \sqrt{\Var{P1.delta}}}{2 \times \Var{P1.a}} = \Var{P1.roots()[0] } \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-P1.b} + \sqrt{\Var{P1.delta}}}{2 \times \Var{P1.a}} = \Var{P1.roots()[1] } - \end{eqnarray*} - - - \Block{elif P1.delta == 0} - Comme $\Delta = 0$ donc $\Var{P1.name}$ a une racine - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{P1.roots()[0]} \\ - \end{eqnarray*} - - - \Block{else} - Alors $\Delta = \Var{P1.delta} < 0$ donc $\Var{P1.name}$ n'a pas de racine. - - \Block{endif} - Comme $a = \Var{P1.a}$, on en déduit le tableau de signe de $\Var{P1.name}$ - %\begin{center} - % \begin{tikzpicture} - % \tkzTabInit[espcl=2]% - % {$x$/1, Signe de $\Var{P1.name} $/2}% - % \Var{P1.tbl_sgn_header()} - % \Var{P1.tbl_sgn()} - % \end{tikzpicture} - %\end{center} - - \end{solution} - \end{parts} - - \question - Appliquer l'algorithme de tri vu en cours à la suite suivante - \begin{center} - \begin{tabular}{|*{6}{c|}} - \hline - 6914 & 6851 & 6532 & 6884 & 6164 & 6495 \\ - \hline - \end{tabular} - - \end{center} - - -\end{questions} - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "master" -%%% End: - diff --git a/example/tpl_example.pdf b/example/tpl_example.pdf deleted file mode 100644 index 49876de..0000000 Binary files a/example/tpl_example.pdf and /dev/null differ diff --git a/example/tpl_example.tex b/example/tpl_example.tex deleted file mode 100644 index c14266d..0000000 --- a/example/tpl_example.tex +++ /dev/null @@ -1,221 +0,0 @@ -\documentclass[a4paper,10pt]{article} -<<<<<<< HEAD -\usepackage[utf8x]{inputenc} -\usepackage[francais]{babel} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{amsfonts} - -% Title Page -\title{Jouons avec DS\_géné et pyMath} -% \quatreC \quatreD \troisB \troisPro -\date{} - -======= -\RequirePackage[utf8x]{inputenc} -\RequirePackage[francais]{babel} -\RequirePackage{amssymb} -\RequirePackage{amsmath} -\RequirePackage{amsfonts} -\RequirePackage{subfig} -\RequirePackage{graphicx} -\RequirePackage{color} - -% Title Page -\title{Calcul littéral et statistiques} -\date{\today} ->>>>>>> origin/dev - -\begin{document} -\maketitle - -<<<<<<< HEAD -<<<<<<< HEAD -\section{Exercice de simplification de fraction} - \Block{do RdExpression.set_form("exp")} - \Block{set A = RdExpression("{a}/2+2")()} - \Block{set B = RdExpression("{a}/2+2")()} - Développer et réduire les expressions suivantes: - - \begin{equation*} - A = \Var{ A } \qquad - B = \Var{ B } - \end{equation*} - - Solutions: - \Var{A.simplify() | calculus} - \Var{B.simplify() | calculus(name = "B")} - -\section{Mettre sous forme canonique} - \Block{set P = RdExpression("{a}x^2 + {b}x + {c}")()} - Mettre $\Var{P}$ sous la forme canonique. - - Solution: - - On simplifie le polynôme: - \begin{eqnarray*} - \Var{P.simplify() | calculus(name = "P(x) = ")} - \end{eqnarray*} - - - Calcul des coordonnées du sommet de la courbe: - \begin{eqnarray*} - \alpha & = & \frac{-b}{2a} = \\ - \beta & = & -\frac{b^2 - 4ac}{4a} = - \end{eqnarray*} - -======= -\Calc -Le barème est donné à titre indicatif, il pourra être modifié. - -\begin{Exo}[4.5] - \Block{set A = Expression.random("{a} / 2 + 2")} - \Block{set P = Polynom.random(["{b}","{a}"])} - \Block{set Q = Polynom.random(["{b+2}","{a}"])} - \Block{set R = P('x')*Q('x') } - Développer et réduire les expressions suivantes: - \begin{eqnarray*} - A &=& \Var{ A } \\ - P(x) &=& \Var{ P } \\ - Q(x) &=& \Var{ Q }\\ - R(x) &=& \Var{R} - \end{eqnarray*} - - Solutions: - \Var{A.simplify() | calculus} - \Var{P(2).simplify() | calculus(name = "P(2)")} - \Var{Q(2).simplify() | calculus(name = "Q(2)")} - \Var{(P+Q) | calculus(name = "P(x) + Q(X)")} - \Var{(P('x')+Q('x')).simplify() | calculus(name = "P(x) + Q(X)")} - \Var{R.simplify() | calculus(name = "R(x)")} - -\end{Exo} - -\begin{Exo} - \Block{set P = Polynom.random(["{a}", "{b}", "{c}"])} -======= - -\section{Polynômes} - - -\Block{set P = Polynom.random(["{a}", "{b}", "{c}"], ["{b}**2 - 4*{a}*{c} == 0"])} ->>>>>>> origin/dev - Résoudre l'équation suivante - \begin{eqnarray*} - \Var{P} & = & 0 - \end{eqnarray*} - - Solution: - - On commence par calculer le discriminant - \Block{set Delta = Expression("{b}^2 - 4*{a}*{c}".format(a = P._coef[2], b = P._coef[1], c = P._coef[0]))} - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{Delta.simplify()|calculus(name="\\Delta")} - \end{eqnarray*} - \Block{set Delta = Delta.simplified()} - - \Block{if Delta > 0} - Alors $\Delta = \Var{Delta} > 0$ donc il y a deux solutions - - \Block{set x1 = (-P._coef[1] - sqrt(Delta))/(2*P._coef[2])} - \Block{set x2 = (-P._coef[1] + sqrt(Delta))/(2*P._coef[2])} - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-P._coef[1]} - \sqrt{\Var{Delta}}}{2 \times \Var{P._coef[2]}} = \Var{x1 | round(2)} \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-P._coef[1]} + \sqrt{\Var{Delta}}}{2 \times \Var{P._coef[2]}} = \Var{x2 | round(2)} - \end{eqnarray*} - - Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1|round(2)}; \Var{x2|round(2)} \right\}$ - - \Block{elif Delta == 0} - Alors $\Delta = \Var{Delta} = 0$ donc il y a une solution - - \Block{set x1 = Expression("-{b}/(2*{a})".format(b = P._coef[1], a = P._coef[2]))} - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{" = ".join(x1.simplify())} - \end{eqnarray*} - - Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1.simplified()}\right\}$ - - \Block{else} - Alors $\Delta = \Var{Delta} < 0$ donc il n'y a pas de solution. - - \Block{endif} - - \bigskip - ~\dotfill - \bigskip - - - \Block{set P = Polynom.random(["{a}", "{b}", "{c}"])} - \Block{set Q = Polynom.random(["{a}", "{b}", "{c}"])} - Résoudre l'équation suivante - \begin{eqnarray*} - \Var{P} & = & \Var{Q} - \end{eqnarray*} - - Solution: - - On commence par se ramener à une équation de la forme $ax^2+bx+c = 0$. - - \begin{eqnarray*} - \Var{P} = \Var{Q} & \Leftrightarrow & \Var{P} - (\Var{Q}) = 0 \\ - \Var{(P - Q)|calculus(name = "", sep = "\\Leftrightarrow", end = "= 0")} - \end{eqnarray*} - - \Block{set R = (P-Q)[-1]} - On cherche maintenant à résoudre l'équation $\Var{R} = 0$. - -<<<<<<< HEAD -\end{Exo} ->>>>>>> origin/dev -======= - On commence par calculer le discriminant - \Block{set Delta = Expression("{b}^2 - 4*{a}*{c}".format(a = R._coef[2], b = R._coef[1], c = R._coef[0]))} - \begin{eqnarray*} - \Delta & = & b^2-4ac \\ - \Var{Delta.simplify()|calculus(name="\\Delta")} - \end{eqnarray*} - \Block{set Delta = Delta.simplified()} - - \Block{if Delta > 0} - Alors $\Delta = \Var{Delta} > 0$ donc il y a deux solutions - - \Block{set x1 = (-R._coef[1] - sqrt(Delta))/(2*R._coef[2])} - \Block{set x2 = (-R._coef[1] + sqrt(Delta))/(2*R._coef[2])} - - \begin{eqnarray*} - x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-R._coef[1]} - \sqrt{\Var{Delta}}}{2 \times \Var{R._coef[2]}} = \Var{x1 | round(2)} \\ - x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-R._coef[1]} + \sqrt{\Var{Delta}}}{2 \times \Var{R._coef[2]}} = \Var{x2 | round(2)} - \end{eqnarray*} - - Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1|round(2)}; \Var{x2|round(2)} \right\}$ - - \Block{elif Delta == 0} - Alors $\Delta = \Var{Delta} = 0$ donc il y a une solution - - \Block{set x1 = Expression("-{b}/(2*{a})".format(b = R._coef[1], a = R._coef[2]))} - - \begin{eqnarray*} - x_1 = \frac{-b}{2a} = \Var{" = ".join(x1.simplify())} - \end{eqnarray*} - - Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1.simplified()}\right\}$ - - \Block{else} - Alors $\Delta = \Var{Delta} < 0$ donc il n'y a pas de solution. - - \Block{endif} ->>>>>>> origin/dev - - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "master" -%%% End: - - diff --git a/example/tpl_play.tex b/example/tpl_play.tex deleted file mode 100644 index fc76474..0000000 --- a/example/tpl_play.tex +++ /dev/null @@ -1,32 +0,0 @@ -\documentclass[a4paper,10pt]{article} -\RequirePackage[utf8x]{inputenc} -\RequirePackage[francais]{babel} -\RequirePackage{amssymb} -\RequirePackage{amsmath} -\RequirePackage{amsfonts} -\RequirePackage{subfig} -\RequirePackage{graphicx} -\RequirePackage{color} - -% Title Page -\title{Calcul littéral et statistiques} -\date{\today} - -\begin{document} -\maketitle - -\Block{set L = [1, 4, 5, 6]} - -\Block{for i in L | shuffle} - \Var{i} - -\Block{endfor} - - - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "master" -%%% End: diff --git a/setup.py b/setup.py index 15fe3af..b539dfb 100644 --- a/setup.py +++ b/setup.py @@ -13,11 +13,11 @@ setup( install_requires=[ 'jinja2', 'path.py', - 'pyMath', - ], - dependency_links=[ - "git+http://git.poneyworld.net/pyMath/#egg=pyMath", + #'Mapytex', ], + # dependency_links=[ + # "git+http://git.poneyworld.net/pyMath/#egg=pyMath", + # ], entry_points={ "console_scripts": ['bopytex= bopytex.bopytex:main'] },