Search the web
Sign In
New User? Sign Up
jsci
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Java code for solving ODE   Message List  
Reply | Forward Message #129 of 369 |
Re: Java code for solving ODE

--- In jsci@yahoogroups.com, Mark Hale <mj_hale@y...> wrote:
>
> Hi,
>
> Say you have a function dy/dt = f(y). Then, you would
> do the following in code:
>
> // create inner class representing function
> Mapping func = new Mapping() {
> public double map(double y) {
> return f(y);
> }
> };
> int N = 50;
> double dt = 0.1;
> double[] yValues = new double[N]; // will contain y_i
> yValues[0] = y0; // set initial condition
> NumericalMath.rungeKutta(yValues, func, dt);
> // can now plot yValues to see result
>
> I'll improve the docs for this.
>
> Regards,
>
> Mark
>
>
>
> --- lydiacetin <lydiacetin@y...> wrote: > Hi
> All,
> > I'm hoping someone might be able to help me find a
> > java class or
> > interface that solves for ordinary differential
> > equations using the
> > RK4 integration algorithm. I know that the RK4
> > algorithm is a method
> > given in the JSci API, but I'm not sure how I would
> > use it and how I
> > set up the parameters. I'm only a beginner with Java
> > programming, so
> > any information on these topics would be great.
> > Cheers
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> >
> >
> > Yahoo! Groups Links
> >
> >
> > jsci-unsubscribe@yahoogroups.com
> >
> >
> >
>
>
>
>
>
> ____________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html




Fri May 14, 2004 12:30 am

lydiacetin
Offline Offline
Send Email Send Email

Forward
Message #129 of 369 |
Expand Messages Author Sort by Date

Hi All, I'm hoping someone might be able to help me find a java class or interface that solves for ordinary differential equations using the RK4 integration...
lydiacetin
Offline Send Email
May 7, 2004
3:45 am

Hi, Say you have a function dy/dt = f(y). Then, you would do the following in code: // create inner class representing function Mapping func = new Mapping() { ...
Mark Hale
mj_hale
Offline Send Email
May 9, 2004
2:16 am
lydiacetin
Offline Send Email
May 14, 2004
12:31 am

Thanks for your response Mark, but I'm having a little trouble implementing the code. My main problem is that I don't think I can use the func object in the...
lydiacetin
Offline Send Email
May 14, 2004
12:39 am

What compiler error do you get? If it does not like the use of the inner class you can just use a normal class: class MyDyByDxFunction implements Mapping { ...
Mark Hale
mj_hale
Offline Send Email
May 14, 2004
3:11 am

Thanks Mark, I did manage to get the rungeKutta method working with your new suggestions and my simple ODE worked. Cheers! The ODE that I'm trying to solve is...
lydiacetin
Offline Send Email
Jun 2, 2004
4:24 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help