MathGroup Archive 2001

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

Search the Archive

Re: Mathlink and BorlandC++

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30411] Re: Mathlink and BorlandC++
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 17 Aug 2001 03:09:51 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9ld14v$2fa$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

a) you are the first person that wish to use a numeric 
   differential equation solver form a C-programm.
   Strange, I have always implemented and seen 
   the  other direction. There are hundreds
   of fast an easy to use C-librarys with initial
   value solvers.

b) Say you want to send {y'[x]==-y[x], y[0]==1}

    MLPutFunction(alink,"List",2);  
      MLPutFunction(alink,"Equal",2);
        MLPutFunction(alink,"D",2);
          MLPutFunction(alink,"y",1);
            MLPutSymbol(alink,"x");
          MLPutSymbol(alink,"x");
        MLPutFunction(alink,"Times",2);
          MLPutInteger(alink,-1);
          MLPutFunction(alink,"y",1);
            MLPutSymbol(alink,"x");
      MLPutFunction(alink,"Equal",2);
        MLPutFunction(alink,"y",1);
          MLPutSymbol(alink,"x");
        MLPutInteger(alink,1); 
 
c) have a lot of fun with the InterpolationFunction[]      
   returned by DNSolve[] in your C-program ;-)

Regards
  Jens

konraad dullaert wrote:
> 
> Hey,
> 
> I'm writting a program in Borland where I need to solve a differential
> equation (have to use NDSolve).
> After opening a link to Mathlink, you have to put the function that you want
> to use.
> 
>         MLPutFunction (alink, "NDSolve, 3)
> 
> But how do I send the two equations (namely the differential equation and the
> initial value) and the interval in which the equation has to solved to the
> Mathematica Kernel?
> 
> Thanks for the effort,
> 
> Konraad


  • Prev by Date: Re: Expanding Trig Power Identities
  • Next by Date: Re: tickmark problem
  • Previous by thread: Mathlink and BorlandC++
  • Next by thread: Re: Mathlink and BorlandC++