TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

Determining straightest line from slopes

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming
Author Message
blcArmadillo



Joined: 20 Oct 2007
Posts: 2

PostPosted: March 6, 2008 12:33 AM    Post subject: Determining straightest line from slopes Reply with quote

I've written a program to quickly find the order of reactants for a given element in an integrated rate law for use in my AP Chemistry class. However, I'm running into one slight problem. The way you pick the order of reactants is by graphing three graphs: [A] versus t, ln[A] versus t, and 1/[A] versus t where [A] is concentration and t is time. You then pick the graph that produces the straightest graph. The way I've handled this is you enter in the time and respective concentrations, the program then finds out what the slopes would be between each of the plots on all three of the graphs. Then to make the program easy to use, I want to compare all the slopes for ever consecutive points and output which one is most consistent. I initially did this by outputting the slopes to a list and then using the variance command. However, when testing the program I realized I had made a huge blunder seeing as if the graph of [A] versus t produces extremly small slopes (on the order of 10^-5) but deviate further from the slope of a straight line as compared to if a graph of say ln[A] versus t produced a vary straight line but has smaller slopes (on the order of 10^-2) than if you assume that the most accurate line is the one with the least variance you will be lead astray since the small slopes but less straight graph will give you a small (on the order of 10^-5) value of variance compared to the more linear graph. Does anyone know how I would go about using the slopes to calculate how far they deviate from a straight line and then output the result with 0 (zero) signifying a perfectly straight line and anything greater then zero signifying increasing curvature? One way I though of was using:

Code:
abs(0-mean(d)/median(d))      //d is the list holding the slopes

This worked however I'm not sure that it will work for all cases. Any input would be great. Sorry for the lengthy description/explanation. Thanks in any help you can give me, it's greatly appreciated.

-Ian B.
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic : View next topic  
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Contact Us | Privacy Policy | Disclaimer | Trademarks

Copyright ©2006 All rights reserved.


Free Greeting Cards | Girly Myspace Layouts | Myspace Unblocker |