Items tagged with library library Tagged Items Feed

I have a problem using variables values that were read form Maple library file (*.mla) with units.

For example:

In the first file called "calculations.mw" I calculate a variable with units and save value to "lib1.mla" file

 

A__1 := Units:-Standard:-`*`(2, Unit('m'))

2*Units:-Unit('m')

(1)

A1 := Units:-Standard:-Unit('m')

Units:-Unit('m')

(2)

savelib('A__1', 'A1', cat(interface(worksheetdir), "\\lib1.mla"))

``

 

 

Download calculations.mw

 

 

In the second file called "document.mw" I can read the value of a variable, but can't use it in expressions:

 

libname := cat(interface(worksheetdir))

"D:\TEMP\MTest"

(1)

A__1

2*Units:-Unit('m')

(2)

A__1

2*Units:-Unit('m')

(3)

2*A__1

Error, (in Units:-Standard:-*) invalid subscript selector

 

A1

Units:-Unit('m')

(4)

A1

Units:-Unit('m')

(5)

2*A1

Error, (in Units:-Standard:-*) invalid subscript selector

 

NULL

 

Download document.mw

 

Where I made a mistake? 

I have Maple package "DESOLVE" having two different types of files namely in format .mpl and .mws, where code is written in .mpl file and .mws is just a example worksheet, this package is available at following link;

http://cpc.cs.qub.ac.uk/summaries/ADYZ_v1_0.html

My problem is how to work with package?

One thing that I able to do is that I have opened the file type .mpl  in Maple worksheet and after executing whole whorsheet I able to to start working with package using with(desolv).

But when I type with(desolv) in new worksheet an error shows up.

How I can store this .mpl file in Maple library so as to use this package using "with(desolv)" in new worksheets

Desolv_worksheet_paper.mws?

I use Maple18 on unix 64. I have the MAPLE and the LD_LIBRARY_PATH properly set up to use OpenMaple. When I link my code to OpenMaple library I get segmentation fault when I try to debug using gdb. In order to isolate the problem, I created a simple temp.cc file that contains the following:

 

#include <string>

#include <stdio.h>

 

int main()

{

int x = 10;

std::string abc;

abc = "testString";

printf("this is it %s\n", abc.c_str());

}

 

When I compile the code using g++ -g -o temp temp.cc I can run ./temp and step into the code using gdb with no problems.

 

If I link to Maple Library g++ -g -o temp temp.cc -L/opt/maple18/bin.X86_64_LINUX –lmaplec

 

I can run the code ./temp but I can not step into it using gdb. I get the error as shown below when I try to step over std::string abc.

 

//-----------------------------------------------------

 

GNU gdb (GDB) 7.8

Copyright (C) 2014 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-unknown-linux-gnu".

Type "show configuration" for configuration details.

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>.

Find the GDB manual and other documentation resources online at:

<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".

Type "apropos word" to search for commands related to "word"...

Reading symbols from temp...done.

(gdb) b main

Breakpoint 1 at 0x40091f: file temp.cc, line 6.

(gdb) r

Starting program: xxxxxxxxxxxxxxxxxxxxxxxxxxx

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib/libthread_db.so.1".

 

Breakpoint 1, main () at temp.cc:6

6         int x = 10;

(gdb) n

7       std::string abc;

(gdb) n

BFD: reopening /tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp: No such file or directory

 

BFD: reopening /tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp: No such file or directory

 

BFD: reopening /tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp: No such file or directory

 

Can't read data for section '.eh_frame' in file '/tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp'

0x00000000004007a8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()@plt

    ()

(gdb) n

Single stepping until exit from function _ZNSsC1Ev@plt,

which has no line number information.

Segmentation fault

Do you have physical components like MOSFETs and IGBTs in your library? How can I have a look at the tool and library block sets?

I have created and saved a MAPLE module in an .mla archive. The module contains three procedures A, B, C, where

A calls, B and C.  

Once the module library has been loaded, A acccepts inputs and generates outputs.

Is it possible to create a MAPLE player worksheet which calls the module and share it with a Maple Player (only) user, so that they can then supply the inputs and observe the outputs from A using the Maple Player programme components?

Can anyone help?

MRB

 

 

 

Hi

I have a Maple file which contains many proc loops and functions.

I need a linkage between some files to read the requested functions from source file and export calculations to another file.

Is it possible?

Hi all,

I google and found a program using C# connect with Maple. The Maple file is mla file - a pakage library type of Maple. I want to review data structure and all interfaces funtions to understand the way to implement this features.

Please help me the way to read the original Maple code. I uploaded the .mla file into mediafire if you want to review it. Link http://www.mediafire.com/download/abd9kpk3q6oq8lb/CHEMISTRY.mla 

Regards,

Quan Nguyen

Hello everyone,

I have nonlinear partial differential equations (see the attached file) need to be solved:

https://drive.google.com/file/d/0B14...ew?usp=sharing

With initial condition: h(x, y) = K1 (constant), dh/dx = K2 (constant); dh/dy = K3 (constant); And h(x,y) is function of (x,y) other factors are constant. Could anyone tell me how to solve these equations by using numerical method? Do you know any library in c/ c++ language that can solve these equations??

I have tried with Maple 17 and the response is: "Error, (in pdsolve/info) first argument is not a differential equation". Whole of my input:

 

with(PDEtools); declare(U1(x, y), U2(x, y), U3(x, y));

PDEs = [diff(U1(x, y), y) = U2(x, y),

diff(U1(x, y), x) = U3(x, y),

(diff(U2(x, y), y))*((L-U1(x, y))^2+(D2+tan(alpha)*(L+U1(x, y)))^2)+.5*U2(x, y)*(2*tan(alpha)*U1(x, y)-D2) = 0,

(diff(U3(x, y), x))*((L-U1(x, y))^2+D1^2*cos(alpha+2*U2(x, y))^2)+.5*U3(x, y)*D1*cos(alpha+2*U2(x, y))+.5*D1*sin(alpha+2*U2(x, y))*(L-U1(x, y)) = 0];

 

[ d d / d
PDEs = [--- U1(x, y) = U2(x, y), --- U1(x, y) = U3(x, y), |--- U2(
[ dy dx \ dy

\ / 2 2\
x, y)| \(L - U1(x, y)) + (D2 + tan(alpha) (L + U1(x, y))) /
/

/ d
+ 0.5 U2(x, y) (2 tan(alpha) U1(x, y) - D2) = 0, |--- U3(x, y)
\ dx

\ / 2 2 2\
| \(L - U1(x, y)) + D1 cos(alpha + 2 U2(x, y)) /
/

+ 0.5 U3(x, y) D1 cos(alpha + 2 U2(x, y))

]
+ 0.5 D1 sin(alpha + 2 U2(x, y)) (L - U1(x, y)) = 0]
]

pdsolve(PDEs);
Error, (in pdsolve/info) first argument is not a differential equation

 


I will be very appreciated with your help!!!

Does MapleSim 6 cover temperature dependent fluid media? In the modelica standard library (MSL), there is for example a medium model for T-dependent properties, defined by tables or polynomials (Modelica.Media.Incompressible).

 

Is it included in MapleSim 6 or can be somehow modelled?

 

Thanks!

How to show the code in file with extension .lib and edit it?

Hello,

I have defined a function(say fun) to do certain task, it works well when I call it from a script file(say script1). However, when I copy the complete script1 and paste onto another script file(say script2), the function, fun, doesn't execute. It's very peculiar as my project requires lot of modification, so I copy the old script and...

Hello,

1. Is it possible to create a function file in Maple and call the function(file) from the main program(like Matlab?). If yes, please give me an example case.

I want to create a function file which has the general input terms and call the function from another script file without copying/running all the code.

2. Is it possible to run 'recursive function' in maple?

3. How can I create library of my function files?(like in Matlab I can create...

Hi,

I want to put some code into a Maple library. I'm new to producing packages. The following code runs OK, but when I try to use one of the procedures added by the LibraryTools[Save] command, Maple returns

input: MySum(a, b);
output: MyMapleLibrary:-MySum(a, b)

Why does Maple return an unevaluated call to MySum?

The code is below:

restart:
with(LibraryTools):

MyMapleLibrary:=module()
  description "A sample Maple library.":

Hi,

In chapter 2 of the Advanced Programming Guide, it says:

"Important Always ensure that the standard Maple library is write-protected to avoid saving expressions in it. If you accidentally save something to the standard Maple library, you may need to restore the original from media on which you obtained the Maple software".

How do I make the standard Maple library write-protected? Is it by marking as read-only the following folder?

Hi,

I wrote a procedure and saved it into a .mla library, then accidentally lost the file containing the initial code. Can I get it back from the library ? I didn't find the answer in the help on LibraryTools.

Thank you.

1 2 Page 1 of 2