author | Shantanu <shantanu@fossee.in> |
Sat, 17 Apr 2010 12:50:42 +0530 | |
changeset 79 | 3893bac8e424 |
parent 2 | 008c0edc6eac |
child 81 | 2eff0ebac2dc |
permissions | -rw-r--r-- |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
1 |
* Solving Equations |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
2 |
*** Outline |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
3 |
***** Introduction |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
4 |
******* What are we going to do? |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
5 |
******* How are we going to do? |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
6 |
******* Arsenal Required |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
7 |
********* working knowledge of arrays |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
8 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
9 |
*** Script |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
10 |
Welcome. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
11 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
12 |
In this tutorial we shall look at solving linear equations, roots |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
13 |
of polynomials and other non-linear equations. In the process, we |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
14 |
shall look at defining functions. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
15 |
|
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
16 |
We would be using concepts related to arrays which we have covered |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
17 |
in previous session |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
18 |
|
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
19 |
Let's begin with solving linear equations. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
20 |
{show a slide of the equations} |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
21 |
We shall use the solve function, to solve this system of linear |
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
22 |
equations. Solve requires the coefficients and the constants to |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
23 |
be in the form of matrices to solve the system of linear equations. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
24 |
|
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
25 |
Lets start ipython -pylab interpreter. |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
26 |
Then we begin by entering the coefficients and the constants as |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
27 |
matrices. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
28 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
29 |
In []: A = array([[3,2,-1], |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
30 |
[2,-2,4], |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
31 |
[-1, 0.5, -1]]) |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
32 |
In []: b = array([1, -2, 0]) |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
33 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
34 |
Now, we can use the solve function to solve the given system. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
35 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
36 |
In []: x = solve(A, b) |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
37 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
38 |
Type x, to look at the solution obtained. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
39 |
|
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
40 |
Equation is of the form Ax = b, so we verify the solution by |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
41 |
obtaining a matrix product of A and x, and comparing it with b. |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
42 |
As we have covered earlier that we should use the dot function |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
43 |
here, and not the * operator. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
44 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
45 |
In []: Ax = dot(A, x) |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
46 |
In []: Ax |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
47 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
48 |
The result Ax, doesn't look exactly like b, but if you carefully |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
49 |
observe, you will see that it is the same as b. To save yourself |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
50 |
this trouble, you can use the allclose function. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
51 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
52 |
allclose checks if two matrices are close enough to each other |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
53 |
(with-in the specified tolerance level). Here we shall use the |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
54 |
default tolerance level of the function. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
55 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
56 |
In []: allclose(Ax, b) |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
57 |
The function returns True, which implies that the product of A & |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
58 |
x, and b are close enough. This validates our solution x. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
59 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
60 |
Let's move to finding the roots of polynomials. We shall use the |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
61 |
roots function to calculate the roots of the polynomial x^2-5x+6. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
62 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
63 |
The function requires an array of the coefficients of the |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
64 |
polynomial in the descending order of powers. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
65 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
66 |
In []: coeffs = [1, -5, 6] |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
67 |
In []: roots(coeffs) |
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
68 |
As you can see, roots returns the result in an array. |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
69 |
# It even works for polynomials with imaginary solutions. |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
70 |
# roots([1, 1, 1]) |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
71 |
|
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
72 |
To find the roots of non linear equations, we use the fsolve |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
73 |
function. We shall use the function sin(x)+cos^2(x) as our |
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
74 |
function, in this tutorial. This function is not part of pylab |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
75 |
package which we import during starting, so we will have to |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
76 |
import it. It is part of scipy package. |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
77 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
78 |
In []: from scipy.optimize import fsolve |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
79 |
|
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
80 |
Now, let's look at the documentation of fsolve using fsolve? |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
81 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
82 |
In []: fsolve? |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
83 |
|
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
84 |
As mentioned in docs the first argument, func, is a python |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
85 |
function that takes atleast one argument. So, we should now |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
86 |
define a python function for the given mathematical expression |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
87 |
sin(x)+cos^2(x). |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
88 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
89 |
The second argument, x0, is the initial estimate of the roots of |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
90 |
the function. Based on this initial guess, fsolve returns a root. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
91 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
92 |
Before, going ahead to get a root of the given expression, we |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
93 |
shall first learn how to define a function in python. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
94 |
Let's define a function called f, which returns values of the |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
95 |
given mathematical expression (sin(x)+cos^2(x)) for a each input. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
96 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
97 |
In []: def f(x): |
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
98 |
... return sin(x)+cos(x)*cos(x) |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
99 |
... |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
100 |
... |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
101 |
hit return thrice for coming out of function definition. |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
102 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
103 |
def, is a key word in python that tells the interpreter that a |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
104 |
function definition is beginning. f, here, is the name of the |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
105 |
function and x is the lone argument of the function. The whole |
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
106 |
definition of the function is done with in an indented block same |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
107 |
as for loops and conditional statements we have used in our |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
108 |
earlier sessions. Our function f has just one line in it's |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
109 |
definition. |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
110 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
111 |
You can test your function, by calling it with an argument for |
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
112 |
which the output value is known, say x = 0. We can see that |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
113 |
sin(x) + cos^2(x) has a value of 1, when x = 0. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
114 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
115 |
Let's check our function definition, by calling it with 0 as an |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
116 |
argument. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
117 |
In []: f(0) |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
118 |
We can see that the output is as expected. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
119 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
120 |
Now, that we have our function, we can use fsolve to obtain a root |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
121 |
of the expression sin(x)+cos^2(x). Recall that fsolve takes |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
122 |
another argument, the initial guess. Let's use 0 as our initial |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
123 |
guess. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
124 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
125 |
In []: fsolve(f, 0) |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
126 |
fsolve has returned a root of sin(x)+cos^2(x) that is close to 0. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
127 |
|
79
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
128 |
That brings us to the end of this tutorial. We have covered solution |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
129 |
of linear equations, finding roots of polynomials and other |
3893bac8e424
Added presentation for solving-equations.
Shantanu <shantanu@fossee.in>
parents:
2
diff
changeset
|
130 |
non-linear |
2
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
131 |
equations. We have also learnt how to define functions and call |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
132 |
them. |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
133 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
134 |
Thank you! |
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
135 |
|
008c0edc6eac
Added scripts for session-4 and session-6 of day-1.
Puneeth Chaganti <punchagan@gmail.com>
parents:
diff
changeset
|
136 |
*** Notes |