Calculus in Programming ??


by karthik3k
Tags: calculus, programming
karthik3k
karthik3k is offline
#1
Mar13-04, 08:02 AM
P: 151
How can i differentiate / Integrate in C/C++, PERL, PYTHON ????
Phys.Org News Partner Science news on Phys.org
SensaBubble: It's a bubble, but not as we know it (w/ video)
The hemihelix: Scientists discover a new shape using rubber bands (w/ video)
Microbes provide insights into evolution of human language
HallsofIvy
HallsofIvy is offline
#2
Mar13-04, 03:31 PM
Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 38,898
Generally speaking, programming languages like C++,PERL, and PYTHON have basic functions built in but for more complex operations like diffentiation and integration, you have to either write or get algoriths.

Especially if you want symbolic "algebra" results!
cookiemonster
cookiemonster is offline
#3
Mar13-04, 03:32 PM
P: 991
I don't think those kinds of languages can handle that kind of mathematics. But maybe there's some kind of package out there to let them.

And the stereotypical answer, just for good measure: you write a program to do it!

cookiemonster

rick1138
rick1138 is offline
#4
Mar15-04, 02:23 AM
P: 199

Calculus in Programming ??


You will definitely have to look for special math libraries to find algebraic solutions. Most programming uses approximations because, as yu probably know, many integrals are not exactly solvable. Runge-Kutta is the most efficient in general, but Monte Carlo methods are sometimes used. I like the simplicity of Monte Carlo methods- screw math, just get drunk and throw darts at pictures of your equations, and you'll have the answer.
Surendra
Surendra is offline
#5
Mar17-04, 09:28 PM
P: 8
Hi:
I thinkit is not possible to do diff/Int directly but u can always develope the code to fit to u r needs..There are plenty of codes available on line else u can use "Numerical Recieps in C", i t is an excellent book for these type of codes..
Surendra
Bob3141592
Bob3141592 is offline
#6
Mar19-04, 07:32 PM
P: 225
Originally posted by rick1138
You will definitely have to look for special math libraries to find algebraic solutions. Most programming uses approximations because, as yu probably know, many integrals are not exactly solvable. Runge-Kutta is the most efficient in general, but Monte Carlo methods are sometimes used. I like the simplicity of Monte Carlo methods- screw math, just get drunk and throw darts at pictures of your equations, and you'll have the answer.
And the drunkenness is a requirement of the system! The answers are likely to be wrong if the dart thrower is sober. [:)]
sunilkamadolli
sunilkamadolli is offline
#7
Apr2-04, 03:19 PM
P: 42
therez definitely no built-in integ or deriv function that u can call in c/c++/perl etc...
wut some c/c++ programs do is basically load a database of integral tables and then call the appropriate function and search the function's tables to find the appropriate integral form...in short, it uses integration by table.I think softwarez like maple and deriv, which do these, were written in C...making them user friendly...

if u want to do the integration and stuff using C then ull need to download functions and then include them like " include <bhahbhah.h> " and then pass appropriate parameters.
much easier to use software like maple...

be warned that ur answer can look different from the answer u get by hand cuz the answerz can be expressed in different forms esp forms involving trig functions.

- Mr. Kamadolli
chroot
chroot is offline
#8
Apr2-04, 03:37 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,424
If you're talking about doing numerical differentiation and integration, look no further than the book "Numerical Recipes in C." It's a classic book, a must-own for any scientific programmer, and is available in its entirety, for free, at www.nr.com.

Enjoy!

- Warren
H-bar None
H-bar None is offline
#9
Apr2-04, 05:30 PM
P: 46
I'm at work so I can't give you an exact title of the book. I'll edit it the first chance I get.

The book is called Math Tookit For Realtime Programming by Jack Krenshaw. The author is an engineer who programmed embedded systems at NASA. The CAS(Computer Algerbra Systems) are great but programming the code is better. If you go that I highly recommend MATHCAD.


Register to reply

Related Discussions
Programming a PIC Programming & Computer Science 21
programming language to make a forum Computing & Technology 10
Programming help Programming & Computer Science 2
C programming Programming & Computer Science 18
TI-83 asm programming Computing & Technology 5