day1/cheatsheet6.tex
changeset 330 46533051b9d3
parent 328 4075482a9770
child 341 7ae88b9da553
equal deleted inserted replaced
329:0a6ab1d81491 330:46533051b9d3
    80 Out[95]: 1.5707963267948966
    80 Out[95]: 1.5707963267948966
    81 
    81 
    82 In [96]: expression(pi/3)
    82 In [96]: expression(pi/3)
    83 Out[96]: 0.90689968211710881
    83 Out[96]: 0.90689968211710881
    84 \end{lstlisting}
    84 \end{lstlisting}
    85 \subsection{Roots of non-linear eqations}
    85 \subsection{Roots of non-linear equations}
    86 For Finding the roots of a non linear equation(defined as $f(x)=0$), around a starting estimate we use \typ{fsolve}:\\
    86 For Finding the roots of a non linear equation(defined as $f(x)=0$), around a starting estimate we use \typ{fsolve}:\\
    87 \typ{In []: from scipy.optimize import fsolve}\\
    87 \typ{In []: from scipy.optimize import fsolve}\\
    88 \typ{fsolve} is not a part of \typ{pylab}, instead is a function in the \textbf{optimize} module of \textbf{scipy}, and hence we \textbf{import} it.\\
    88 \typ{fsolve} is not a part of \typ{pylab}, instead is a function in the \textbf{optimize} module of \textbf{scipy}, and hence we \textbf{import} it.\\
    89 %\typ{fsolve} takes first argument as name of function, which evaluates $f(x)$, whose roots one wants to find. And second argument is starting estimate, around which roots are found.
    89 %\typ{fsolve} takes first argument as name of function, which evaluates $f(x)$, whose roots one wants to find. And second argument is starting estimate, around which roots are found.
    90 For illustration, we want to find roots of equation:
    90 For illustration, we want to find roots of equation: