Wikiposts
Search

Notices
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

microsoft excel graphs

Thread Tools
 
Search this Thread
 
Old 28th February 2002 | 22:38
  #1 (permalink)  
Thread Starter
 
Joined: Aug 2001
Posts: 28
Likes: 0
From: Berkshire, United Kingdom
Post microsoft excel graphs

does anyone know how within excel you can get the gradient of a curve at the points plotted, i.e. take the tangent of the curve at the point and then take the gradient of that curve.

Any help Much appreciated

Michael Fuller PAFP. [email protected]
mfuller_uk is offline  
Old 7th March 2002 | 18:17
  #2 (permalink)  
 
Joined: Jan 2002
Posts: 46
Likes: 0
From: Not too far from Shoreham UK
Thumbs up

Vaguely, although you can't do it directly with the plotted line.. .. .<thinks back to A level Maths>. .. .Gradient of curve at a point = dy/dx .. .. .You know that the gradient can be expressed as the angle between the x-axis and the point on the curve. Simple Trigonometry tells you that:. .. .Tan A = Opposite / Adjacent. .(where A is the Gradient). .Therefore:. .A = ArcTan (Opposite / Adjacent). .. .which in our case is :. .. .Gradient = ArcTan (Y/X) . .. .Now, remember I said that gradient = dY / dX ?. .That says that for a very small change in the values of Y and X this is true.. .. .So you need to have 2 points very close to one another on your curve to be able to calculate the gradient. Assuming you have 2 such points in your data, called X1,Y1 and X2,Y2:. .. .Gradient = ArcTan ((X2-X1) / (Y2-Y1)) in degrees.. .. .So find the ARCTAN function on the Excel menu and find the 2 coordinates you need. . .. .Hope this helps
GeneralElectric is offline  
Old 7th March 2002 | 20:54
  #3 (permalink)  
 
Joined: Apr 2001
Posts: 871
Likes: 0
From: Chichester, UK
Post

Depends on the curve though. You've got to worry about it being both smooth and differentiable (I think) - books have been written on this <img border="0" title="" alt="[Smile]" src="smile.gif" /> . .. .For example, if you're trying to work with tan(theta), it breaks down at theta = pi/2 radians as the function is discontinuous there. . .. .If you're really keen on this then I'd look up a suitable method in <a href="http://www.ulib.org/webRoot/Books/Numerical_Recipes/bookfpdf.html" target="_blank">Numerical Recipes</a> and then try to implement this using Excel - if that's possible. . .. .Another possible approach is to fit something differentiable to your data and then differentiate it yourself, which will give you an analytic expression for the gradient at any point. For example, say your data is well fit by a polynomial y(x) = x**3 - 2x + 1, this can be differentiated trivially to give the gradient y'(x).. .. .It's hard to know without the function <img border="0" title="" alt="[Smile]" src="smile.gif" />
Evo7 is offline  
Old 8th March 2002 | 01:52
  #4 (permalink)  
 
Joined: Dec 2001
Posts: 140
Likes: 0
From: STL
Post

Correct Evo7. Don't see much of x**3 or references to the Fortran version of Numerical Recipes these days! . .. .I don't think Excel is the right tool for the job but if it is a requirement that the wrong tool be used, then one of Excel's curve-fitting algorithms can be used (linear, logarithmic, polynomial, power, exponential). On the Options tab select "Display equation on chart". This will produce an equation of the form y = f(x). It will be smooth and therefore have a tangent line. The slope at (c,f(c)) can then be calculated by (f(c+h/2)-f(c-h/2))/h where h is a small number. How small? Depends on how many decimal places Excel uses. If single precision, I'd try h = E-04; if double, then h = E-06 will work fine. Because of "loss of significance" too small a value will give inaccurate results.. .. .One caveat - a curve might fit data very well without its slope doing the same. For example, y = x + sin((10**20)*x)/(10**14) is a good fit of y = x but its slope is not close to 1 for most x.. .. .As Samuel Johnson said of graphing with Excel: "It is not done well; but you are surprised to find it done at all." Maple is the thing to use.
bblank is offline  
Old 8th March 2002 | 13:42
  #5 (permalink)  
 
Joined: Jan 2002
Posts: 46
Likes: 0
From: Not too far from Shoreham UK
Post

Gosh, it's all coming back now.... time to reach for my old course books again!. .. .Brian - noticed you're a learned mathematician, do you know of any decent online text books on (eg) calculus, trig, etc?
GeneralElectric is offline  
Old 8th March 2002 | 22:19
  #6 (permalink)  
 
Joined: Dec 2001
Posts: 140
Likes: 0
From: STL
Post

I'm still learning GE. For now I think standard textbooks remain the best option. Three reasons for that. 1) To write a good tutorial one needs the hope of some compensation for the effort. 2) Web authors are pretty much on their own without a publisher to get feedback. 3) The web has not yet reached the point of properly supporting mathematical typography. Most technical reports are now written using a typesetting program called TeX (or a derivative of it such as LaTeX). There is a tool for converting TeX source to HTML but each mathematical formula must be converted to a gif. Even small documents often contain hundreds of files. It is not too pleasant for the web author and not too pleasant for the browser either. . .. .The World Wide Web Consortium (W3C) has had a committee working on math support for several years now. The ultimate goal is for browsers to utilize MathML, an application of XML. For most surfers that means MS IE. Microsoft does have a member on the committee (as does Boeing) but its interest in the project appears to be limited - there isn't much of a commercial payoff.. .. .If you want to investigate web supplements to a standard textbook then you might try links at. .<a href="http://directory.google.com/Top/Science/Math/Calculus/" target="_blank">http://directory.google.com/Top/Science/Math/Calculus/</a>. .But the ones that I've looked at don't seem to merit a recommendation.
bblank is offline  

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.