Integration

This is a discussion on Integration within the C Programming forums, part of the General Programming Boards category; Does anybody know how to do a maths integration in C? I have been looking around and am finding it ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    6

    Integration

    Does anybody know how to do a maths integration in C? I have been looking around and am finding it difficult to produce this piece of code and was wondering if anybody code help me? Thanks for your help

  2. #2
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    What exactly is your problem? What piece of code are you trying to compile?
    Post the code that's giving you problems and the errors you are having.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Location
    India
    Posts
    515
    Quote Originally Posted by westclok
    Does anybody know how to do a maths integration in C? I have been looking around and am finding it difficult to produce this piece of code and was wondering if anybody code help me? Thanks for your help
    ya right... do a bit of genetic algo with some artificial intelligence..
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  4. #4
    Jez
    Jez is offline
    The C-er
    Join Date
    Mar 2004
    Posts
    192
    Well I'm interested, but I have questions.

    Do you mean numerical integration or symbolic (if this is the right word) integration?

    What's the nature of the data to be integrated?

  5. #5
    Registered User
    Join Date
    Nov 2004
    Location
    India
    Posts
    515
    if its numerical, that is definite integration, then it is easy. one has to know stuff like the trapezoidal rule or simpsons one-third rule and stuff like that. if it is indefinite (its not symbolic jez) then one has to know many other things..if you've heard of mathematica, there is an entire book written on the techniques used to write the code for mathematica. i dont know the name though.
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  6. #6
    Jez
    Jez is offline
    The C-er
    Join Date
    Mar 2004
    Posts
    192
    indefinite (its not symbolic jez)
    Thanks Ping! I couldn't think of the right word.

    Don't suppose he really wants symbolic integration though. I was merely highlighting the fact that we have little information to go on.

  7. #7
    Registered User
    Join Date
    Nov 2004
    Location
    India
    Posts
    515
    i agree with you jez..coz making something that gives you the value of the indefinite integral is not that simple you know.. i hope this westclok guy tells us exactly what he wants..instead of his vague question..lol
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    I've got an easy answer:

    You've got to do it on your own, and you have to know how to do it in order to implement it in C.

    If you are just doing symbolic (indefinite) integration, then I assume that means you're just doing something like parsing functions, and then finding its general anti derivative (give it limits and a starting value and you've got a definite integral).

    If you are doing numerical integration, you are basically writing a numerical differential equation solver. Here are some terms you want to look for:

    -Euler integration (least accurate)
    -Improved euler integration (semi accurate)
    -runge kutta (most accurate)

    each of those are numerical techniques employed for taking the numerical route to integration. Also look for taylor series expansion (you will have to know it in order to implement runge kutta).
    See you in 13

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    14
    Wolframs Mathematica is also an excellent maths package Matlab. they are both quite advanced though and a much simpler/cheaper program (with much of the functionality) is Derive from TI interactive.

    I have been looking at writing something similar to westclock and have found writing something to interpret user input is no small task in itself.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 06-04-2009, 09:18 AM
  2. Numerical Integration by Trap Rule.
    By hexagons in forum C Programming
    Replies: 3
    Last Post: 03-25-2009, 10:12 AM
  3. Numerical Integration
    By Crazed in forum C Programming
    Replies: 13
    Last Post: 03-03-2008, 02:01 PM
  4. PC Cam Integration
    By neo_phyte in forum Networking/Device Communication
    Replies: 0
    Last Post: 10-25-2006, 01:34 AM
  5. perform numeric integration
    By Frank_Rye in forum C Programming
    Replies: 5
    Last Post: 10-18-2005, 01:17 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21