MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

implemeting java method in NDSolve command

  • To: mathgroup at
  • Subject: [mg62262] implemeting java method in NDSolve command
  • From: pradeep suresh <pradeep at>
  • Date: Thu, 17 Nov 2005 17:03:58 -0500 (EST)
  • Organization: Purdue University
  • Sender: owner-wri-mathgroup at

i have come across this general problem of implementing JAVA methods in 
Mathematica solver commands wherein the java method does not understand 
that its arguement is a variable that is manipulated by the solve 
command in question. Specifically, i used a method written by me that 
takes an integer arguement and returns that integer + 1.the method 
itself works fine and has been tested in mathematica, however, when i 
tried to use this method in one of the equations being solved by 
NDSolve, i have problems. To illustrate,

function[23] gives 24.
but when we have NDSolve[{y'[t]==function[t]*y+2, y[0]==1},{t,0,10}] 
gives this error
Java::argx1: Method named function defined in class MathLink was called 
with an incorrect number or type of arguments. The argument was t.

which i interpret as a problem of mathematica not parsing the arguement 
't' as an integer but as a character.

i hope somebody has come across a similar problem and has overcome it. 
This seems to be a very general problem and a serious shortcoming of 
mathematica if not solvable.
Plz help!
Thanks in advance!

  • Prev by Date: Export to PDF
  • Next by Date: Re: RootSearch-missing root
  • Previous by thread: Re: Re: Export to PDF
  • Next by thread: Performance Improvement - Need help