0% found this document useful (0 votes)
6 views22 pages

Numerical Method Using Wolfarm Mathematica

The document discusses solving systems of equations using different numerical methods like bisection, secant, regula falsi, and Newton Raphson. It involves finding the roots of functions and their graphs in given intervals with a specified tolerance. Systems of equations are also solved using Gauss elimination and Gauss Jordan methods.

Uploaded by

abhipaswan1711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views22 pages

Numerical Method Using Wolfarm Mathematica

The document discusses solving systems of equations using different numerical methods like bisection, secant, regula falsi, and Newton Raphson. It involves finding the roots of functions and their graphs in given intervals with a specified tolerance. Systems of equations are also solved using Gauss elimination and Gauss Jordan methods.

Uploaded by

abhipaswan1711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Name – Abhay Kumar

Roll No – 21/631

Prac cal 01

1.Find the root of the func on f(x) = x^3 + 2x^2 − 3x − 1 using the Bisec on Method with e =
10^(−5).Also, plot the graph of the func on.

s1[x_]:=x^3+2 x^2-3 x-1

Print["s1[x]=", s1[x]]

Bisec on[1, 2, 10^(-5), 20]

Plot[s1[x], {x, 1, 2}]


2. Find the root of the func on f(x) = e^x + x^2 − x − 4 using the Bisec on Method with e =
10^(−6) in the interval [−2, 2]. Also, plot the graph of the func on.

s2[x_]:=Exp[x]+x^2-x-4

Print["s2[x]=",s2[x]]

Bisec on[-2,2,10^(-6),20]

Plot[s2[x],{x,-2,2}]
3. Find the root of the func on f(x) = x^3 – x^2 − 10x + 7 using the Bisec on Method with e =
10^(−6)in the interval [−4, 4]. Also, plot the graph of the func on.

s3[x_]:=x^3-x^2-10x+7

Print["s3[x]=",s3[x]]

Bisec on[-4,4,10^(-6),20]

Plot[s3[x],{x,-4,4}]
4. Find the root of the func on f(x) = 1.05−1.04x+ln(x) using the Bisec on Method with e = 10−6

in the interval [0, 2]. Also, plot the graph of the func on.

s4[x_]:=1.05-1.04x+Log[x]

Print["s4[x]=",s4[x]]

Bisec on[0,2,10^(-6),20]

Plot[s4[x],{x,0,2}]
Name – Abhay Kumar

Roll No – 21/631

Prac cal 02

1. Find the root of the func on f(x) = x^3 + 2x^2 − 3x − 1 using the Secant Method with e = 10^(−5)

In the interval [0, 1]. Also, plot the graph of the func on.

f1[x_] := x^3+2 x^2-3 x-1

Secant[1, 2, 10^(-5), 50]

Plot[f1[x], {x, 1, 2}]


2. Find the root of the func on f(x) = log(1 + x) − cos(x) using the Secant Method with e = 10^(−5)

In the interval [0, 1].

f2[x_]:=Log[1+x]-Cos[x]

Secant[1,2,10^(-5),50]

Plot[f2[x],{x,1,2}]
3. Find the root of the func on f(x) = x^3-x^2 + x-1using the Secant Method withe = 10^(-5) in the interval [0,2]

f3[x_]:=x^3-x^2+x-1

Secant[0,2,10^(-5),50]

Plot[f3[x],{x,0,2}]
4. Find the root of the func on f(x) = e^x + x^2- x- 4 using the Regula-Falsi Method with e =10^(-5) in the interval [1, 2].
Also, plot the graph of the func on.

g1[x_] := Exp[x] +x^2-x- 4

Print["g1(x) =", g1[x]];

FalsePosi on[1, 2, 10^(-5), 50]

Plot[g1[x], {x, 1, 2}]


5. Find the root of the func on f(x) = x^3-x^2-10x+ 7 using the Regula-Falsi Method withe = 10^(5) .Also, plot the graph of
the func on.

g2[x_] := x^3-x^2-10x+7

Print["g2(x) =",g2[x]];

FalsePosi on[1,2,10^(-5),50]

Plot[g2[x],{x,1,2}]
6. Find the root of the func on f(x) = x^3 + 2*x^2-3x-1 using the Regula-Falsi Method with e = 10^(-5) in the interval
[1,2].Also, plot the graph of the func on

g3[x_] := x^3+2x^2-3x-7

Print["g3(x) =",g3[x]];

FalsePosi on[1,2,10^(-5),50]

Plot[g3[x],{x,1,2}]
Name – Abhay Kumar

Roll No – 21/631

Prac cal 03

1. Find the root of the func on f(x) = x^3 + 2x^2- 3x- 1 using the Newton-Raphson Method with e =
10^(-5) near the point x = 1. Also, plot the graph of the func on.

t1[x_] := x^3+ 2*x^2-3 x-1

Print["t1[x]=", t1[x]]

Newton[1, 10^(-5), 50]

Plot[t1[x], {x, 0, 1}
2.Find the root of the func on f(x) = 1.0 e^x + x^2- x- 4 using the Newton-Raphson Method with e =
10^(-5) near the point x = 1. Also, plot the graph of the func on.

h[x_] := Exp[x] + x^2-x-4

Print["h[x]=", t2[x]]

Newton[1, 10^(-5), 50]

Plot[h[x], {x, 0, 1}]


3.Find the root of the func on f(x) = 1.0 1.05- 1.04x+ log(x) using the Newton-Raphson Method with
e = 10^(-5) near the point x = 1. Also, plot the graph of the func on.

t3[x_] := 1.05-1.04 x +Log[x]

Print["t3[x]=", t3[x]]

Newton[1, 10^(-5), 50]

Plot[t3[x], {x, 0, 1}]


4.Find the root of the func on f(x) = 1.0 x^2- 2 using the Newton-Raphson Method with e = 10^(-5)
near the point x = 1. Also, plot the graph of the func on.

t4[x_] := x^2-2

Print["t4[x]=", t4[x]]

Newton[1, 10^(-5), 50]

Plot[t4[x], {x, 1, 1.5}]


Name – Abhay Kumar

Roll No – 21/631

Prac cal 04

Qus1. Solve the following system of equa ons using Gauss Elimina on method 2x-2y+3z=2, x+2y-z=3,
3x-y+2z=1

mat={{2,-2,3,2},{1,2,-1,3},{3,-1,2,1}}
2.Solve the following system of equa ons using Gauss-Jordan Method: 2x + 4y + 6z = 22,3x + 8y + 5z
= 27,-x + y + 2z = 2

mat={{2,4,6,22},{3,8,5,27},{-1,1,2,2}}
Qus3.Find the inverse of the following matrix using Gauss-Jordan Method: A =(1 1 1), (2-3 4),

(3 4 5)

mat1={{1,1,1},{2,-3,4},{3,4,5}}
Find the inverse of the following matrix using Gauss-Jordan Method: A =(012),(123),(311)

mat1={{0,1,2},{1,2,3},{3,1,1}}

You might also like