954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Applying mathematical equations to JAVA code

hello. I would like to know how I can make out a Java code from a given mathematical equation like differentiation equations, summation and integration

joshmo
Posting Whiz in Training
280 posts since Oct 2007
Reputation Points: 19
Solved Threads: 20
 

You need to understand the logic of those equation first and use the javadocs (api) to help you with the functions available to solve mathematical problems.

bluerose
Newbie Poster
17 posts since Apr 2009
Reputation Points: 10
Solved Threads: 1
 

Ofcourse I can get to understand the logic..What I want to know is how i can get, say a given equation to integrate or differentiate a number, then change that logic, to JAVA code..is there any application or tool that can do this?

joshmo
Posting Whiz in Training
280 posts since Oct 2007
Reputation Points: 19
Solved Threads: 20
 

Probably, do a google search for them. If you're talking about simple differentiation and integration (i.e. power rule) then it is trivial anyway, and so is chain rule for differentiation. Why don't you mention the specific formula you're trying to code and then show some progress or ideas etc on it.

BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
 
Ofcourse I can get to understand the logic..What I want to know is how i can get, say a given equation to integrate or differentiate a number, then change that logic, to JAVA code..is there any application or tool that can do this?

Depends on the equation. A lot of equations are done for you and are included in Math .

double theta = 0.5;
double cosinetheta = Math.cos (theta);


Some equations you'll have to write out or combine with Math functions.

double x = 0.5;
double y = Math.cos (x) + Math.pow (theta, 1.5) - 2 * x + 6.3;


[edit]
And Math is just one of many classes you can use. There is all sorts of stuff out there, both from Sun and from individuals who have posted work.
[/edit]

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

It all depends, if you want a numerical analysis approach it is a piece of piss. i.e using the trapezium rule for integration.

Something more than that, such as mathematica's engine would be a lot more involved.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

You may use mathematics open source API for your purpose. Mathemaca, /Link is a toolkit that integrates Mathematica and Java. http://reference.wolfram.com/mathematica/JLink/ref/java/overview-summary.html

J/Link JavaDoc Documentation

http://www.wolfram.com/solutions/mathlink/jlink/documentation/api/


Open source :

http://ojalgo.org/what.html

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

how to solve uncertanity quation with the hep of java

GATUM
Newbie Poster
1 post since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

Thanks for your sharing! I have learnt so much from your post!

ghdfans2010
Newbie Poster
6 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You