Results 1 to 14 of 14

Thread: Gradients

  1. #1
    ricmitch_uk
    Guest
    Does anyone know the formula to find the gradient at any point on any curve. Experts only.

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    You can differentiate a function f to get a function f' that gives the gradient of f at any point. It's not complicated, but does require some knowledge of the differential calculus (the easier part of calculus). Fo instance, the gradient m of f(x) = x² at any point is m = 2x.

    If you want to differenctiate a specific function, then that's easy enough to do, but if you want a method for differentiating a general function, well.... go learn calculus.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    ricmitch_uk
    Guest
    And where do I do that? (Quickly?)

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Hmm, well I'm not sure if there is a quick way of doing it. You probably ought to take A-Level maths. I guess you can skip the derivations and just get the idea though. www.quickmath.com probably has some explanations. I use their online maths tools to differentiate things when I'm feeling lazy.
    Harry.

    "From one thing, know ten thousand things."

  5. #5
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    English versus Americanese?

    In Americanese, we call it a derivative. Is gradient the English term?

    In Americanese, gradient might be a synomyn, but I am not sure. I remember the context temperature gradient, referring to a metal rod forced to have different, but fixed, temperatures at opposite ends.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    well in swedish terms gradient is a vector of the derivates of a multiple variable function, dunno but it might be the same globally, the derive is then a scalar

    btw harry, do you think there's source out there that does differential calculus?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    ricmitch_uk
    Guest
    I found this site, www.calculus.net but it's pretty slow. All the documents are in .PDF format so you need Acrobat.

  8. #8
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Well the terms 'gradient' and 'derivative' aren't exactly interchangeable... You might talk about the gradient of a slope, not in maths but in general life. Like the gradient of a set of stairs, how fast they descend. So yeah it is the derivative I guess, but a more basic word for it.

    Anyway, what do you mean by a source that 'does' differential calculus Ked? Do you mean a tool that does it for a given function you provide, or a tutorial of some sort... or what? I find www.quickmath.com quite useful for tools.
    Harry.

    "From one thing, know ten thousand things."

  9. #9
    ricmitch_uk
    Guest
    OK. I sort of need an answer to this tonight. What is the formula(just write it out), and why does it work?

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    i meant source code, api's would be acceptable too.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  11. #11
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    http://www.quickmath.com/www02/pages...ic/index.shtml
    theres a textbox you enter the expression you want to differentiate.
    To differentiate without a tool you need a bunch of formulas and rules you use in combinations from case to case, nothing you'd learn in one day
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  12. #12
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Oh, yeah I expect there's something out there. Don't know where though.

    What kind of functions do you want to differentiate in code? Simple ones shouldn't be too hard to figure out.

    The explanation for it involves limits, taking gradients of lines drawn between ever closer points on the function you want to differentiate, eventually so close together that you don't consider them to be different points. Well I don't think that's exactly how a textbook would explain it but I suggest you go look it up. Why do you need to know? To be honest I doubt you need calculus for anything below A-Level maths standard.
    Harry.

    "From one thing, know ten thousand things."

  13. #13
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Use Differentiation

    As HarryW said, use differentiation.
    Code:
    f(x) = x^n 
    
    dy/dx = nx^(n-1) 'Gradient of function
    When a function is differentiated, you multiply the term by the power, then take 1 from the power. Do this for each term in a fucntion.

    i.e. Find the gradient at the point (1, 4) on the curve y = x^2+3x.

    First, differentiate the function.

    x^2+3x dy/dx = 2x+3

    We have the point (1, 4), the x value is 1, so we substitute 1 into the differentiated function.

    2*1+3 = 5

    So at the point (1, 4) on the curve y = x^2+3x, the gradient is 5.

    Hope this helps in some way.

    Laterz
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  14. #14
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    well similar to the one on the page, pass expression in a string and return derivative/integral expression, when possible, with respect to one variable, for any expression you can compose with vb that doesn't contain such like rnd or nonnumeric-aritmetical functions/operators
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width