Implementing our backward order final equation

Slides:



Advertisements
Similar presentations
Example 1 Matrix Solution of Linear Systems Chapter 7.2 Use matrix row operations to solve the system of equations  2009 PBLPathways.
Advertisements

1.2 Row Reduction and Echelon Forms
Linear Equations in Linear Algebra
Taking a Square Root to Solve an Equation. Solve: In order to solve for x, you have to UNDO the squared first (i.e. square root) What are the number(s)
EXAMPLE 2 Solve a matrix equation SOLUTION Begin by finding the inverse of A = Solve the matrix equation AX = B for the 2 × 2 matrix X. 2 –7 –1.
Solving Equations with variables on both sides of the Equals Chapter 3.5.
COMP 116: Introduction to Scientific Programming Lecture 7: Matrices and Linear Systems.
Solving Systems of Equations
Using LU Decomposition to Optimize the modconcen.m Routine Matt Tornowske April 1, 2002.
Row Reduction Method Lesson 6.4.
9.2 Solving Systems of Linear Equations by Addition BobsMathClass.Com Copyright © 2010 All Rights Reserved. 1 Step 1.Write both equations in the form Ax.
1 Discretizing The Concentration Equation Mike Grimm Math 1110 March 11, 2002.
13.6 MATRIX SOLUTION OF A LINEAR SYSTEM.  Examine the matrix equation below.  How would you solve for X?  In order to solve this type of equation,
ENE MATHLAB ® Lecture 3: Matrix Review. Determinant  To use MATLAB to compute determinants:  Enter the determinant as an array.  Use ‘det’ command.
Solving Systems Using Elimination
Linear Equations in Two Variables A Linear Equation in Two Variables is any equation that can be written in the form where A and B are not both zero.
Solving Quadratic Equations Quadratic Equations: Think of other examples?
2010.  A first degree equation is called a linear equation in two variables if it contains two distinct variables.
Slide Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley A set of equations is called a system of equations. The solution.
Elimination Method: Solve the linear system. -8x + 3y=12 8x - 9y=12.
Chapter 2 Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter 2-1 Solving Linear.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
Solving Linear Systems by Substitution
RECOGNIZING INCONSISTENT LINEAR SYSTEMS. What is an Inconsistent Linear System?  An inconsistent linear system is a system of equations that has no solutions.
GUIDED PRACTICE for Example – – 2 12 – 4 – 6 A = Use a graphing calculator to find the inverse of the matrix A. Check the result by showing.
Finding Grid Point Neighbors Matt Craven for: Dr. Anitescu Math 1110 Spring 2002.
SOLVING SYSTEMS USING ELIMINATION 6-3. Solve the linear system using elimination. 5x – 6y = -32 3x + 6y = 48 (2, 7)
Solving Equations Using Addition or Subtraction Objective: Students will solve linear equations using addition and subtraction.
2.5 – Determinants and Multiplicative Inverses of Matrices.
Solve Equations With Variables on Both Sides. Steps to Solve Equations with Variables on Both Sides  1) Do distributive property  2) Combine like terms.
Solving Multi-Step Equations Using Inverse Operations.
Solving equations with variable on both sides Part 1.
2 2.5 © 2016 Pearson Education, Ltd. Matrix Algebra MATRIX FACTORIZATIONS.
Warm Up Simplify each expression. 1.10c + c 2. 5m + 2(2m – 7) 11c 9m – 14.
1 1.2 Linear Equations in Linear Algebra Row Reduction and Echelon Forms © 2016 Pearson Education, Ltd.
Elimination Method - Systems. Elimination Method  With the elimination method, you create like terms that add to zero.
1 CHAP 3 WEIGHTED RESIDUAL AND ENERGY METHOD FOR 1D PROBLEMS FINITE ELEMENT ANALYSIS AND DESIGN Nam-Ho Kim.
Standard form and Point-slope form of linear equations
The Inverse of a Square Matrix
Inverse of a Square Matrix
Explicit Approximation
To make a Quadratic Equation, you let the Expression equal zero.
Linear Equations.
L9Matrix and linear equation
7-3 Solving Subtraction and Addition Equations
Solving Literal Equations
CHAPTER 9: GAUSSIAN ELIMINATION.
Break even or intersection
Depicting the Concentration
Simple linear equation
FEM Steps (Displacement Method)
Solving Linear Systems
Finding A Better Final Discretized Equation
4-2 Adding & Subtracting Matrices
Linear Equations in Linear Algebra
Lecture 11 Matrices and Linear Algebra with MATLAB
2 Understanding Variables and Solving Equations.
Simultaneous Equations
Use Inverse Matrices to Solve 2 Variable Linear Systems
2 Understanding Variables and Solving Equations.
Unit 3: Matrices
Equations of Straight Lines
Linear Algebra Lecture 3.
One step equation with Addition and Subtraction
Solving 1-Step Integer Equations
2 Equations, Inequalities, and Applications.
Solve the linear system.
Linear Equations in Linear Algebra
NULL SPACES, COLUMN SPACES, AND LINEAR TRANSFORMATIONS
Multiply by 5/40 and sum with 2nd row
Presentation transcript:

Implementing our backward order final equation Jennifer Tanyer March 27, 2002

Goals: Balance the discretized equation from Bob’s presentation Develop a system of linear equations from the given equation Modify previous code to solve the implicit function and get values for our unknown concentration at time t+1

Our backward order discretized equation: From Bob’s presentation:

Problems with this equation: The system is not balanced. i.e.(# of variables on the LHS  # of variables on the RHS) LHS accounts for interior nodes only RHS accounts for interior and boundary nodes # of Unknowns > #of Equations because of this. The difference in the number is due to the lack of representation for the boundary points

Solutions: Add the boundary condition for each boundary node onto the LHS of the equation: c(x,y,t) = 0. Since we can’t solve this system explicitly, we must generate a system of linear equations that establish an algorithm for solving for our unknowns Our unknown : concentration at time t + 1

Step 1: Developing the new linear system Place all of our unknowns: t + 1 onto the LHS of our equation The RHS will be equal to our concentration at time t

Step 1:

Step 2: Replace equations with their proper node labels

Step 3: Combine like terms Refer to poisson.m These new combined equations will represent w(k,k), w(k,E), w(k,W), w(k,N), and w(k,S) respectively.

Step 4: Implement the new equation into ‘concentrate.m’ %Modified concentrate.m deltat=0.5; D=0.1; rho=1; time=10; ntimes=round(time/deltat); NRPOINTS=max(size(a10)); for k=1:NRPOINTS Position=a10(k,1:2); Concentration(k,1)=g(Position); end

Modified concentration.m continued… for m=1:ntimes m w = zeros(1528, 1528); rhs = zeros(1528,1); deltaXsq = 1/deltaX^2; deltaYsq = 1/deltaY^2; for k = 1:1528 N = nb(k,find((nbor(k,:) == 1))); W = nb(k,find((nbor(k,:) == 3))); S = nb(k,find((nbor(k,:) == 5))); E = nb(k,fgind((nbor(k,:) == 7)));

gAnd finally… uy = scaledvelocity(k,2); ux = scaledvelocity(k,1); if(~g(N) & ~isempty(W) & ~isempty(S) & ~isempty(E)) ux = scaledvelocity(k,1); uy = scaledvelocity(k,2); w(k,N) = ((D/rho) * (1/deltaYsq) – uy * (1/(deltaY)*2)); w(k,S) = ((D/rho) * (1/deltaYsq) + uy * (1/(deltaY)*2)); w(k,E) = ((D/rho) * (1/deltaXsq) - ux * (1/(deltaX)*2)); w(k,W) = ((D/rho) * (1/deltaXsq) + ux * (1/(deltaX)*2)); w(k,k) = (-1/deltat – (D/rho)*(2/(deltaXsq)) – (D/rho) *(2/(deltaYsq)); rhs(k,1) = concentration(k,m)/deltat; else w(k,k) = 1; rhs(k,1) = 0; end xjen=w\rhs; concentration(:,m+1)=xjen;

In the End… You now have an algorithm of linear equations that you can solve to get a 1532 x 1532 matrix of concentrations at each node. You can use MATLAB to solve Ax = b (w * x) = rhs by using either 1.The inverse of A >>x=inv(A)*b OR 2.Row Reduction >>x1=A\b We no longer have approximate values for our concentrations…we now have actual values