graph a piecewise function

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I need to graph a piecewise function. For example:

f(x) = 700 + 0.15(x - 700) where 7000 < x <= 28400

Any ideas how to do this in Excel 2002 (Office XP)?

Any help is greatly appreciated!

Thanks!

-Jason
 
Hi Jason
one way:
- Create a table with x values in column A (according to your range /
though you might want to add a step factor. e.g. enter the following in
A1:
=7000+(ROW(A1)-1)*100
- In column B1 enter the formula =700+0.15*(A1-700)
- copy this down
- create a XY scatter chart based on these two columns

another way using named ranges/formulas (for an example regarding the
normal curve see
http://www.tushar-mehta.com/excel/charts/normal_distribution/index.htm)
:
1. Enter the following data in your spreadsheet (assumption: Sheet1):
A B
1 MinX 7000
2 MaxX 28400
3 Step 100

2. Create names for this data (goto 'Insert - Name - Define')
MinX: =$B$1
MaxX: =$B$2
Step: =$B$3

3. Create additional names for the X and Y values:
Function_X:
=ROW(OFFSET('Sheet1'!$A$1,0,0,(MaxX-MinX)/Step))*Step+MinX
Function_Y: =700+0,15*(Function_X-700)

4. Select an empty cell (with no data in adjacent cells) an insert a
new chart. Choose XY Scatter and click on the second tab 'Series'.
click on the Add Button. Enter the following as X_Values and Y_Values:
X_Values: ='Book1.xls'!Function_X
Y_Values: ='Book1.xls'!Function_Y
where book1.xls is the name of your workbook.

5. Finish the creation of your chart (formating, etc.)

You can change the MinX, MinY and Step values on your worksheet. the
chart will be updated automatically

If you have further questions send me an email and i'll send you and
example spreadsheet for this function

HTH
Frank
 
On correction: Typo in the definition of Function_X
Function_Y: =700+0,15*(Function_X-700)
should be changed to
Function_Y: =700+0.15*(Function_X-700)

Frank
 
Back
Top