Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: NIntegrate with a J/Link Function

  • To: mathgroup at
  • Subject: [mg66005] Re: NIntegrate with a J/Link Function
  • From: David Bailey <dave at>
  • Date: Wed, 26 Apr 2006 04:38:20 -0400 (EDT)
  • References: <e2kqvb$7mp$>
  • Sender: owner-wri-mathgroup at

pjcrosbie at wrote:
> I cannot get NIntegrate to work on a Java function I have attached to
> Mathematica with J/Link.  The Java function works fine on its own and
> inside Plot but NIntegrate appears to be passing it a symbolic value.
> Code snippets:
> :=Plot[tPort@condtPD[1, dr] , {dr, -6, 6}]  (* works fine, plots
> function correctly *)
> := NIntegrate[condtPD[dr] ,{dr,-6,6}]
> Fails with message:
> "Method named condtPD defined cr.research.conditional.CDnDPortfolio1
> was called with an incorrect number or type of arguments. The
> arguments, shown here in a list, were {1, dr}."
> Can anyone point me in the right direction?
> Many thanks

First, I assume you meant NIntegrate[tPort@condtPD[dr] ,{dr,-6,6}]

The problem is that NIntegrate does a preliminary symbolic evaluation of 
  the integrand, which fools Java. The answer is to write an interface 
function that screens out symbolic values:


NIntegrate[f[dr] ,{dr,-6,6}]

David Bailey

  • Prev by Date: Illusory Multicore Support in 5.2?
  • Next by Date: Re: unable to FullSimplify
  • Previous by thread: NIntegrate with a J/Link Function
  • Next by thread: error function