In this section we will get Solver set up in Excel, and try an example to demonstrate different ways of solving equations in Excel.

Similar documents
Graphing Parabolas With Microsoft Excel

A Guide to Using Excel in Physics Lab

Curve Fitting in Microsoft Excel By William Lee

Plots, Curve-Fitting, and Data Modeling in Microsoft Excel

Absorbance Spectrophotometry: Analysis of FD&C Red Food Dye #40 Calibration Curve Procedure

FREE FALL. Introduction. Reference Young and Freedman, University Physics, 12 th Edition: Chapter 2, section 2.5

Using Microsoft Excel to Plot and Analyze Kinetic Data

Using Excel to find Perimeter, Area & Volume

How to Create a Data Table in Excel 2010

Spreadsheets and Laboratory Data Analysis: Excel 2003 Version (Excel 2007 is only slightly different)

Years after US Student to Teacher Ratio

Creating an Excel XY (Scatter) Plot

Excel Math Project for 8th Grade Identifying Patterns

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

Microsoft Excel Tutorial

APPLYING BENFORD'S LAW This PDF contains step-by-step instructions on how to apply Benford's law using Microsoft Excel, which is commonly used by

Generating ABI PRISM 7700 Standard Curve Plots in a Spreadsheet Program

Summary of important mathematical operations and formulas (from first tutorial):

Scientific Graphing in Excel 2010

USING EXCEL 2010 TO SOLVE LINEAR PROGRAMMING PROBLEMS MTH 125 Chapter 4

Cellular Computing on a Linux Cluster

Data representation and analysis in Excel

To launch the Microsoft Excel program, locate the Microsoft Excel icon, and double click.

0 Introduction to Data Analysis Using an Excel Spreadsheet

University of Southern California Marshall Information Services

Tools for Excel Modeling. Introduction to Excel2007 Data Tables and Data Table Exercises

Below is a very brief tutorial on the basic capabilities of Excel. Refer to the Excel help files for more information.

Excel -- Creating Charts

Introduction to Data Tables. Data Table Exercises

SOLVING EQUATIONS WITH EXCEL

User Guide. Opening secure from the State of Oregon Viewing birth certificate edits reports in MS Excel

Using Excel (Microsoft Office 2007 Version) for Graphical Analysis of Data

Math 132. Population Growth: the World

Calibration and Linear Regression Analysis: A Self-Guided Tutorial

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

1. Go to your programs menu and click on Microsoft Excel.

This activity will show you how to draw graphs of algebraic functions in Excel.

3.2. Solving quadratic equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

Basic Pivot Tables. To begin your pivot table, choose Data, Pivot Table and Pivot Chart Report. 1 of 18

Linear Programming. Solving LP Models Using MS Excel, 18

Interactive Excel Spreadsheets:

Appendix 2.1 Tabular and Graphical Methods Using Excel

Coins, Presidents, and Justices: Normal Distributions and z-scores

Excel Basics By Tom Peters & Laura Spielman

Statgraphics Getting started

"Excel with Excel 2013: Pivoting with Pivot Tables" by Venu Gopalakrishna Remani. October 28, 2014

Sensitivity Report in Excel

Tutorial on Using Excel Solver to Analyze Spin-Lattice Relaxation Time Data

Construction Administrators Work Smart with Excel Programming and Functions. OTEC 2014 Session 78 Robert Henry

Excel 2007 Basic knowledge

TI-Nspire CAS Graphing Calculator

Excel Tutorial. Bio 150B Excel Tutorial 1

Spreadsheet. Parts of a Spreadsheet. Entry Bar

Intermediate PowerPoint

The Circumference Function

GeoGebra Statistics and Probability

Table of Contents TASK 1: DATA ANALYSIS TOOLPAK... 2 TASK 2: HISTOGRAMS... 5 TASK 3: ENTER MIDPOINT FORMULAS... 11

Create a PivotTable or PivotChart report

Using Excel for descriptive statistics

Microsoft Excel Basics

Mail Merge Creating Mailing Labels 3/23/2011

Lab 11: Budgeting with Excel

ENGG1811 Computing for Engineers. Data Analysis using Excel (weeks 2 and 3)

MARS STUDENT IMAGING PROJECT

WEBFOCUS QUICK DATA FOR EXCEL

Excel 2010: Create your first spreadsheet

Intro to Excel spreadsheets

A simple three dimensional Column bar chart can be produced from the following example spreadsheet. Note that cell A1 is left blank.

Microsoft Excel 2010 Training. Use Excel tables to manage information

Advanced Excel Charts : Tables : Pivots : Macros

POLYNOMIAL FUNCTIONS

Spreadsheet - Introduction

Question 2: How will changes in the objective function s coefficients change the optimal solution?

Call Centre Helper - Forecasting Excel Template

Solving Linear Programs in Excel

STC: Descriptive Statistics in Excel Running Descriptive and Correlational Analysis in Excel 2013

Figure 1. An embedded chart on a worksheet.

Efficient Portfolios in Excel Using the Solver and Matrix Algebra

Excel Guide for Finite Mathematics and Applied Calculus

Exploring Relationships between Highest Level of Education and Income using Corel Quattro Pro

Quickstart for Desktop Version

Chapter 9 Creating Reports in Excel

. Address the following issues in your solution:

Excel Spreadsheet Activity Redo #1

Dealing with Data in Excel 2010

Tutorial: Using Excel for Linear Optimization Problems

Assignment objectives:

Microsoft Access Rollup Procedure for Microsoft Office Click on Blank Database and name it something appropriate.

Chapter 27: Taxation. 27.1: Introduction. 27.2: The Two Prices with a Tax. 27.2: The Pre-Tax Position

An Introduction to Excel Pivot Tables

INTRO TO EXCEL SPREADSHEET

5 Systems of Equations

Finding Drag Coefficient using Solidworks Flow Simulation

Downloading RIT Account Analysis Reports into Excel

What is the difference between simple and compound interest and does it really matter?

Step Sheet: Creating a Data Table and Charts

EXCEL FINANCIAL USES

Making a Chart Using Excel

How To Run Statistical Tests in Excel

Using Microsoft Word. Working With Objects

Transcription:

LAB FIVE Modelling in Excel Exercises marked with a are based on material from A Guide to Microsoft Excel 2007 for Scientists and Engineers, Bernard Liengme, 2009. 5.1 Walkthrough examples In this section we will get Solver set up in Excel, and try an example to demonstrate different ways of solving equations in Excel. 5.1.1 Walkthrough 1: Setting up Solver The first time you use Solver you may have to install it on your machine. To do this, open up Excel. 1. Check if Solver is already installed (in the labs at uni, this may well have been done already). Look under the Data tab for the Data Analysis category; is Solver listed? If not, continue with the steps below. 2. Click on the main menu button and go to Excel Options 3. Go to the Add-ins tab, choose Solver and click Go 4. Check the Solver box and click OK Solver should now install on your machine 5. You should now see it on the Data tab, under Data Analysis 1

5.1.2 Walkthrough 2: Solving an Equation This walkthrough demonstrates different ways of solving equations using Excel. Find the roots of the equation in the range 0 < x < 1 e x sin(x) = 0 (5.1) in these different ways: A) By plotting Plot the curves y = e x and y = sin(x) and locate the point where the curves cross. Set up a spreadsheet with three columns: x, exp( x) and sin(x). It should look something like this: Add a chart with x on the x-axis and the two functions on the y-axis. It should look something like this: Determine the root of the equation by visually finding the x value of the point at which the curves cross. Check this is reasonable by substituting x into the original equation, either analytically or using Excel. B) Using GoalSeek One way you could try to find roots of the equation is set up a spreadsheet with x and f (x) and guess values of x until f (x) equals zero. This is exactly what GoalSeek will do for you! Set up a spreadsheet with cell A5 equal to x and cell B5 equal to f (x) i.e. =exp(-a5)-sin(a5). It should look something like this: it contains the formula James Curran and Tara Murphy 2

Now go to the Data tab and under What-if-Analysis, run Goal Seek. Choose to set cell B5 to value 0 by changing A5 This should result in an answer of x = 0.589 as shown below C) Using Solver Finally, we can use Solver, a more powerful optimisation tool. This is not strictly necessary for this problem GoalSeek does a good job, but it is useful to try it out on a problem we already know the answer to. Set up the same spreadsheet as for part (B) Go to the Data tab and under Analysis, run Solver. There are multiple ways you can use Solver, but we are going to use it with constraints because this generalises well to harder problems. So, enter the constraint B5=0 as shown below You can now Solve and should get a similar answer to your previous methods. James Curran and Tara Murphy 3

5.2 Exercises 5.2.1 Modelling Recall the predator-prey model we discussed in Lecture 4: Problem: An ecological niche contains two species: one is the prey, the other the predator. A theoretical analysis of the problem has yielded equations for the successive population of the two species: where N t+1 = (1.0 B(N t 100))N t KN t P t P t+1 = QN t P t N t P t the population of prey in generation t the population of predators in generation t B the net birth-rate factor K the kill-rate factor Q efficiency in use of prey The initial parameters for this model are N 0 = 50, P 0 = 0.2, B = 0.005, K = 0.5 and Q = 0.0205. Set up this model in a spreadsheet and create a graph of the change predator population and prey population with generation. Experiment to see what happens when you 1. Increase/decrease the birth-rate 2. Change the size of the starting population 3. Increase/decrease the efficiency factor (Q) 5.2.2 Solving equations Solve the system of non-linear equations below by considering them as constraints in Solver. x 2 + 2y 2 = 22 2x 2 + xy 3y = 11 (5.2) (5.3) Confirm your answer by plotting the functions over a suitable range. 5.2.3 Maximising area The area of a rectangle is given by A = xy. What will the x,y coordinates for the top right corner of the rectangle below be, such that it touches the curve 3y = 18 2x 2 (5.4) and the area of the rectangle is maximised? James Curran and Tara Murphy 4

5.2.4 1D Game of Life The Game of Life is the best know example of a cellular automaton and is one of the most famous games in computer science. Each cell in a 2D grid is allowed to be alive or dead. It works iteratively according the following rules: 1. Any live cell with fewer than two live neighbours dies, as if by needs caused by underpopulation. 2. Any live cell with more than three live neighbours dies, as if by overcrowding. 3. Any live cell with two or three live neighbours lives, unchanged, to the next generation. 4. Any dead cell with exactly three live neighbours becomes a live cell. See http://en.wikipedia.org/wiki/conway s_game_of_life for more details and demos. Cellular automata are used widely in simulations in fields such as biology and economics. They are also of interest to computer scientists because cellular automata are Turing complete which means that any program could be rewritten using cellular automata (scary!). In this exercise you have to set up a 1D cellular automaton that evolves by iterating down the rows in a spreadsheet. To do this Set up a seed generation in row 1 of your spreadsheet. You should use the values of 1 and 0 for alive and dead. The initial generation should evolve according to the following rules, illustrated graphically below So, for example, if in generation 1, cells D1, E1 and F1 are all alive, then in generation 2, cell E2 will be dead (due to overcrowding!). If in generation 1, cells D1 and E1 were alive, but F1 was dead, then in generation 2, cell E2 would be alive. Fill in the appropriate formulae in row 2 such that when you drag the formulae down the spreadsheet, the Game will play out. As a test case, if you start with a 5 column game, with 0,0,1,0,0 in the first generation, you should end up with the pattern Hint: Assume the columns wrap around, so the parents of cell E2 in a 5 column game are D1, E1 and A1. Hint: Conditional formatting makes the game look better! 5.2.5 2D Game of Life Challenge question Note that this material is not assessable but it is fun! Try setting up a 2 dimensional Game of Life, following these instructions http://blogs.msdn.com/excel/archive/2007/11/02/iteration-conway-s-game-of-life.aspx Try implementing some of the famous Game of Life phenomena, such as gliders and pulsars http://en.wikipedia.org/wiki/conway s_game_of_life James Curran and Tara Murphy 5

5.3 Capability checklist When you ve finished this lab, check that you know how to... 1. Plot data in Excel 2. Use relative and absolute cell referencing 3. Solve an equation using GoalSeek 4. Solve an equation using Solver If you don t know how to do any of these things once you have completed the lab, please come and ask us. You should also use this checklist when you are revising for the practical test. James Curran and Tara Murphy 6