Link Java to Maple

來源:互聯網
上載者:User

A java project should link to Maple using those math methods.  Step as following.

1. In the maple, get the bin lib path. in windows XP, input:

> kernelopts(bindir);

and I get the answer:  "d:\Program Files\Maple 11\bin.win"

2. Set the path into the windows system path. You can check it with "echo %path%" command.

3. Create the java project, and import the packages: externalcall.jar and jopenmaple.jar in %MAPLE%\java dictionary.

4. Build and run.

 

I use the %MAPLE%\samples\OpenMaple\Java\jcmaple for test. And that's perfect !

run the sample and input a recursive equation set to get the solution.

> eq[1] := d(0) = d[0];

                             eq[1] := d(0) = d[0]

> eq[2] := d(k+1) = d(k)+1;

                           eq[2] := d(k+1) = d(k)+1

> eq[3] := l1(m+1) = l1(m)+1;

                          eq[3] := l1(m+1) = l1(m)+1

> eq[4] := l2(n+1) = l2(n)+1;

                          eq[4] := l2(n+1) = l2(n)+1

> eq[5] := l1(0) = l1[0];

                            eq[5] := l1(0) = l1[0]

> eq[6] := l2(0) = l2[0];

                            eq[6] := l2(0) = l2[0]

> p := rsolve(convert(eq, set), {d(k), l1(m), l2(n)});

            p := {d(k) = k+d[0], l1(m) = m+l1[0], l2(n) = n+l2[0]}

 

Maple can convert procedures and data into the languages such as C, Java, BASIC and so on, however it can not convert the kernel funtions like the "rsovle". As a result, it's the only way to use its API.

Ok, I'll use it to solve my complex problems for bug-finding in the software.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.