# MaplePrimes Questions

Search Questions:

## Latest Questions Latest Questions Feed

### Multi-Threading - Error, (in assuming) when calli...

September 11 2016
1 9

HI there,

I have the following problem: I want to improve the runtime of my script (Maple 2016) and want to use multithreading/tasking.

>restart;
with(LinearAlgebra):
with(Student[MultivariateCalculus]):
with(plots):
with(Statistics):
with(RealDomain): #I know, I don't need all of that here

>N:= 20:
>sample := (i) -> solve( (1/(2*(N+1))+1/(N+1)*i)=cdf(x),x): #this is an equidistant sampling

> smpl := [Seq(sample(i),i=1..(N-1))]; #I try to run a multithread seq -> got it from the documentation

Error, (in assuming) when calling 'Engine:-Process'. Received: 'type System does not exist'

I get this error message, but I don't really know what to do with it. I googled and searched, but I couldn't find useful help. Note that when I run this command, I still use only one processor (at least until it returns the error). I also tried:

>smpl := Map(sample,sample_dists);>N:= 20:
Error, (in assuming) when calling 'Engine:-Process'. Received: 'type System does not exist'

I also tried to implement it with threads:

> cont := proc()
global mutex_sample, smpl:
smpl := [op(smpl), _passed]: #add the results of the tasks to the smpl var.
print("Sampling Done");
end proc:

> sample := proc(cdf, min, max, N) #samle the region
local output:
seq(solve(,x),i=0..(N-1)); #return value
end proc:

> startSampling := proc()

print("Starting Sampling!");
for i from 1 to kernelopts(numcpus) do #for each processor
end do:

end proc:

"Starting Sampling!"
Error, (in assuming) when calling 'Engine:-Process'. Received: 'type System does not exist'

I know I'm doing here something systematically wrong, but I can't figure it out.

I would be very greatful, for your help or insiged.

EDIT:
1) The presented script might doesn't make sense (or might be pointless), because I have a much larger and more complex (model) in my original script. But, my script didn't work (exactly same error). So, I tried this simple example, to figure out what the problem is. But it didn't work either. I thought, it might be better (didactically) to find the problem in the simple code. It might be easier to explain in a forum and easier to analyse. (SO I could then see why my more complex code is not working).

2) I was running the script in Linux (Ubuntu 16.04 x64) and it produced this error. I also run the script in Windows 10.2 where I got the same error (and sometimes I got an "Maple Kernel cannot be reached" message where I had to restart Maple.

3) I noticed that solve sometimes returns a complex solution (usually it returned: "value + 0.0 I"). I therefore added "with(RealDomain): ", which had the consequence that some sample points were "NULL". I know that, and that is another issue, which I'm not bothered about (right now).

SOLUTION: (most likely)
Thanks to everyone who replied. But Carl_Love probably is right by pointing out that int, solve, fsolve ... are not thread-safe and therefore caused the crahses/error messages, while calling thesefunctions in different threads.

### How to retrieve only the monomials (no coefficient...

September 10 2016
0 17

Hello

I wonder if there is a function to retrieve only the monomials from a multivariable polynomial in x, y and z. Below is one such polynomail.

theta[2]*x3*x0-theta[8]*x2*x1*x0-theta[2]*x2*x1-theta[6]*theta[2]*x2*x0^2-theta[4]*theta[2]*x2*x0-theta[2]*theta[7]*theta[10]*x1*x0^3+theta[8]*theta[2]*theta[9]*x1*x0^2-theta[2]*theta[5]*theta[10]*x1*x0^2-theta[2]^2*theta[3]*theta[10]*x0^3+theta[6]*theta[2]^2*theta[9]*x0^3+theta[4]*theta[2]^2*theta[9]*x0^2

and the result

[x3*x0,x2*x1*x0,x2*x0^2,x2*x0,x1*x0^3,x1*x0^2,x0^3,x0^2]

Many thanks

Ed

### how can i get a purchse code?...

September 10 2016
1 2

I downloaded a maplesoft apps, and wat to activate, an activeation form displayed requiring me to put in a purchase code of which i don't know or have. How can i get it or where can i find it? please some one help.

### Pre-subscript and pre-superscript purpose?...

September 10 2016
1 8

Does anyone know what the default function is for the pre-subscript and pre-superscript?  I would like to use them for a variable name to represent the local reference frame and global reference frame in my multibody calculations.  Thanks

### plot parametric procedure...

September 10 2016
0 4

1.I want to plot (x-x0)^2 from x=0..10 with a value for x0 in the plot function not in the procedure. The procedure should

test x against x0 and if x<x0 then y=0 else y=(x-x0)^2

2.Is it possible to use explore and use x0 as a slider?

Regards

Staffan

### how to get the coordinate of a swirl ...

September 10 2016
0 10

http://mathforum.org/kb/message.jspa?messageID=685890

i find equation above

for ii from 0 by 5 to 365 do
eq1 := x^2 + y^2 = arccos(x/r);
eq2 := y = evalf((atan(-1) - ii*Pi/180)/Pi)*(-1.0)*x;
xy := fsolve({eq1, eq2});
print("M",rhs(xy[1]),rhs(xy[2]),","):
od:

but i do not understand how to set r

i use a line scanning 365 degrees to get the path of swirl

would like to get path data for c# WPF animation

but this method may have multiple solution because an intersection of swirl

and a line can have multiple points

### how to change rotation angle into slope of line?...

September 10 2016
0 5

how to change rotation angle into slope of line?

with(MTM):
evalf(solve(atan(-1) - 45*Pi/180 = atan(x), x))*180/Pi;

above can not be solved

if angle is 30 degree

is following correct?

with(MTM):
angle := 30:
evalf((atan(-1) - 30*Pi/180)/Pi)*(-1.0);

### Ways to make the file you are writing compact and ...

September 10 2016
1 4

Hello people in mapleprimes,

I have a question:
What are you doing when you use maple in calculating, for example, your paper,
to avoid missing, for example, variables you use, or for your needs to look back the outcomes you obtained before?
If this is a paper-using work, on considering what to do next, you will read some pieces of papers you wrote and
on which you had calculated and obtained necessary equations. But, with small monitor 13 inch, and with
inconvenience of dealing with things in PC, compared with papers, I feel some stress in using maple in writing a paper.
So, now, I am asking you what kind of methods you has devised to make what you are writing compact and easy,
for you to handle with what you are writing.

I know surely that there are the document block, which enables output or input to not be shown, the workbook,
which is helpful in putting attached worksheets or jpg files together at one workbook, and the distinction of ":" and ";",
which in the case of the former, hides expressions in the outcome.

But, yet, I want to ask you about the ways you use to make it easy to write something.
If you have some, I will be very glad if you show it here.

Best wishes.

taro

### How to compute the convex hull of points with both...

September 09 2016
2 10

I would like compute the vertices of the convex hull of finitely many points in some \mathbb{R}^{n}, where the coordinates of these points could be rational numbers or irrational numbers like \sqrt{2}.

I know that PolyhedralSets[ConvexHull] is a direct command, however it does not support irrational numbers. But if I transform all coordinates into floating point numbers, for some rational numbers the rounding error would be large enough to affect the result. For example, after the transform some collinear points are no longer collinear.

Thanks!

### How I can use Differential Algebra package to obta...

September 09 2016
2 3

Dear All

I need to reduce system of differential equation system into triangular system which I came to know can be done using Maple package "DifferentialAlgebra", but I do not know how to use this package for triangularization.

The differential system is DetSys derived from  some PDE:

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >

Regards

### USB and or RS232 porting from inside maple console...

September 09 2016
0 0

USB and or RS232 porting from inside maple console. Title explains what i need, or how to port an externally built java app into the maple console, either which will engine my dispatch tonight

### Plotting the solution of a PDE (pdsolve-numeric)...

September 09 2016
0 2

Hello everybody!
I have a PDE with initial and boundary conditions. I want to plot its solution by taking "t" as x axis. I have seen the documentation. It only has the space variable on x axis. Please show me a way to achieve what I intend.

here is the file pdsolve.mw

The value of x can be chosen as 0.16 or 0.21

### creating functions with derivatives in them. How d...

September 09 2016
0 6

I wish to define a function which is the derivative of another function.

> f:=(x)->x^2:

> g:=(x)->diff(f(x),x):

> g(x);

2 x

> f(2);

4

> g(2);
Error, (in g) invalid input: diff received 2, which is not valid for its 2nd argument

I cannot find a way in which I can define the function g, using the functional operator, so that I can actually evaluate g(x).

How can I do this?

### iteration mapping proc...

September 08 2016
0 2

i think i might have asked this before for another thing if so im sorry but anyway i think its @ or something, i would like to plot the final output here indexed against th

 >
 >
 >
 >
 >
 >

e number of iterations of Y conducted besides the original performed on the empty set

### pdsolve-numeric error...

September 08 2016
0 11

I am trying to solve a PDE using pdsolve-numeric. I am getting an error related to boundary conditions.
Please see the follwing worksheet and suggest me some solutions

pdsolve.mw

 3 4 5 6 7 8 9 Last Page 5 of 1358
﻿