The document introduces solving non-linear equations (NLEs) through root-finding methods. It discusses transforming NLEs into root-finding problems by forming a root-finding function f(x) equal to zero at the solution. The key steps are to identify the fixed parameters {pi} of the equation and define the root-finding function f(x,{pi}) as the left side minus the right side of the original equation. An example transforms the Redlich-Kwong equation of state to find the molar volume V corresponding to pressure P=1 bar and temperature T=60°C.
I am Vincent S. I am an Algorithm Assignment Expert at programminghomeworkhelp.com. I hold a Ph.D. in Programming from, University of Minnesota, USA. I have been helping students with their homework for the past 9 years. I solve assignments related to Algorithms.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with Algorithm assignments.
In this presentation, I will demonstrate an alternative novel proof of the prime-counting function, by utilizing the Heaviside function, the Laplace transform, and the residue theorem.
I am Jayson L. I am a Mathematical Statistics Homework Expert at statisticshomeworkhelper.com. I hold a Master's in Statistics, from Liverpool, UK. I have been helping students with their homework for the past 5 years. I solve homework related to Mathematical Statistics.
Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com.You can also call on +1 678 648 4277 for any assistance with Mathematical Statistics Homework.
I am Vincent S. I am an Algorithm Assignment Expert at programminghomeworkhelp.com. I hold a Ph.D. in Programming from, University of Minnesota, USA. I have been helping students with their homework for the past 9 years. I solve assignments related to Algorithms.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with Algorithm assignments.
In this presentation, I will demonstrate an alternative novel proof of the prime-counting function, by utilizing the Heaviside function, the Laplace transform, and the residue theorem.
I am Jayson L. I am a Mathematical Statistics Homework Expert at statisticshomeworkhelper.com. I hold a Master's in Statistics, from Liverpool, UK. I have been helping students with their homework for the past 5 years. I solve homework related to Mathematical Statistics.
Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com.You can also call on +1 678 648 4277 for any assistance with Mathematical Statistics Homework.
I am Travis W. I am a Computer Science Assignment Expert at programminghomeworkhelp.com. I hold a Master's in Computer Science, Leeds University. I have been helping students with their homework for the past 9 years. I solve assignments related to Computer Science.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com.You can also call on +1 678 648 4277 for any assistance with Computer Science assignments.
Analysis and design of algorithms part 4Deepak John
Complexity Theory - Introduction. P and NP. NP-Complete problems. Approximation algorithms. Bin packing, Graph coloring. Traveling salesperson Problem.
Variational inference is a technique for estimating Bayesian models that provides similar precision to MCMC at a greater speed, and is one of the main areas of current research in Bayesian computation. In this introductory talk, we take a look at the theory behind the variational approach and some of the most common methods (e.g. mean field, stochastic, black box). The focus of this talk is the intuition behind variational inference, rather than the mathematical details of the methods. At the end of this talk, you will have a basic grasp of variational Bayes and its limitations.
I am Charles B. I am an Algorithm Assignment Expert at programminghomeworkhelp.com. I hold a Ph.D. in Programming, Texas University, USA. I have been helping students with their homework for the past 6 years. I solve assignments related to Algorithms.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com.You can also call on +1 678 648 4277 for any assistance with Algorithm assignments.
Gives a basic idea of Finite field theory and its uses in Elliptic cure cryptography. ECDLP and Diffie Helman key exchange and Elgamal Encryption with ECC.
I am George P. I am a Chemistry Assignment Expert at eduassignmenthelp.com. I hold a Ph.D. in Chemistry, from Perth, Australia. I have been helping students with their homework for the past 6 years. I solve assignments related to Chemistry.
Visit eduassignmenthelp.com or email info@eduassignmenthelp.com.
You can also call on +1 678 648 4277 for any assistance with Chemistry Assignments.
* Evaluate a polynomial using the Remainder Theorem.
* Use the Factor Theorem to solve a polynomial equation.
* Use the Rational Zero Theorem to find rational zeros.
* Find zeros of a polynomial function.
* Use the Linear Factorization Theorem to find polynomials with given zeros.
* Use Descartes’ Rule of Signs.
I am Travis W. I am a Computer Science Assignment Expert at programminghomeworkhelp.com. I hold a Master's in Computer Science, Leeds University. I have been helping students with their homework for the past 9 years. I solve assignments related to Computer Science.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com.You can also call on +1 678 648 4277 for any assistance with Computer Science assignments.
Analysis and design of algorithms part 4Deepak John
Complexity Theory - Introduction. P and NP. NP-Complete problems. Approximation algorithms. Bin packing, Graph coloring. Traveling salesperson Problem.
Variational inference is a technique for estimating Bayesian models that provides similar precision to MCMC at a greater speed, and is one of the main areas of current research in Bayesian computation. In this introductory talk, we take a look at the theory behind the variational approach and some of the most common methods (e.g. mean field, stochastic, black box). The focus of this talk is the intuition behind variational inference, rather than the mathematical details of the methods. At the end of this talk, you will have a basic grasp of variational Bayes and its limitations.
I am Charles B. I am an Algorithm Assignment Expert at programminghomeworkhelp.com. I hold a Ph.D. in Programming, Texas University, USA. I have been helping students with their homework for the past 6 years. I solve assignments related to Algorithms.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com.You can also call on +1 678 648 4277 for any assistance with Algorithm assignments.
Gives a basic idea of Finite field theory and its uses in Elliptic cure cryptography. ECDLP and Diffie Helman key exchange and Elgamal Encryption with ECC.
I am George P. I am a Chemistry Assignment Expert at eduassignmenthelp.com. I hold a Ph.D. in Chemistry, from Perth, Australia. I have been helping students with their homework for the past 6 years. I solve assignments related to Chemistry.
Visit eduassignmenthelp.com or email info@eduassignmenthelp.com.
You can also call on +1 678 648 4277 for any assistance with Chemistry Assignments.
* Evaluate a polynomial using the Remainder Theorem.
* Use the Factor Theorem to solve a polynomial equation.
* Use the Rational Zero Theorem to find rational zeros.
* Find zeros of a polynomial function.
* Use the Linear Factorization Theorem to find polynomials with given zeros.
* Use Descartes’ Rule of Signs.
S1 - Process product optimization using design experiments and response surfa...CAChemE
An intensive practical course mainly for PhD-students on the use of designs of experiments (DOE) and response surface methodology (RSM) for optimization problems. The course covers relevant background, nomenclature and general theory of DOE and RSM modelling for factorial and optimisation designs in addition to practical exercises in Matlab. Due to time limitations, the course concentrates on linear and quadratic models on the k≤3 design dimension. This course is an ideal starting point for every experimental engineering wanting to work effectively, extract maximal information and predict the future behaviour of their system.
Mikko Mäkelä (DSc, Tech) is a postdoctoral fellow at the Swedish University of Agricultural Sciences in Umeå, Sweden and is currently visiting the Department of Chemical Engineering at the University of Alicante. He is working in close cooperation with Paul Geladi, Professor of Chemometrics, and using DOE and RSM for process optimization mainly for the valorization of industrial wastes in laboratory and pilot scales.”
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctnessallyn joy calcaben
Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 23, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
In computer science, divide and conquer (D&C) is an algorithm design paradigm based on multi-branched recursion. A divide and conquer algorithm works by recursively breaking down a problem into two or more sub-problems of the same (or related) type, until these become simple enough to be solved directly. The solutions to the sub-problems are then combined to give a solution to the original problem.
In computer science, merge sort (also commonly spelled mergesort) is an O(n log n) comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output. Mergesort is a divide and conquer algorithm that was invented by John von Neumann in 1945. A detailed description and analysis of bottom-up mergesort appeared in a report by Goldstine and Neumann as early as 1948.
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...mathsjournal
The following document presents some novel numerical methods valid for one and several variables, which
using the fractional derivative, allow us to find solutions for some nonlinear systems in the complex space using
real initial conditions. The origin of these methods is the fractional Newton-Raphson method, but unlike the
latter, the orders proposed here for the fractional derivatives are functions. In the first method, a function is
used to guarantee an order of convergence (at least) quadratic, and in the other, a function is used to avoid the
discontinuity that is generated when the fractional derivative of the constants is used, and with this, it is possible
that the method has at most an order of convergence (at least) linear.
ER Publication,
IJETR, IJMCTR,
Journals,
International Journals,
High Impact Journals,
Monthly Journal,
Good quality Journals,
Research,
Research Papers,
Research Article,
Free Journals, Open access Journals,
erpublication.org,
Engineering Journal,
Science Journals,
Lecture 1 from https://irdta.eu/deeplearn/2022su/
Covers concepts from Part 1 of my new book, https://meyn.ece.ufl.edu/2021/08/01/control-systems-and-reinforcement-learning/
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Vaccine management system project report documentation..pdfKamal Acharya
The Division of Vaccine and Immunization is facing increasing difficulty monitoring vaccines and other commodities distribution once they have been distributed from the national stores. With the introduction of new vaccines, more challenges have been anticipated with this additions posing serious threat to the already over strained vaccine supply chain system in Kenya.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
1. Lecture 4—Intro Solving Non-Linear Equations (NLEs)
Outline
1 Introduction
The solution of a non-linear equation is a Root Finding Problem
2 Built-In Solution in Matlab: fzero
3 Built-In Solution in Excel: Solver
Enabling the solver
Using the solver
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 1 / 16
2. Features of a non-linear function
− 4 −2 0 2 4
−50
0
50 Roots
x
y
f(x) = −2x3
− x2
+ 20x + 1 Finding the roots of equations is one
of the most common numerical
tasks
Equations of state
Empirical relationships for friction
factors, heat transfer coefficients
Solution to complicated mass &
energy balances
>> p = [-2 -1 20 1 ]% Tell MATLAB about the polynomial
>> r = roots (p)
r =
-3.398872 2.948760 -0.049888
5 >> fplot ( @(x) polyval (p,x), [-4.5 4] , ’r’ );
>> plot ( [0 0 0], r, ’bo’,’markerface’,’blue’);
Command line:
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 2 / 16
3. Features of a non-linear function
−4 −2 0 2 4
−50
0
50
∂f
∂x
= 0 ∂2
f
∂x2 > 0
∂f
∂x
= 0 ∂2
f
∂x2 < 0
Extrema
x
y
f(x) = −2x3
− x2
+ 20x + 1 Optimization methods allow the
maxima or minima of a function to
be located
Applications:
Minimize the cost of a process by
adjusting its parameters
Maximize the yield or selectivity of
a reaction by adjusting tempera-
ture/pressure/concentration
>> p = [-2 -1 20 1 ]% Tell MATLAB about the polynomial
>> r = roots (p)
r =
-3.398872 2.948760 -0.049888
5 >> fplot ( @(x) polyval (p,x), [-4.5 4] , ’r’ );
>> plot ( [0 0 0], r, ’bo’,’markerface’,’blue’);
Command line:
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 2 / 16
4. Matlab built-in support for polynomials
Matlab has a number of functions to help with polynomials. These functions all use a
coefficient array to describe the polynomial:
Math
P1(x) = −2x3
− x2
+ 20x + 1
P2(x) = x4
− x2
+ 2x
Matlab Coefficient Array
>> p1 = [ -2, -1, 20, 1 ];
>> p2 = [ 1, 0, -1, 2, 0 ];
Command line:
The order n of a polynomial is its largest exponent.
The coefficient array has a total of n + 1 elements.
The first element of the coefficient array is the coefficient of the highest power
(called the order) of the polynomial.
The last element is the value of the constant.
Matlab functions that deal with polynomials:
y = polyval(p, x) Evaluate polynomial p at x
r = roots(p) Return array of all n roots (real + complex) of p.
p = polyfit(x,y,n) Fit data y vs. x to a polynomial of order n. x and y
must have the same length, which must be at least
n + 1. For example n = 1 is just a line, and you need
at least 2 points to define a line.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 3 / 16
5. Solving for the root — Where to start?
Transforming the equation
Consider the Redlich-Kwong Equation of State
P =
RT
V − b
−
a
V(V + b)
√
T
42 44 46 48 50
0
2
4
6
·105
V, cm3
mol
P,bar
T = 60o C
methyl chloride
This function has no real roots
P ≤ 0 is not a physical pressure
We are usually interested in the
V (at a given T) that gives us a
certain P
How is this a root-finding
problem?
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 4 / 16
6. Solving for the root — Where to start?
Transforming the equation
Consider the Redlich-Kwong Equation of State
1 =
RT
V − b
−
a
V(V + b)
√
T
42 44 46 48 50
0
2
4
6
·105
V, cm3
mol
P,bar
T = 60o C
methyl chloride
Suppose we want to know the
V corresponding to P = 1 bar
We can substitute this choice
into the equation.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 4 / 16
7. Solving for the root — Where to start?
Transforming the equation
Consider the Redlich-Kwong Equation of State
1 −
RT
V − b
−
a
V(V + b)
√
T
= 0
0.2 0.4 0.6 0.8 1
·105
0
0.5
V, cm3
mol
1−P,bar
T = 60o C
methyl chloride
Now rearrange the equation so
that the RHS is zero.
The resulting equality is only
true when the right V is
selected
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 4 / 16
8. Solving for the root — Where to start?
Transforming the equation
Consider the Redlich-Kwong Equation of State
1 −
RT
V − b
−
a
V(V + b)
√
T
= f(V)
0.2 0.4 0.6 0.8 1
·105
0
0.5
V, cm3
mol
1−P,bar
T = 60o C
methyl chloride
Now rearrange the equation so
that the RHS is zero.
The resulting equality is only
true when the right V is
selected
As V is varied the right-hand
side varies.
f(V) is a transformed form of
the RK EOS
f(V) = 0 is the solution to our
problem
We can see from the plot that
the correct molar volume is
near 30,000 cm3
mol
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 4 / 16
9. Solving for the root — Where to start?
Transforming the equation into its root-finding form
First Step — Form the ‘‘Root-finding function’’
Any equality with 1 unknown can be transformed into a function whose
roots satisfy the equality
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 5 / 16
10. Solving for the root — Where to start?
Transforming the equation into its root-finding form
First Step — Form the ‘‘Root-finding function’’
Any equality with 1 unknown can be transformed into a function whose
roots satisfy the equality
In general, root-finding methods apply when we have an equality
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 5 / 16
11. Solving for the root — Where to start?
Transforming the equation into its root-finding form
First Step — Form the ‘‘Root-finding function’’
Any equality with 1 unknown can be transformed into a function whose
roots satisfy the equality
In general, root-finding methods apply when we have an equality
1 with 1 unknown x
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 5 / 16
12. Solving for the root — Where to start?
Transforming the equation into its root-finding form
First Step — Form the ‘‘Root-finding function’’
Any equality with 1 unknown can be transformed into a function whose
roots satisfy the equality
In general, root-finding methods apply when we have an equality
1 with 1 unknown x
2 and any number of specified parameters {pi}:
left(x, {pi}) = right(x, {pi}) (1)
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 5 / 16
13. Solving for the root — Where to start?
Transforming the equation into its root-finding form
First Step — Form the ‘‘Root-finding function’’
Any equality with 1 unknown can be transformed into a function whose
roots satisfy the equality
In general, root-finding methods apply when we have an equality
1 with 1 unknown x
2 and any number of specified parameters {pi}:
left(x, {pi}) = right(x, {pi}) (1)
We can form a function f(x, {pi}):
f(x, {pi}) = left(x, {pi}) − right(x, {pi})
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 5 / 16
14. Solving for the root — Where to start?
Transforming the equation into its root-finding form
First Step — Form the ‘‘Root-finding function’’
Any equality with 1 unknown can be transformed into a function whose
roots satisfy the equality
In general, root-finding methods apply when we have an equality
1 with 1 unknown x
2 and any number of specified parameters {pi}:
left(x, {pi}) = right(x, {pi}) (1)
We can form a function f(x, {pi}):
f(x, {pi}) = left(x, {pi}) − right(x, {pi})
The roots of f correspond to solutions of (1). f(V) is the root-finding function.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 5 / 16
15. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
16. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
p1 = R 83.14
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
17. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
p1 = R 83.14
p2 = a
0.4274 R2 T2.5
c
Pc
= 1.5641 × 108
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
18. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
p1 = R 83.14
p2 = a
0.4274 R2 T2.5
c
Pc
= 1.5641 × 108
p3 = b 0.08664 R Tc
Pc
= 44.8909
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
19. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
p1 = R 83.14
p2 = a
0.4274 R2 T2.5
c
Pc
= 1.5641 × 108
p3 = b 0.08664 R Tc
Pc
= 44.8909
p4 = T 60 o
C
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
20. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
p1 = R 83.14
p2 = a
0.4274 R2 T2.5
c
Pc
= 1.5641 × 108
p3 = b 0.08664 R Tc
Pc
= 44.8909
p4 = T 60 o
C
p5 = P 1 bar
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
21. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
p1 = R 83.14
p2 = a
0.4274 R2 T2.5
c
Pc
= 1.5641 × 108
p3 = b 0.08664 R Tc
Pc
= 44.8909
p4 = T 60 o
C
p5 = P 1 bar
x = V
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
22. Solving for the root — Where to start?
Transforming the equation
Example
P =
RT
V − b
−
a
V(V + b)
√
T
Find V such that P = 1 atm and T = 60o
C
What are {pi } (the fixed parameters)?
p1 = R 83.14
p2 = a
0.4274 R2 T2.5
c
Pc
= 1.5641 × 108
p3 = b 0.08664 R Tc
Pc
= 44.8909
p4 = T 60 o
C
p5 = P 1 bar
x = V
f(V, {R; a; b; T; P}) = 1 −
RT
V − b
−
a
V(V + b)
√
T
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 6 / 16
23. fzero — The Matlab tool for solving Non-Linear equations
A typical problem
Find the molar volume of methyl chloride vapor such that at T = 60 ◦C the pressure is 1 bar.
Use the Redlich-Kwong Equation of State:
P =
RT
V − b
−
a
V(V + b)
√
T
Variable Value Unit
a 0.42748R2
Tc
2.5
Pc
cm6
·bar·K0.5
mol2
b 0.08664RTc
Pc
cm3
mol
R 83.14 cm3
·bar
mol·K
Tc 416.15 K
Pc 66.8 bar
Quick Solution with Matlab
Define the parameters. Note how the pressure is defined as a function_handle.
>> Pc = 66.8; Tc = 416.15; R = 83.14;
>> a = 0.42748 .* R^2 .* Tc .^ 2.5 ./ Pc;
>> b = 0.08664 .* R .* Tc ./ Pc;
>> T = 60 + 273.15;
5 >> P = @(V) R .* T ./ (V-b) - a ./ (V .* (V+b) .* sqrt(T));
>> root_finding_equation = @(V) 1 - P(V);
>> V = fzero( root_finding_equation, 30000 )
V = 27431.8744533891
Script-file: find_methyl_chloride_P.m
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 7 / 16
24. fzero — The Matlab tool for solving Non-Linear equations
A typical problem
Find the molar volume of methyl chloride vapor such that at T = 60 ◦C the pressure is 1 bar.
Use the Redlich-Kwong Equation of State:
P =
RT
V − b
−
a
V(V + b)
√
T
Variable Value Unit
a 0.42748R2
Tc
2.5
Pc
cm6
·bar·K0.5
mol2
b 0.08664RTc
Pc
cm3
mol
R 83.14 cm3
·bar
mol·K
Tc 416.15 K
Pc 66.8 bar
Quick Solution with Matlab
This is the important part! This function_handle will have a value of zero when the
correct molar volume is found.
>> Pc = 66.8; Tc = 416.15; R = 83.14;
>> a = 0.42748 .* R^2 .* Tc .^ 2.5 ./ Pc;
>> b = 0.08664 .* R .* Tc ./ Pc;
>> T = 60 + 273.15;
5 >> P = @(V) R .* T ./ (V-b) - a ./ (V .* (V+b) .* sqrt(T));
>> root_finding_equation = @(V) 1 - P(V);
>> V = fzero( root_finding_equation, 30000 )
V = 27431.8744533891
Script-file: find_methyl_chloride_P.m
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 7 / 16
25. fzero — The Matlab tool for solving Non-Linear equations
Quick Solution with Matlab
Now we solve for V numerically. fzero takes two arguments.
(1) The first is a function_handle that accepts exactly 1 argument.
(2) The second argument is an initial guess.
Why did I use 30000 for the initial guess? A few slides ago I plotted this function and
noted visually that the correct molar volume was around 30,000 cm3
mol
.
I just used fzero in OPEN mode. I’m telling Matlab to look near 30,000 cm3
mol
but I
place no restrictions on what range of molar volumes to try.
>> Pc = 66.8; Tc = 416.15; R = 83.14;
>> a = 0.42748 .* R^2 .* Tc .^ 2.5 ./ Pc;
>> b = 0.08664 .* R .* Tc ./ Pc;
>> T = 60 + 273.15;
5 >> P = @(V) R .* T ./ (V-b) - a ./ (V .* (V+b) .* sqrt(T));
>> root_finding_equation = @(V) 1 - P(V);
>> V = fzero( root_finding_equation, 30000 )
V = 27431.8744533891
Script-file: find_methyl_chloride_P.m
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 7 / 16
26. fzero — The Matlab tool for solving Non-Linear equations
Quick Solution with Matlab
Why did I use 30000 for the initial guess? A few slides ago I plotted this function and
noted visually that the correct molar volume was around 30,000 cm3
mol
.
I just used fzero in OPEN mode. I’m telling Matlab to look near 30,000 cm3
mol
but I
place no restrictions on what range of molar volumes to try.
We can also use fzero in CLOSED mode.
The initial guess I provided is a 2-element array.
It tells Matlab:
‘‘The root_finding_equation has a value of zero
somewhere between 20000 and 40000’’
>> Pc = 66.8; Tc = 416.15; R = 83.14;
>> a = 0.42748 .* R^2 .* Tc .^ 2.5 ./ Pc;
>> b = 0.08664 .* R .* Tc ./ Pc;
>> T = 60 + 273.15;
5 >> P = @(V) R .* T ./ (V-b) - a ./ (V .* (V+b) .* sqrt(T));
>> root_finding_equation = @(V) 1 - P(V);
>> V = fzero( root_finding_equation, [20000 40000] )
V = 27431.8744533891
Script-file: find_methyl_chloride_P.m
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 7 / 16
27. fzero — The Matlab tool for solving Non-Linear equations
Quick Solution with Matlab
We can also use fzero in CLOSED mode.
The initial guess I provided is a 2-element array.
It tells Matlab:
‘‘The root_finding_equation has a value of zero
somewhere between 20000 and 40000’’
If I’m wrong and root_finding_equation does not in fact have a zero in this
interval I’ll get an error
>> Pc = 66.8; Tc = 416.15; R = 83.14;
>> a = 0.42748 .* R^2 .* Tc .^ 2.5 ./ Pc;
>> b = 0.08664 .* R .* Tc ./ Pc;
>> T = 60 + 273.15;
5 >> P = @(V) R .* T ./ (V-b) - a ./ (V .* (V+b) .* sqrt(T));
>> root_finding_equation = @(V) 1 - P(V);
>> V = fzero( root_finding_equation, [20000 25000] )
??? Error using fzero (line 274)
??? The function values at the interval endpoints must differ in sign.
Script-file: find_methyl_chloride_P.m
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 7 / 16
28. Outline
1 Introduction
The solution of a non-linear equation is a Root Finding Problem
2 Built-In Solution in Matlab: fzero
3 Built-In Solution in Excel: Solver
Enabling the solver
Using the solver
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 8 / 16
29. Solving non-linear equations in Excel
Excel has a tool called Solver that can perform two different tasks
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 9 / 16
30. Solving non-linear equations in Excel
Excel has a tool called Solver that can perform two different tasks
1 Set the value of a cell to a particular value by changing other cells.
This is what we’re interested in right now.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 9 / 16
31. Solving non-linear equations in Excel
Excel has a tool called Solver that can perform two different tasks
1 Set the value of a cell to a particular value by changing other cells.
This is what we’re interested in right now.
2 Minimize/maximize the value of a cell by changing other cells.
We will come back to this one later.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 9 / 16
32. Solving non-linear equations in Excel
Excel has a tool called Solver that can perform two different tasks
1 Set the value of a cell to a particular value by changing other cells.
This is what we’re interested in right now.
2 Minimize/maximize the value of a cell by changing other cells.
We will come back to this one later.
The Solver Add-In is not enabled by default, although on College
of Engineering machines this has usually been done by the system
administrator.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 9 / 16
33. Solving non-linear equations in Excel
Excel has a tool called Solver that can perform two different tasks
1 Set the value of a cell to a particular value by changing other cells.
This is what we’re interested in right now.
2 Minimize/maximize the value of a cell by changing other cells.
We will come back to this one later.
The Solver Add-In is not enabled by default, although on College
of Engineering machines this has usually been done by the system
administrator.
If you don’t see the following under the Data tab in Excel, then the
next few slides show you how to get it.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 9 / 16
34. Enable the Solver Add-In
Go to the File tab and select Options
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 10 / 16
35. Enable the Solver Add-In
In the dialog that appears, select Add-Ins
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 10 / 16
36. Enable the Solver Add-In
In the next dialog, ensure that the Manage: box is showing Excel
Add-ins and select Go...
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 10 / 16
37. Enable the Solver Add-In
In the next dialog, ensure that Solver Add-in is checked and then
click OK
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 10 / 16
38. Outline
1 Introduction
The solution of a non-linear equation is a Root Finding Problem
2 Built-In Solution in Matlab: fzero
3 Built-In Solution in Excel: Solver
Enabling the solver
Using the solver
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 11 / 16
39. Using Solver to Solve Non-linear equations
A typical problem
Find the molar volume of methyl chloride vapor such that at T = 60 ◦C the pressure is 1 bar.
Use the Redlich-Kwong Equation of State:
P =
RT
V − b
−
a
V(V + b)
√
T
Variable Value Unit
a 0.42748R2
Tc
2.5
Pc
cm6
·bar·K0.5
mol2
b 0.08664RTc
Pc
cm3
mol
R 83.14 cm3
·bar
mol·K
Tc 416.15 K
Pc 66.8 bar
Here’s a good start to solving the problem. The way I’ve set this spreadsheet up so far
has a few features I’d like to point out.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 12 / 16
40. Good practice with spreadsheets
Formatting is important! Ask anyone who’s had to share a spreadsheet with their boss.
Make what you’re doing clear!
Use variable names
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 13 / 16
41. Good practice with spreadsheets
Formatting is important! Ask anyone who’s had to share a spreadsheet with their boss.
Make what you’re doing clear!
Use variable names
Use superscripts and subscripts and the Symbol font to make variable names
appear as close to their mathematical representation as possible.
The keyboard shortcut CTRL + 1 is worth leaning to make this chore easier.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 13 / 16
42. Good practice with spreadsheets
Formatting is important! Ask anyone who’s had to share a spreadsheet with their boss.
Make what you’re doing clear!
Use variable names
Use superscripts and subscripts and the Symbol font to make variable names
appear as close to their mathematical representation as possible.
The keyboard shortcut CTRL + 1 is worth leaning to make this chore easier.
Keep parameters (constants) separate from values that you will be changing
frequently.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 13 / 16
43. Good practice with spreadsheets
Formatting is important! Ask anyone who’s had to share a spreadsheet with their boss.
Make what you’re doing clear!
Use variable names
Use superscripts and subscripts and the Symbol font to make variable names
appear as close to their mathematical representation as possible.
The keyboard shortcut CTRL + 1 is worth leaning to make this chore easier.
Keep parameters (constants) separate from values that you will be changing
frequently.
Keep calculated values distinguished from user-manipulated values. In this
example values I entered manually Are in an easily recognized font.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 13 / 16
44. Good practice with spreadsheets
Formatting is important! Ask anyone who’s had to share a spreadsheet with their boss.
Make what you’re doing clear!
Use variable names
Use superscripts and subscripts and the Symbol font to make variable names
appear as close to their mathematical representation as possible.
The keyboard shortcut CTRL + 1 is worth leaning to make this chore easier.
Keep parameters (constants) separate from values that you will be changing
frequently.
Keep calculated values distinguished from user-manipulated values. In this
example values I entered manually Are in an easily recognized font.
Include units!! Again, take the time to use superscripts.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 13 / 16
45. Good practice with spreadsheets
Use Names to Make Formulas Readable
Make what you’re doing clear!
The box to the left of the formula bar is for giving cells human-friendly names.
Use it!
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 14 / 16
46. Good practice with spreadsheets
Use Names to Make Formulas Readable
Make what you’re doing clear!
The box to the left of the formula bar is for giving cells human-friendly names.
Use it!
Some names (like R) can’t be used. I usually append an underscore _ when
this is the case.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 14 / 16
47. Good practice with spreadsheets
Use Names to Make Formulas Readable
Make what you’re doing clear!
The box to the left of the formula bar is for giving cells human-friendly names.
Use it!
Some names (like R) can’t be used. I usually append an underscore _ when
this is the case.
For variables with numerical subscripts, e.g., T1, enter the name as T_1.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 14 / 16
48. Good practice with spreadsheets
Use Names to Make Formulas Readable
Make what you’re doing clear!
The box to the left of the formula bar is for giving cells human-friendly names.
Use it!
Some names (like R) can’t be used. I usually append an underscore _ when
this is the case.
For variables with numerical subscripts, e.g., T1, enter the name as T_1.
Look at how nice my formula for a is to read, it gives you a warm and fuzzy
feeling doesn’t it?
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 14 / 16
49. Good practice with spreadsheets
Use Names to Make Formulas Readable
Make what you’re doing clear!
The box to the left of the formula bar is for giving cells human-friendly names.
Use it!
Some names (like R) can’t be used. I usually append an underscore _ when
this is the case.
For variables with numerical subscripts, e.g., T1, enter the name as T_1.
Similarly, I can also tell by looking at the cell formula that this is the RK
Equation of State.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 14 / 16
50. Setting up the problem for Solver
Now I’m going to define my root-finding cell.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 15 / 16
51. Setting up the problem for Solver
Now I’m going to define my root-finding cell.
And now open up the Solver (it’s in the Data tab).
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 15 / 16
52. The Solver dialog.
The Solver dialog has a lot going on inside of it. For now, we only
need to use the top three rows.
Set Objective This is the address of the cell you want to solve for.
We want the Difference: cell to assume a value of 0.
Click that cell and its address will appear in the Set
Objective box.
To: Here is where we decide between root-finding (Value
of:) and min/max problems.
We want the difference between the actual pressure
and 1 bar to be 0, so Value of: should be selected
with a value of 0 in the box.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 16 / 16
53. The Solver dialog.
Now tell Solver which cells to manipulate in order to make the
difference 0. Click on the Range Selector Tool
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 16 / 16
54. The Solver dialog.
We want to change the molar volume. Click it
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 16 / 16
55. The Solver dialog.
We’re ready! Click Solve
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 16 / 16
56. The Solver dialog.
All done. Notice the volume has changed to 27431.9, and the
Difference: is 8.48e-07. Pretty close to zero. If that’s not close
enough, we can tweak the tolerance in the Solver.
Che 310 | Chapra 5.1–5.2 | Intro to Root-Finding 4 — Intro to NLEs September 19, 2017 16 / 16