The document contains examples demonstrating the use of Scilab to solve problems related to mathematics and engineering. It includes examples of plotting 2D cartesian and polar curves, finding the angle between polar curves and radius of curvature, solving ordinary differential equations, finding partial derivatives and Jacobians, computing the greatest common divisor, solving linear congruences and systems of linear equations, and representing systems of equations graphically. The code examples show how to use Scilab functions and commands to analyze and solve these types of mathematical problems numerically.
Surveillance refers to the task of observing a scene, often for lengthy periods in search of particular objects or particular behaviour. This task has many applications, foremost among them is security (monitoring for undesirable behaviour such as theft or vandalism), but increasing numbers of others in areas such as agriculture also exist. Historically, closed circuit TV (CCTV) surveillance has been mundane and labour Intensive, involving personnel scanning multiple screens, but the advent of reasonably priced fast hardware means that automatic surveillance is becoming a realistic task to attempt in real time. Several attempts at this are underway.
This document describes the process of using natural and clamped cubic splines to approximate functions based on data points. It presents the mathematical formulas for natural and clamped cubic splines and their derivatives. Code functions are provided to calculate the splines and plot the results. The document demonstrates applying this process to example functions and data, showing the natural and clamped cubic splines accurately fit the original functions.
This document summarizes the MATLAB Reservoir Simulation Toolbox (MRST), which provides an environment for reservoir modelling and simulation using MATLAB. MRST features fully unstructured grids, rapid prototyping capabilities through automatic differentiation and object-oriented design, and industry-standard simulation methods. It has a large international user base in both academia and industry and consists of over 50 modules and thousands of lines of code.
The document discusses parabolas and their key properties. A parabola is defined as the set of points equidistant from a fixed point (the focus) and a fixed line (the directrix). The vertex, axis of symmetry, and focus-directrix distance determine the shape and position of the parabola. Examples are provided to demonstrate how to find the equation of a parabola given properties like the vertex and focus.
The document discusses techniques for line drawing and generalization in computer graphics. It covers Bresenham's line drawing algorithm, which uses only integer arithmetic for efficiency. It also discusses circle drawing using the midpoint circle algorithm and extensions to draw ellipses. Anti-aliasing techniques like area sampling are introduced to reduce jagged edges when rasterizing lines.
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
The document summarizes Bresenham's algorithm for drawing circles through rasterization. It describes how the algorithm works by starting at a point on the circle, calculating the radius, and recursively determining the next points to plot by considering the difference between the actual circle path and the discrete pixel locations. It provides implementations of the algorithm for drawing a full circle and discusses optimizations like reducing variables and only drawing portions of circles.
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
The document summarizes Bresenham's algorithm for drawing circles through rasterization. It describes how the algorithm works by recursively computing the next point on the circle based on an error term. It initializes the error term and progresses around the circle by incrementing coordinates while checking the error to determine when to increment the y-coordinate. The algorithm avoids square roots and trigonometric functions for efficiency. It can be generalized to draw ellipses and parabolas using a similar approach.
The document discusses two root-finding algorithms: the bisection method and the false position method. The bisection method repeatedly bisects an interval containing a root and selects a subinterval, shrinking the range by half at each step. The false position method starts with two points with opposite signs and uses the slope to find a new estimate within the interval. An example applies the false position method to find the coefficient of friction for a parachutist.
Surveillance refers to the task of observing a scene, often for lengthy periods in search of particular objects or particular behaviour. This task has many applications, foremost among them is security (monitoring for undesirable behaviour such as theft or vandalism), but increasing numbers of others in areas such as agriculture also exist. Historically, closed circuit TV (CCTV) surveillance has been mundane and labour Intensive, involving personnel scanning multiple screens, but the advent of reasonably priced fast hardware means that automatic surveillance is becoming a realistic task to attempt in real time. Several attempts at this are underway.
This document describes the process of using natural and clamped cubic splines to approximate functions based on data points. It presents the mathematical formulas for natural and clamped cubic splines and their derivatives. Code functions are provided to calculate the splines and plot the results. The document demonstrates applying this process to example functions and data, showing the natural and clamped cubic splines accurately fit the original functions.
This document summarizes the MATLAB Reservoir Simulation Toolbox (MRST), which provides an environment for reservoir modelling and simulation using MATLAB. MRST features fully unstructured grids, rapid prototyping capabilities through automatic differentiation and object-oriented design, and industry-standard simulation methods. It has a large international user base in both academia and industry and consists of over 50 modules and thousands of lines of code.
The document discusses parabolas and their key properties. A parabola is defined as the set of points equidistant from a fixed point (the focus) and a fixed line (the directrix). The vertex, axis of symmetry, and focus-directrix distance determine the shape and position of the parabola. Examples are provided to demonstrate how to find the equation of a parabola given properties like the vertex and focus.
The document discusses techniques for line drawing and generalization in computer graphics. It covers Bresenham's line drawing algorithm, which uses only integer arithmetic for efficiency. It also discusses circle drawing using the midpoint circle algorithm and extensions to draw ellipses. Anti-aliasing techniques like area sampling are introduced to reduce jagged edges when rasterizing lines.
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
The document summarizes Bresenham's algorithm for drawing circles through rasterization. It describes how the algorithm works by starting at a point on the circle, calculating the radius, and recursively determining the next points to plot by considering the difference between the actual circle path and the discrete pixel locations. It provides implementations of the algorithm for drawing a full circle and discusses optimizations like reducing variables and only drawing portions of circles.
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
The document summarizes Bresenham's algorithm for drawing circles through rasterization. It describes how the algorithm works by recursively computing the next point on the circle based on an error term. It initializes the error term and progresses around the circle by incrementing coordinates while checking the error to determine when to increment the y-coordinate. The algorithm avoids square roots and trigonometric functions for efficiency. It can be generalized to draw ellipses and parabolas using a similar approach.
The document discusses two root-finding algorithms: the bisection method and the false position method. The bisection method repeatedly bisects an interval containing a root and selects a subinterval, shrinking the range by half at each step. The false position method starts with two points with opposite signs and uses the slope to find a new estimate within the interval. An example applies the false position method to find the coefficient of friction for a parachutist.
The document discusses two root-finding algorithms: the bisection method and the false position method. The bisection method repeatedly bisects an interval containing a root and selects a subinterval, shrinking the range by half at each step. The false position method starts with two points with opposite signs and uses the slope to find a new estimate within the range, producing sequentially smaller intervals containing the root. Examples are provided to illustrate applying each method to find the root of equations.
This document summarizes the correspondence between single-layer neural networks and Gaussian processes (GPs). It reviews how the outputs of a single-layer neural network converge to a GP in the infinite-width limit, with the network's covariance function determined by its architecture. The document derives the mean and covariance functions for the GP corresponding to a single-layer network, and notes that different network outputs are independent GPs.
Computer Graphics in Java and Scala - Part 1Philip Schwarz
Computer Graphics in Java and Scala - Part 1.
Continuous (Logical) and Discrete (Device) Coordinates,
with a simple yet pleasing example involving concentric triangles.
Scala code: https://github.com/philipschwarz/computer-graphics-50-triangles-scala
Errata:
1. Scala classes TrianglesPanel and Triangles need not be classes, they could just be objects.
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...ijrap
This document discusses exact quasi-classical asymptotic solutions to the Schrodinger equation beyond the WKB and Maslov canonical operator approximations. It presents Colombeau solutions to the Schrodinger equation that can explain the nature of quantum jumps without additional postulates. The solutions are represented using path integral formulations involving Feynman propagators and Maslov canonical operators. Limiting quantum trajectories and averages are defined from the Colombeau solutions that correspond to measurement outcomes, providing an explanation for quantum jumps from the Schrodinger equation alone.
BEADS : filtrage asymétrique de ligne de base (tendance) et débruitage pour d...Laurent Duval
This paper jointly addresses the problems of chromatogram baseline correction and noise reduction. The proposed approach is based on modeling the series of chromatogram peaks as sparse with sparse derivatives, and on modeling the baseline as a low-pass signal. A convex optimization problem is formulated so as to encapsulate these non-parametric models. To account for the positivity of chromatogram peaks, an asymmetric penalty functions is utilized. A robust, computationally efficient, iterative algorithm is developed that is guaranteed to converge to the unique optimal solution. The approach, termed Baseline Estimation And Denoising with Sparsity (BEADS), is evaluated and compared with two state-of-the-art methods using both simulated and real chromatogram data.
Jacobi Iteration Method is Used in Numerical Analysis. This slide helps you to figure out the use of the Jacobi Iteration Method to submit your presentatio9n slide for academic use.
This document provides an overview of topics in vector integration, including line integrals, surface integrals, and volume integrals. It includes examples of calculating each type of integral. The key theorems covered are Green's theorem, Stokes' theorem, and Gauss's theorem of divergence. Green's theorem relates a line integral around a closed curve to a double integral over the enclosed region. Stokes' theorem relates a line integral around a closed curve to a surface integral over the enclosed surface. Gauss's theorem relates the surface integral of the normal component of a vector field over a closed surface to the volume integral of the divergence of the vector field over the enclosed volume.
This document provides information about ACE Educational Academy, an institution that provides training in electrical engineering. It includes a foreword about the book "Electromagnetic Fields" written by Venugopala Swamy for exams like GATE and engineering services. The book aims to explain electromagnetic field concepts simply. The document then lists topics that will be covered in the book, including vector analysis, electric fields, capacitance, Maxwell's equations, and inductance of simple geometries. It provides some introductory information about using vector analysis concepts like gradient, divergence and curl to solve electromagnetic field problems.
Robust Image Denoising in RKHS via Orthogonal Matching PursuitPantelis Bouboulis
We present a robust method for the image denoising task based on kernel ridge regression and sparse modeling. Added noise is assumed to consist of two parts. One part is impulse noise assumed to be sparse (outliers), while the other part is bounded noise. The noisy image is divided into small regions of interest, whose pixels are regarded as points of a two-dimensional surface. A kernel based ridge regression method, whose parameters are selected adaptively, is employed to fit the data, whereas the outliers are detected via the use of the increasingly popular orthogonal matching pursuit (OMP) algorithm. To this end, a new variant of the OMP rationale is employed that has the additional advantage to automatically terminate, when all outliers have been selected.
Here are the steps to solve this problem numerically in MATLAB:
1. Define the 2nd order ODE for the pendulum as two first order equations:
y1' = y2
y2' = -sin(y1)
2. Create an M-file function pendulum.m that returns the right hand side:
function dy = pendulum(t,y)
dy = [y(2); -sin(y(1))];
end
3. Use an ODE solver like ode45 to integrate from t=0 to t=6pi with initial conditions y1(0)=pi, y2(0)=0:
[t,y] = ode45
This document discusses dynamic programming and algorithms for solving all-pair shortest path problems. It begins by defining dynamic programming as avoiding recalculating solutions by storing results in a table. It then describes Floyd's algorithm for finding shortest paths between all pairs of nodes in a graph. The algorithm iterates through nodes, calculating shortest paths that pass through each intermediate node. It takes O(n3) time for a graph with n nodes. Finally, it discusses the multistage graph problem and provides forward and backward algorithms to find the minimum cost path from source to destination in a multistage graph in O(V+E) time, where V and E are the numbers of vertices and edges.
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...sipij
The present paper, proposes an efficient denoising algorithm which works well for images corrupted with
Gaussian and speckle noise. The denoising algorithm utilizes the alexander fractional integral filter which
works by the construction of fractional masks window computed using alexander polynomial. Prior to the
application of the designed filter, the corrupted image is decomposed using symlet wavelet from which only
the horizontal, vertical and diagonal components are denoised using the alexander integral filter.
Significant increase in the reconstruction quality was noticed when the approach was applied on the
wavelet decomposed image rather than applying it directly on the noisy image. Quantitatively the results
are evaluated using the peak signal to noise ratio (PSNR) which was 30.8059 on an average for images
corrupted with Gaussian noise and 36.52 for images corrupted with speckle noise, which clearly
outperforms the existing methods.
Please use the same variables and only write the TODO part #!-usr-bi.pdfasenterprisestyagi
Please use the same variables and only write the TODO part
#!/usr/bin/env octave
% Only modify this file where you see a "% TODO"
% Functions that do not contain this should not be modified.
% If you modify them for debugging, please remove/comment those modifications.
% This line tells octave that this is not a function file.
1;
% Workaround fltk bug. You might need to comment this line out .
graphics_toolkit("gnuplot");
% Meanings of commonly encountered variables:
% n = number of particles
% x = 2*n dimensional column vector with the positions of the particles
% v = 2*n dimensional column vector with the velocities of the particles
% Note that the ordering is always x1 y1 x2 y2 x3 y3 ...
% ks = spring constant
% kc = penalty collision strength
% l0 = matrix of spring rest lengths.
% l0(i,j) = initial length of spring between particles i and j (i<j)
% Note that l0(i,j) should not be used if i>=j.
% S = matrix indicating which springs exist
% S(i,j) = 1 if there is a spring between particles i and j (i<j)
% Note that S(i,j) should not be used if i>=j.
% m = mass of the particles (all particles have the same mass)
% Computes the total potential energy for the system.
function E = Potential_Energy(x,ks,kc,l0,S)
n = rows(S);
E = 0;
% For each pair of particles (i<j)
for i = 1:n
xi = x(2*i-1:2*i,1); % Position of particle i
for j = i+1:n
% If there is a spring between particles i and j
if S(i,j)>0
xj = x(2*j-1:2*j,1); % Position of particle j
% Compute the potential energy of the spring.
E = E + .5*ks/l0(i,j)*(norm(xi-xj)-l0(i,j))^2;
end
end
% Compute the potential energy of the penalty collision force for particle i
% If the particle is inside the radius 2 circle centered at the origin,
% then there is no collision (no force, zero potential energy).
% Otherwise, the energy rises quadratically with distance from the circle.
E = E + .5*kc*max(norm(xi)-2,0)^2;
end
end
% Computes the total energy for the system.
function E = Total_Energy(x,v,m,ks,kc,l0,S)
n = rows(S);
KE = 0;
% Kinetic energy for particle = 1/2 m ||v||^2
for i = 1:n
vi = v(2*i-1:2*i,1);
KE = KE + .5*m*(vi'*vi);
end
% Total energy is kinetic + potential
E = KE + Potential_Energy(x,ks,kc,l0,S);
end
% Computes the total force for all of the particles in the system. x is a 2*n
% dimensional vector. On exit, F should be a 2*n dimensional vector containing
% the total force on each of the n particles. The force can be deduced from the
% potential energy. In particular, F(k) is the negative partial derivative of PE
% with respect to x(k). Here k=1..2*n and PE is the quantity computed by
% Potential_Energy. Treat the Potential_Energy function as a regular math
% function, which is a function of its input x.
function F = Force(x,ks,kc,l0,S)
n = rows(S);
F = zeros(2*n,1);
% TODO
end
% Computes the total momentum p and angular momentum L for the system
function [p L] = Momentum(x,v,m)
n = rows(x)/2;
p = zeros(2,1); % 2D vector; total momentum
L = 0; % Scalar; total angular momentum
for i = 1:.
This document discusses backtracking algorithms and provides examples for solving problems using backtracking, including:
1) Generating all subsets and permutations of a set using backtracking.
2) The eight queens problem, which can be solved using a backtracking algorithm that places queens on a chessboard one by one while checking for threats.
3) Key components of backtracking algorithms including candidate construction, checking for solutions, and pruning search spaces for efficiency.
This document contains lecture notes on calculus of functions of several variables. It covers topics including vectors and vector spaces, geometry, vectors and the dot product, cross product, lines and planes in space, functions, vector valued functions, parameterized surfaces, parameterized curves, arc length and curvature. The notes provide definitions, examples, and exercises for each topic.
Relaxation methods for the matrix exponential on large networksDavid Gleich
My talk from the Stanford ICME seminar series on doing network analysis and link prediction using the a fast algorithm for the matrix exponential on graph problems.
TIU CET Review Math Session 6 - part 2 of 2youngeinstein
1. The document provides a review of math concepts for a college entrance exam, including functions, trigonometric functions, exponential and logarithmic functions.
2. It reviews concepts like evaluating functions, adding and composing functions, finding roots and intercepts of functions, and properties of trigonometric, exponential and logarithmic functions.
3. The document provides examples and problems to solve related to these various math concepts as a study guide for the exam.
This document provides estimates for several number theory functions without assuming the Riemann Hypothesis (RH), including bounds for ψ(x), θ(x), and the kth prime number pk. The following estimates are derived:
1) θ(x) - x < 1/36,260x for x > 0.
2) |θ(x) - x| < ηk x/lnkx for certain values of x, where ηk decreases as k increases.
3) Estimates are obtained for θ(pk), the value of θ at the kth prime number pk, showing θ(pk) is approximately k ln k + ln2 k - 1.
artificial intelligence and data science contents.pptxGauravCar
What is artificial intelligence? Artificial intelligence is the ability of a computer or computer-controlled robot to perform tasks that are commonly associated with the intellectual processes characteristic of humans, such as the ability to reason.
› ...
Artificial intelligence (AI) | Definitio
The document discusses two root-finding algorithms: the bisection method and the false position method. The bisection method repeatedly bisects an interval containing a root and selects a subinterval, shrinking the range by half at each step. The false position method starts with two points with opposite signs and uses the slope to find a new estimate within the range, producing sequentially smaller intervals containing the root. Examples are provided to illustrate applying each method to find the root of equations.
This document summarizes the correspondence between single-layer neural networks and Gaussian processes (GPs). It reviews how the outputs of a single-layer neural network converge to a GP in the infinite-width limit, with the network's covariance function determined by its architecture. The document derives the mean and covariance functions for the GP corresponding to a single-layer network, and notes that different network outputs are independent GPs.
Computer Graphics in Java and Scala - Part 1Philip Schwarz
Computer Graphics in Java and Scala - Part 1.
Continuous (Logical) and Discrete (Device) Coordinates,
with a simple yet pleasing example involving concentric triangles.
Scala code: https://github.com/philipschwarz/computer-graphics-50-triangles-scala
Errata:
1. Scala classes TrianglesPanel and Triangles need not be classes, they could just be objects.
Exact Quasi-Classical Asymptoticbeyond Maslov Canonical Operator and Quantum ...ijrap
This document discusses exact quasi-classical asymptotic solutions to the Schrodinger equation beyond the WKB and Maslov canonical operator approximations. It presents Colombeau solutions to the Schrodinger equation that can explain the nature of quantum jumps without additional postulates. The solutions are represented using path integral formulations involving Feynman propagators and Maslov canonical operators. Limiting quantum trajectories and averages are defined from the Colombeau solutions that correspond to measurement outcomes, providing an explanation for quantum jumps from the Schrodinger equation alone.
BEADS : filtrage asymétrique de ligne de base (tendance) et débruitage pour d...Laurent Duval
This paper jointly addresses the problems of chromatogram baseline correction and noise reduction. The proposed approach is based on modeling the series of chromatogram peaks as sparse with sparse derivatives, and on modeling the baseline as a low-pass signal. A convex optimization problem is formulated so as to encapsulate these non-parametric models. To account for the positivity of chromatogram peaks, an asymmetric penalty functions is utilized. A robust, computationally efficient, iterative algorithm is developed that is guaranteed to converge to the unique optimal solution. The approach, termed Baseline Estimation And Denoising with Sparsity (BEADS), is evaluated and compared with two state-of-the-art methods using both simulated and real chromatogram data.
Jacobi Iteration Method is Used in Numerical Analysis. This slide helps you to figure out the use of the Jacobi Iteration Method to submit your presentatio9n slide for academic use.
This document provides an overview of topics in vector integration, including line integrals, surface integrals, and volume integrals. It includes examples of calculating each type of integral. The key theorems covered are Green's theorem, Stokes' theorem, and Gauss's theorem of divergence. Green's theorem relates a line integral around a closed curve to a double integral over the enclosed region. Stokes' theorem relates a line integral around a closed curve to a surface integral over the enclosed surface. Gauss's theorem relates the surface integral of the normal component of a vector field over a closed surface to the volume integral of the divergence of the vector field over the enclosed volume.
This document provides information about ACE Educational Academy, an institution that provides training in electrical engineering. It includes a foreword about the book "Electromagnetic Fields" written by Venugopala Swamy for exams like GATE and engineering services. The book aims to explain electromagnetic field concepts simply. The document then lists topics that will be covered in the book, including vector analysis, electric fields, capacitance, Maxwell's equations, and inductance of simple geometries. It provides some introductory information about using vector analysis concepts like gradient, divergence and curl to solve electromagnetic field problems.
Robust Image Denoising in RKHS via Orthogonal Matching PursuitPantelis Bouboulis
We present a robust method for the image denoising task based on kernel ridge regression and sparse modeling. Added noise is assumed to consist of two parts. One part is impulse noise assumed to be sparse (outliers), while the other part is bounded noise. The noisy image is divided into small regions of interest, whose pixels are regarded as points of a two-dimensional surface. A kernel based ridge regression method, whose parameters are selected adaptively, is employed to fit the data, whereas the outliers are detected via the use of the increasingly popular orthogonal matching pursuit (OMP) algorithm. To this end, a new variant of the OMP rationale is employed that has the additional advantage to automatically terminate, when all outliers have been selected.
Here are the steps to solve this problem numerically in MATLAB:
1. Define the 2nd order ODE for the pendulum as two first order equations:
y1' = y2
y2' = -sin(y1)
2. Create an M-file function pendulum.m that returns the right hand side:
function dy = pendulum(t,y)
dy = [y(2); -sin(y(1))];
end
3. Use an ODE solver like ode45 to integrate from t=0 to t=6pi with initial conditions y1(0)=pi, y2(0)=0:
[t,y] = ode45
This document discusses dynamic programming and algorithms for solving all-pair shortest path problems. It begins by defining dynamic programming as avoiding recalculating solutions by storing results in a table. It then describes Floyd's algorithm for finding shortest paths between all pairs of nodes in a graph. The algorithm iterates through nodes, calculating shortest paths that pass through each intermediate node. It takes O(n3) time for a graph with n nodes. Finally, it discusses the multistage graph problem and provides forward and backward algorithms to find the minimum cost path from source to destination in a multistage graph in O(V+E) time, where V and E are the numbers of vertices and edges.
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...sipij
The present paper, proposes an efficient denoising algorithm which works well for images corrupted with
Gaussian and speckle noise. The denoising algorithm utilizes the alexander fractional integral filter which
works by the construction of fractional masks window computed using alexander polynomial. Prior to the
application of the designed filter, the corrupted image is decomposed using symlet wavelet from which only
the horizontal, vertical and diagonal components are denoised using the alexander integral filter.
Significant increase in the reconstruction quality was noticed when the approach was applied on the
wavelet decomposed image rather than applying it directly on the noisy image. Quantitatively the results
are evaluated using the peak signal to noise ratio (PSNR) which was 30.8059 on an average for images
corrupted with Gaussian noise and 36.52 for images corrupted with speckle noise, which clearly
outperforms the existing methods.
Please use the same variables and only write the TODO part #!-usr-bi.pdfasenterprisestyagi
Please use the same variables and only write the TODO part
#!/usr/bin/env octave
% Only modify this file where you see a "% TODO"
% Functions that do not contain this should not be modified.
% If you modify them for debugging, please remove/comment those modifications.
% This line tells octave that this is not a function file.
1;
% Workaround fltk bug. You might need to comment this line out .
graphics_toolkit("gnuplot");
% Meanings of commonly encountered variables:
% n = number of particles
% x = 2*n dimensional column vector with the positions of the particles
% v = 2*n dimensional column vector with the velocities of the particles
% Note that the ordering is always x1 y1 x2 y2 x3 y3 ...
% ks = spring constant
% kc = penalty collision strength
% l0 = matrix of spring rest lengths.
% l0(i,j) = initial length of spring between particles i and j (i<j)
% Note that l0(i,j) should not be used if i>=j.
% S = matrix indicating which springs exist
% S(i,j) = 1 if there is a spring between particles i and j (i<j)
% Note that S(i,j) should not be used if i>=j.
% m = mass of the particles (all particles have the same mass)
% Computes the total potential energy for the system.
function E = Potential_Energy(x,ks,kc,l0,S)
n = rows(S);
E = 0;
% For each pair of particles (i<j)
for i = 1:n
xi = x(2*i-1:2*i,1); % Position of particle i
for j = i+1:n
% If there is a spring between particles i and j
if S(i,j)>0
xj = x(2*j-1:2*j,1); % Position of particle j
% Compute the potential energy of the spring.
E = E + .5*ks/l0(i,j)*(norm(xi-xj)-l0(i,j))^2;
end
end
% Compute the potential energy of the penalty collision force for particle i
% If the particle is inside the radius 2 circle centered at the origin,
% then there is no collision (no force, zero potential energy).
% Otherwise, the energy rises quadratically with distance from the circle.
E = E + .5*kc*max(norm(xi)-2,0)^2;
end
end
% Computes the total energy for the system.
function E = Total_Energy(x,v,m,ks,kc,l0,S)
n = rows(S);
KE = 0;
% Kinetic energy for particle = 1/2 m ||v||^2
for i = 1:n
vi = v(2*i-1:2*i,1);
KE = KE + .5*m*(vi'*vi);
end
% Total energy is kinetic + potential
E = KE + Potential_Energy(x,ks,kc,l0,S);
end
% Computes the total force for all of the particles in the system. x is a 2*n
% dimensional vector. On exit, F should be a 2*n dimensional vector containing
% the total force on each of the n particles. The force can be deduced from the
% potential energy. In particular, F(k) is the negative partial derivative of PE
% with respect to x(k). Here k=1..2*n and PE is the quantity computed by
% Potential_Energy. Treat the Potential_Energy function as a regular math
% function, which is a function of its input x.
function F = Force(x,ks,kc,l0,S)
n = rows(S);
F = zeros(2*n,1);
% TODO
end
% Computes the total momentum p and angular momentum L for the system
function [p L] = Momentum(x,v,m)
n = rows(x)/2;
p = zeros(2,1); % 2D vector; total momentum
L = 0; % Scalar; total angular momentum
for i = 1:.
This document discusses backtracking algorithms and provides examples for solving problems using backtracking, including:
1) Generating all subsets and permutations of a set using backtracking.
2) The eight queens problem, which can be solved using a backtracking algorithm that places queens on a chessboard one by one while checking for threats.
3) Key components of backtracking algorithms including candidate construction, checking for solutions, and pruning search spaces for efficiency.
This document contains lecture notes on calculus of functions of several variables. It covers topics including vectors and vector spaces, geometry, vectors and the dot product, cross product, lines and planes in space, functions, vector valued functions, parameterized surfaces, parameterized curves, arc length and curvature. The notes provide definitions, examples, and exercises for each topic.
Relaxation methods for the matrix exponential on large networksDavid Gleich
My talk from the Stanford ICME seminar series on doing network analysis and link prediction using the a fast algorithm for the matrix exponential on graph problems.
TIU CET Review Math Session 6 - part 2 of 2youngeinstein
1. The document provides a review of math concepts for a college entrance exam, including functions, trigonometric functions, exponential and logarithmic functions.
2. It reviews concepts like evaluating functions, adding and composing functions, finding roots and intercepts of functions, and properties of trigonometric, exponential and logarithmic functions.
3. The document provides examples and problems to solve related to these various math concepts as a study guide for the exam.
This document provides estimates for several number theory functions without assuming the Riemann Hypothesis (RH), including bounds for ψ(x), θ(x), and the kth prime number pk. The following estimates are derived:
1) θ(x) - x < 1/36,260x for x > 0.
2) |θ(x) - x| < ηk x/lnkx for certain values of x, where ηk decreases as k increases.
3) Estimates are obtained for θ(pk), the value of θ at the kth prime number pk, showing θ(pk) is approximately k ln k + ln2 k - 1.
artificial intelligence and data science contents.pptxGauravCar
What is artificial intelligence? Artificial intelligence is the ability of a computer or computer-controlled robot to perform tasks that are commonly associated with the intellectual processes characteristic of humans, such as the ability to reason.
› ...
Artificial intelligence (AI) | Definitio
Batteries -Introduction – Types of Batteries – discharging and charging of battery - characteristics of battery –battery rating- various tests on battery- – Primary battery: silver button cell- Secondary battery :Ni-Cd battery-modern battery: lithium ion battery-maintenance of batteries-choices of batteries for electric vehicle applications.
Fuel Cells: Introduction- importance and classification of fuel cells - description, principle, components, applications of fuel cells: H2-O2 fuel cell, alkaline fuel cell, molten carbonate fuel cell and direct methanol fuel cells.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
Null Bangalore | Pentesters Approach to AWS IAMDivyanshu
#Abstract:
- Learn more about the real-world methods for auditing AWS IAM (Identity and Access Management) as a pentester. So let us proceed with a brief discussion of IAM as well as some typical misconfigurations and their potential exploits in order to reinforce the understanding of IAM security best practices.
- Gain actionable insights into AWS IAM policies and roles, using hands on approach.
#Prerequisites:
- Basic understanding of AWS services and architecture
- Familiarity with cloud security concepts
- Experience using the AWS Management Console or AWS CLI.
- For hands on lab create account on [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
# Scenario Covered:
- Basics of IAM in AWS
- Implementing IAM Policies with Least Privilege to Manage S3 Bucket
- Objective: Create an S3 bucket with least privilege IAM policy and validate access.
- Steps:
- Create S3 bucket.
- Attach least privilege policy to IAM user.
- Validate access.
- Exploiting IAM PassRole Misconfiguration
-Allows a user to pass a specific IAM role to an AWS service (ec2), typically used for service access delegation. Then exploit PassRole Misconfiguration granting unauthorized access to sensitive resources.
- Objective: Demonstrate how a PassRole misconfiguration can grant unauthorized access.
- Steps:
- Allow user to pass IAM role to EC2.
- Exploit misconfiguration for unauthorized access.
- Access sensitive resources.
- Exploiting IAM AssumeRole Misconfiguration with Overly Permissive Role
- An overly permissive IAM role configuration can lead to privilege escalation by creating a role with administrative privileges and allow a user to assume this role.
- Objective: Show how overly permissive IAM roles can lead to privilege escalation.
- Steps:
- Create role with administrative privileges.
- Allow user to assume the role.
- Perform administrative actions.
- Differentiation between PassRole vs AssumeRole
Try at [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
1. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
MATHEMATICS-I LAB
MANUAL
I Sem EC /CS
(22MATS11)
BANGALORE COLLEGE OF ENGINEERING & TECHNOLOGY
BANGALORE-99
2. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
SCILAB
PROCEDURE:
1.Switch on your PC.
2.Go to all programs and open scilab 6.0.2.
3.Go to scinotes.
4.Write the coding/programs.
5.Save the file and use extension name .sci.
6.Then execute and go to the scilab console window for output.
3. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:1 2D PLOTS OF CARTESIAN AND POLAR CURVES
AIM:
To plot 2D plots of cartesian and polar curves by scilab.
TOOL:
Scilab
THEORY:
2D Polar plot
Polarplot creates a polar coordinates plot of the angle versus the radius rho.
theta is the angle from the x axis to the radius vector specified in radians; rho is
the length of the radius vector specified in data space units. A polar coordinate
system is determined by a fixed point, a origin or pole and zero direction or
axis.
2D cartesian plot
A cartesian curve is a curve specified in cartesian coordinates.
In the cartesian system the coordinates are perpendicular to one another with the
same unit length on both axes.
SOURCE CODE:
2D Polar plot:
a) t=0:0.01:2*%pi;
clf();polarplot(sin(7*t),cos(8*t))
clf();polarplot([sin(7*t')sin(6*t')],[cos(8*t'),cos(8*t')],[1,2])
b) theta=0:0.01:2*%pi;
a=1
r=a*(1-cos(theta));
polarplot(theta,r)
2D cartesian plot:
x=-2:0.01:2;
y1=sqrt(1-x^2);
y2=-sqrt(1-x^2);
plot(x,y1,x,y2)
6. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
RESULT:
Thus the 2D plots of cartesian and polar plot are successfully executed.
7. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:2 FINDING ANGLE BETWEEN POLAR CURVES,
CURVATURE AND RADIUS OF CURVATURE OF A GIVEN CURVE
AIM:
To find angle between polar curves, curvature and radius of curvature of a given
curve.
TOOL:
Scilab
THEORY:
In the polar coordinates system, ordered pair will be (r,0). The ordered pair
specifies a points location based on the value of r and the angle 0.
The radius of curvature is the reciprocal of the curvature for a curve, it equals
the radius of the circular arc which best approximates the curve at that point.
The radius changes as the curve moves. the curvature vector length is the radius
of curvature.
SOURCE CODE:
(i) t=-%pi:%pi/32:%pi;
a=1;
r=1-cos(t);
polarplot(t,r)
t1=-%pi:%pi/32:%pi;
r=cos(t1);
polarplot(t1,r);
(ii) r=input('enter the radius of the circle=')
theta=linspace (0,2*%pi,100);
x=r*cos(theta);
y=r*sin(theta);
circle=[x,y];
plot(x,y);
xlabel('x');
ylabel('y');
title('circle of given radius',"fontsize",4);
9. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
RESULT:
Thus the angle of curvature and radius of a given circle was executed
successfully.
10. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:3 FINDING PARTIAL DERIVATIVES AND JACOBIANS
AIM:
To find the partial derivatives and jacobians in scilab.
TOOL:
Scilab
THEORY:
A jacobian matrix is a special kind of matrix that consists of first order partial
derivatives for some vector function. Jacobian is the determinant of the jacobian
matrix. The matrix will contain all partial derivatives of a vector function. The
main use of jacobian is found in the transformation of coordinates.
SOURCE CODE:
function ydot=f(t, y)
ydot=A*y
endfunction
function J=Jacobian(t, y)
J=A
endfunction
A=[10,0;0,-1]
y0=[0;1];
t0=0;
t=1;
y=ode("stiff",y0,t0,t,f,Jacobian)
disp("solution given by the solver")
disp(y)
disp("exact solution")
disp("y=")
disp(expm(A*t)*y0)
11. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
OUTPUT:
"solution given by the solver"
0
0.3678794
"exact solution"
"y="
0
0.3678794
RESULT:
Thus the partial derivatives and jacobians program was executed successfully.
12. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:4 SOLUTIONS OF FIRST ORDER ORDINARY
DIFFERENTIAL EQAUTION AND PLOTTING THE SOLUTION
AIM:
To determine the solutions of first order ordinary differential equation and plot
the solution curves.
TOOL:
Scilab
THEORY:
The first order means that the first derivative of y appears but no higher order
derivatives do. It represents the rate of change of one variable with respect to
another variable. A first order differential equation is defined by an equation :
dy/dx=f(x,y) of two variables x and y with its function f(x,y) defined on a
region in the xy-plane. the differential equation in first order can be written as
y’=f(x,y) or
(d/dx)y=f(x,y)
SOURCE CODE:
(i)
function dx=f(x, y)
dx=-2*x-y;
endfunction
y0=-1;
x0=0;
t=0.4;
sol=ode(y0,x0,t,f);
disp(sol,"answer");
plot2d(x,sol,5)
xlabel('x');
ylabel('y(x)');
xtitle('y(x)vs x');
15. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
RESULT:
Thus the solution of first order differential equation and plotting the solution
curves was executed successfully.
16. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:5 FINDING GCD USING EUCLID’S ALGORITHM
AIM:
To find the GCD numbers of two variables using euclids algorithm.
TOOL:
Scilab
THEORY:
The Euclidean algorithm or Euclid algorithm is an efficient method for two
integers, the largest number that divides them both without a reminder.it can be
used to reduce fractions to their simplest form and is a part of many other
number theoretic and cryptographic calculations.
The Euclidean algorithm for finding GCD(A,B)is as follows:
If A=0 then GCD(A,B)=B, Since the GCD(0,B)=B and we can stop.
If B=0 then GCD(A,B)=A, since the GCD(A,0)=A and we can stop.
SOURCE CODE:
clc;
clear;
function gcd(a, b)
x=a
y=b
while y~=0
r=modulo(x,y)
x=y
y=r
end
mprintf("gcd(%d,%d)=%d",a,b,x)
endfunction
n1=input("enter first no:")
n2=input("enter second number:")
gcd(n1,n2)
RESULT:
Thus the GCD of two numbers using euclids algorithm was executed
successfully.
17. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
OUTPUT:
Enter first number:10
Enter second number:20
Gcd(10,20)=10
18. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:6 SOLVING LINEAR CONGRUENCES ax=b(mod m)
AIM:
To solve linear congruences by scilab.
TOOL:
Scilab
THEORY:
A congruence of the form ax=(mod m) where x is an unknown integer is called
a linear congruence in one variable. A linear congruence is a congruence
relation of the form ax=(mod m) where a,b,m Z and m>0.
Numbers are congruent if they have a property that the difference between them
is integrally divisible by a number(an integer).The number is called the modulus
and the statement is treated as congruent to the modulo.
SOURCE CODE:
a=8;
b=12;
m=28;
v=int32([a,m]);
d=gcd(v);
a1=a/d;
b1=b/d;
m1=m/d;
function yd=f(x)
yd=(a1*x)-b1
endfunction
disp('k is the unique solution of the equation')
for i=0:m1
x=i;
p=f(x);
if (modulo(p,m1)==0)
k=x;
break;
end
end
s1=k;
s2=k+m1;
s3=k+(m1*2);
s4=k+(m1*3);
19. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
disp('solutions of the original equation at d=4')
disp(s1)
disp(s2)
disp(s3)
disp(s4)
20. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
OUTPUT:
'k is the unique solution of the equation'
'solutions of the original equation at d=4'
5
12
19
26
RESULT:
Thus the linear congruences was solved and executed successfully.
21. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:7 SOLUTION OF SYSTEM OF LINEAR EQUATIONS USING
GAUSS SEIDAL ITERATION
AIM:
To find the solution of system of linear equations using gauss seidal iteration
method .
TOOLS:
Scilab
THEORY:
In numerical linear algebra, the gauss-seidal method is an iterative method used
to solve a system of linear equations. Gauss seidal method is an improved form
of jacobi method also known as the successive displacement method. For a
system of equations Ax=B, we begin with an initial approximation of solution
vector x=x0,by which we get a sequence of solution vector x1,x2,…xk.
SOURCE CODE:
clc;
clear;
a=[12,3,-5;1,5,3;3,7,13];
b=[1,28,76];
x=[0,0,0];
n=input("enter no of iterations;")
for i=1:n
x(1)=(b(1)-a(1,2)*x(2)-a(1,3)*x(3))/a(1,1);
x(2)=(b(2)-a(2,1)*x(1)-a(2,3)*x(3))/a(2,2);
x(3)=(b(3)-a(3,1)*x(1)-a(3,2)*x(2))/a(3,3);
disp("x1,x2 and x3 after"+string(i)+"iterations");
disp(x);
end
22. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
OUTPUT:
enter no of iterations 3
"x1,x2,x3 after1iteration"
0.0833333 5.5833333 2.8205128
"x1,x2,x3 after2iteration"
-0.1372863 3.9351496 3.7589086
"x1,x2,x3 after3iteration"
0.6657579 3.2115033 3.9632464
23. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
RESULT:
Thus the solution of system of linear equations using gauss seidal iterations was
computed successfully.
24. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:8 NUMERICAL SOLUTION OF SYSTEM OF LINEAR
EQUATIONS,TEST FOR CONSISTENCY AND GRAPHICAL
REPRESENTATION
AIM:
To solve the system of linear equations ,test for consistency and graphical
representation .
TOOLS:
Scilab
THEORY:
The solution set of the system of linear equations is the set of the possible
values to the variables that satisfies the given linear equation.
A system of linear equations is a collection of one or more linear equations
involving the same variables. Graphing can be used if the system is inconsistent
or dependent. If the two lines are parallel, the system has no solution and is
inconsistent. If the two lines are identical, the system has infinite solutions and
is a dependent system.
SOURCE CODE:
(i) SOLUTION OF SYSTEM OF LINEAR EQUATIONS
clc
n=input("enter no of variables")
disp('enter the coefficient matrix,rowwise')
for i=1:n;
for j=1:n;
A(i,j)=input("")
end
end
disp("enter the constant matrix,column")
for i=1:n;
c(i)=input("")
end
25. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
disp(A)
disp(c)
D=inv(A)*c
disp(D)
(ii) TEST CONSISTENCY
clc
N=input("enter no of variables")
disp('enter the coefficient matrix,rowwise')
for i=1:N;
for j=1:N;
A(i,j)=input("")
end
end
disp("enter the constant matrix,column")
for i=1:N;
C(i)=input("")
end
disp(A)
disp(C)
if rank(A)==rank([A c])then
if rank(A)==min(size(A))then
mprintf("n system of equation has unique solution:n")
else
mprintf("n system of equation has infinitely many solution:n")
end
if rank(A)<>rank([A C]) then
mprintf("n system of equation has no solution:n");
D=inv(A)*C
26. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
disp(D)
end
end
(iii) SYSTEM OF LINEAR EQUATION BY GRAPHICL REPRESENTATION
clear
clc
xset('window',1)
xtitle("my graph","x axis","y axis")
x=linspace(1,3,30)
y1=3-x
y2=%e^(x-1)
plot(x,y1,"o-")
plot(x,y2,"+-")
legend("3-x","%e^(x-1)")
disp("from the graph, it is clear that the point of intersection is nearly x=1.43")
27. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
OUTPUT:
(i) SOLUTION OF SYSTEM OF LINEAR EQUATIONS
Equation : 2x+y+z=5
x+y+z=1
x-y+2z=1
enter no of variables 3
"enter the coefficient matrix,rowwise"
2
1
1
1
1
1
1
-1
2
"enter the constant matrix,column"
5
4
1
2 1 1
1 1 1
1 -1 2
5
4
1
1
2.0000000
1.0000000
28. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
(ii) TEST CONSISTENCY
enter no of variables 3
enter the coefficient matrix,rowwise''
4
6
5
9
2
4
9
6
2
enter the constant matrix,column
1
7
9
4. 6. 5.
9. 2. 4.
9. 6. 2.
1
7
9
system of equation has unique solution:
1.1153846
0.0961538
-0.8076923
29. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
OUTPUT:
(iii) SYSTEM OF LINEAR EQUATION BY GRAPHICL REPRESENTATION
RESULT:
Thus the numerical solution of system of linear equations, test for consistency
and graphical representation was executed successfully.
30. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:9 COMPUTE EIGEN VALUES AND EIGEN VECTORS AND
FIND THE LARGEST AND SMALLEST EIGENVALUE BY
RAYLEIGH POWER METHOD
AIM:
To compute the eigen values and eigen vectors and find the largest and smallest
eigen value by Rayleigh power method.
TOOLS:
Scilab
THEORY:
Rayleigh quotient iteration is an iterative method, that is, it delivers a sequence
of approximate solutions that converges to a true solution in the limit. Power
method normalizes the products Aq(k-1) to avoid overflow/underflow, therefore
it converges to x1(assuming it has unit norm).The power method converges if
is dominant and if q(0) has a component in the direction of the corresponding
eigenvector x1.It is used in the min-max theorem to get exact values of all
eigenvalues.
SOURCE CODE:
(i) Compute eigen values and eigen vectors
clc;
clear;
A= input('Enter the matrix:');
disp(A)
x=input('Enter the initial approximation to the eigenvector:');
disp(A)
[nA,mA]=size(A)
[nx,mx]=size(x)
if (nA<>mA) then
mprint("matrix must be squaren")
abort
else if (mA<>nx) then
mprint("matrix compatible dimension between A and b")
abort
end
n=nA
e=zeros(1,1)
while(1)do
for i =1:n
z(i)=0
31. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
for j=1:n
z(i)=z(i)+A(i,j)*x(j)
end
end
zmax=abs(z(1))
for i=2:n
if abs (z(i))> zmax then
zmax = abs(z(i))
end
end
(ii) Largest eigen value and eigen vector
clear;clc;close();
A=[3 0 1;2 2 2;4 2 5];
disp(A,'the given matrix is')
u0=[1 1 1]';
disp(u0,'the intial vector is')
v=A*u0;
a=max(u0);
disp(a,'first approximation to eigen value is');
while abs(max(v)-a)>0.002
disp(v,"current eigen vector is")
a=max(v);
disp(a,"current eigen value is")
u0=v/max(v);
v=A*u0;
end
format('v',4);
disp(max(v),'the largest eigen value is:')
format('v',5)
disp(u0,'the corresponding eigen vector is:')
32. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
OUTPUT:
(i) Enter the matrix: [2,-1,0;-1,2,-1;0,-1,2]
2. -1. 0.
-1. 2. -1.
0. -1. 2.
Enter the initial approximation to the eigenvector: [1;0;0]
2. -1. 0.
-1. 2. -1.
0. -1. 2.
The required eigenvalue is :3.414214
the required eigenvalue is
0.708459 -1.000000 0.705754
(ii)
the given matrix is
3. 0. 1.
2. 2. 2.
4. 2. 5.
the intial vector is
1.
1.
1.
first approximation to eigen value is
1.
current eigen vector is
4.
6.
33. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
11.
current eigen value is
11.
current eigen vector is
2.0909091
3.8181818
7.5454545
current eigen value is
7.5454545
current eigen vector is
1.8313253
3.5662651
7.1204819
current eigen value is
7.1204819
current eigen vector is
1.7715736
3.5160745
7.0304569
current eigen value is
7.0304569
current eigen vector is
1.7559567
3.5042118
7.0081829
current eigen value is
7.0081829
current eigen vector is
1.7516742
34. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
3.5011505
7.0022666
current eigen value is
7.0022666
the largest eigen value is:
7.
the corresponding eigen vector is:
0.25
0.5
1.
RESULT:
Thus the eigen value and eigen vectors can be computed by Rayleigh power
method. Also the largest and smallest eigen values also computed and executed
successfully.
35. PREPARED BY:ANUSUYA.P ,ASSISTANT PROFESSOR/ECE,BCET-BANGALORE
EX:NO:10 APPLICATIONS OF MAXIMA AND MINIMA OF TWO
VARIABLES
AIM:
To find the maxima and minima of two variables.
TOOLS:
Scilab
THEORY:
Maxima and minima are the peaks and valleys in the curve of a function.In
calcules,we can find the maximum and minimum value of any function without
even looking at the graph of a function.maxima will be the highest point on the
curve within the given range and minima would be the lowest point on the
curve.
SOURCE CODE:
clc();clear;
function y=f(x)
y=x+(1/x);
endfunction
//calculation
//dy/dx=1-(1/x^2)=0 for maxima or mimima
//x=1 or -1
//at x=0 y=infinte is maxima value
//minima value of y at x=1
ymin=f(1)
disp(ymin,'maxima value of given function is infinite and minima value is')
OUTPUT:
maxima value of given function is infinite and minima value is 2
RESULT:
Thus the maxima and minima values are computed successfully by scilab.