Maple 2015 Questions and Posts

These are Posts and Questions associated with the product, Maple 2015

Hi!

I see that from Maple 2018 there is a command to compute the so called Radial Basis Function Interpolation:

https://www.maplesoft.com/support/help/Maple/view.aspx?path=Interpolation%2FRadialBasisFunctionInterpolation

I am trying to implement that code in Maple 2015, but it returns the error

Error, (in h) bad index into Vector

Displaying the vectors computed with the procedure, they seem correct, but the function that I want to return seems to fail (it is a summatory).

Attached the maple file

RBF_Interpolation.mw

I will appreciate any suggestion. Many thanks in advance for your comments!

BR,

GGM

It seems that DrawGraph cannot display the weights of more than 45 arcs of a directed graphs (the arcs themselves are keeping to be displayed correctly).

Maybe a version issue?

WeightedGraphs.mw

I rewrite my code with Grid library using local vCPU of amazon 

discover no license of distributed HPC when setup command show need go to acresso.com

can Grid still be used and function with local 96 number of vCPU?

then when I test code, I can not pkill mserver in ps -aux in LInux 

can the performance really improved ? Because I suppose 3 to 5 minutes mserver will end and disappear from ps -aux but grid node of mserver still running

originally I can run 100 batches every day., but I have to monitor decrease of memory in order to determine whether can kill mserver for next batch 

I expect run 400 batches per day. But Can not kill mserver when using grid

In my code I had using time limit(30, ...) 

when using Grid seq of function , can lprint work normally to get results into text ?

i notice Grid up to 57, do I need to recalculate and revise code to fit 96 vCPU for grid number 96?

Hi,

I would like the display of a piecewise-function F with DocumentTools:-Tabulate to look like the one I get with print.
How is it possible to do this?

Here is an example

restart:
with(DocumentTools):
with(DocumentTools:-Layout):

MV := kernelopts(version);
Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895

# Extract the version number for subsequent use
MV := parse(substring(StringTools:-Split(convert(MV, string), ",")[1], 7..-1))

# I want to display F and G while using DocumentTools
# As you see the display of F is not very pretty.
# This is not a problem related to the "height" of the formula for G is pretty-displayed
# even if it as roughly the same "height" than F

F := piecewise(seq(op([x<k, k]), k=1..5)):
g := x -> 1/(1+x):
G := (g@@5)(x):
Tabulate([F, G]):

# using DocumentTools:-Layout doesn't help

C1 := Cell( Textfield(style=TwoDimOutput,Equation(F))):
C2 := Cell( Textfield(style=TwoDimOutput,Equation(G))):
T  := Table(Column(),Column(),
         Row( C1, C2 )
       ):

if MV < 2018 then
  InsertContent(Worksheet(Group(Input( T )))):
else
  InsertContent(Worksheet( T )):
end if;


This is what DocumentTools:-Tabulate displays


DocumentTools_piecewise.mw


TIA

Hi, 

First question
Let P1 the logical proposition

restart
with(Logic):
local O
P1 := (&not O) &and (&not C) &implies (&not Q);

Is it possible to obtain its contraposition P2  in a form that contains &implies?

# P2 := (Q) &implies &not ((&not O) &and (&not C));


Second question
Why does the modulo 2 canonical form of proposition P5 above contains "1" "plus" other terms:
(if 1 is present this means 1 + something = 1 and then that P5 is a tautology, which is obviously wrong as Tautology(P5) shows)

restart
with(Logic):
local O
P1 := (&not O) &and (&not C) &implies (&not Q);-
P2 := (Q) &implies &not ((&not O) &and (&not C));
P3 := op(1, P2) &and (&not C);
P4 := op(2, P2) &and (&not C);
P5 := P3 &implies P4:

Canonicalize(P5, {O, C, Q}, form=MOD2)

                   C O Q + C Q + O Q + Q + 1


Verificaion of what the modulo 2 canonical form of a proposition including an "addititive" tautology is

T := O &or (&not O):
Canonicalize(T, {O}, form=MOD2);
Canonicalize(T &or S, {O, S}, form=MOD2);
                               1
                               1

Is it that I missed something or is iot a bug?

Watchout: this result has been obtained with Maple 2015.2

TIA
 

Hi, I want to animate the motion of an electrond around a negative-source electric field. The trajectory would be iperbolic, however I've encountered one problem: I have to compose the movemente with 4 different animate pointplot3d, and they all start at a certain point at the same time and end in another at the same time. Can I make it so that they all start when another one has finished and only the moving one is shown?

display(
animate(pointplot3d, [[A, sqrt(A^2 - 1), 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = 1 .. 3), 
pointplot3d([0, 0, 0], symbol = solidsphere, color = "Blue", symbolsize = 15), 
animate(pointplot3d, [[-A, -sqrt(-1 + (-A)^2), 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = -3 .. -1), 
animate(pointplot3d, [[A, 3*sqrt(2)/4*A - sqrt(2)/4, 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = 3 .. 6), 
animate(pointplot3d, [[-A, 3*sqrt(2)/4*A - sqrt(2)/4, 0], symbol = solidsphere, symbolsize = 15, color = "Blue"], A = -6 .. -3), 
implicitplot3d(x^2 + y^2 + z^2 = 17, x = -6 .. 6, y = -10 .. 10, z = -10 .. 10, color = "Green", style = wireframe), 
scaling = constrained)

This is the code I've come up with, the blue still point is the elctron which powers the field, the moving blue point (there are 4 of them but all represent the same thing) is the moving electron and the green ball is a representation of the electric field.

Edit: I'll use the code for interactive components.

Thanks in advance to everyone!

 

Hi friends! Hope everything is fine here

I want to generate a piecewise function using some already computed functions. Like I compute B[0], B[1], B[2] and B[3] using some formula which are given as,

B[0] := (1/6)*x^3/h^3;
B[1] := (1/6)*(4*h^3-12*h^2*x+12*h*x^2-3*x^3)/h^3;
B[2] := -(1/6)*(44*h^3-60*h^2*x+24*h*x^2-3*x^3)/h^3;
B[3] := (1/6)*(64*h^3-48*h^2*x+12*h*x^2-x^3)/h^3;

Now, I want to define the corresponding piecewise function as

piecewise(x <= 0, 0, 0 < x and x <= h, B[0], `and`(h < x, x <= 2*h), B[1], `and`(2*h < x, x <= 3*h), B[2], `and`(3*h < x, x <= 4*h), (B[3], 0)

similarly for already computed functions B[0], B[1], B[2], B[3] and B[4] which are given as

B[0] := (1/24)*x^4/h^4;
B[1] := -(1/24)*(5*h^4-20*h^3*x+30*h^2*x^2-20*h*x^3+4*x^4)/h^4;
B[2] := (1/24)*(155*h^4-300*h^3*x+210*h^2*x^2-60*h*x^3+6*x^4)/h^4;
B[3] := -(1/24)*(655*h^4-780*h^3*x+330*h^2*x^2-60*h*x^3+4*x^4)/h^4;
B[4] := (1/24)*(625*h^4-500*h^3*x+150*h^2*x^2-20*h*x^3+x^4)/h^4;

I want to define the corresponding piecewise function as

piecewise(x <= 0, 0, 0 < x and x <= h, B[0], `and`(h < x, x <= 2*h), B[1], `and`(2*h < x, x <= 3*h), B[2], `and`(3*h < x, x <= 4*h), B[3], `and`(4*h < x, x <= 5*h), B[4], 0)

Can someone please let me know a general procedure (using seq command, loop etc.) to define piecewise function if B[0], B[1], B[2],...,B[M] are known? I shall be very thankful for your answer.

Dear Users!

Hope everything going find with you. I want to generate sequence of Spline[i,p], p=1…M as given bellow

restart; M := 3;
for p while p <= M do
(x-x[i])*B[i, p-1]/(x[i+p]-x[i])+(x[i+p+1]-x)*B[i+1, p-1]/(x[i+p+1]-x[i+1]);
B[i, p] := collect(%, [`$`(B[i+s, 0], s = 0 .. M)]);
B[i+1, p] := eval(%, i = i+1)
end do;
for p while p <= M do
Spline[i, p] := B[i, p]
end do

The expression for Spline[i,1] and Spline[i,2] are fine but the expressions of Spline [i,p] p>2 is not in simplified form I got the its simplification like given bellow for Spline[i,3]

Spline[i, 3]:=(x-x[i])^3*B[i, 0]/((x[i+3]-x[i])*(x[i+2]-x[i])*(x[i+1]-x[i]))+(((x-x[i])*(x-x[i]))*(x[i+2]-x)/((x[i+3]-x[i])*(x[i+2]-x[i])*(x[i+2]-x[i+1]))+(x-x[i])*(x[i+3]-x)*(x-x[i+1])/((x[i+3]-x[i])*(x[i+3]-x[i+1])*(x[i+2]-x[i+1]))+(x[i+4]-x)*(x-x[i+1])^2/((x[i+4]-x[i+1])*(x[i+3]-x[i+1])*(x[i+2]-x[i+1])))*B[i+1, 0]+((x-x[i])*(x[i+3]-x)^2/((x[i+3]-x[i])*(x[i+3]-x[i+1])*(x[i+3]-x[i+2]))+(x[i+4]-x)*(x-x[i+1])*(x[i+3]-x)/((x[i+4]-x[i+1])*(x[i+3]-x[i+1])*(x[i+3]-x[i+2]))+((x[i+4]-x)*(x[i+4]-x))*(x-x[i+2])/((x[i+4]-x[i+1])*(x[i+4]-x[i+2])*(x[i+3]-x[i+2])))*B[i+2, 0]+(x[i+4]-x)^3*B[i+3, 0]/((x[i+4]-x[i+1])*(x[i+4]-x[i+2])*(x[i+4]-x[i+3]));

I am waiting for positive respone. Please take care and thanks in advance

Let E be a random variable of expectation mu and A an algebraic expression containing no random variable.
If E has any known Maple distribution, then  Mean(A+E) = A+mu.

But if E is an "abstract" random variable, Mean doesn't seem capable to compute the expectation of A+E.
Notional example:

restart:
with(Statistics):
E := RandomVariable(Normal(mu, sigma)):
Mean(f(x)+E)
                           f(x) + mu
E := RandomVariable(Distribution(PDF = (z -> f(z)), Mean=mu)):
Mean(f(x)+E); 
     int((f(x) + _t) f(_t), _t = -infinity .. infinity)

IntegrationTools:-Expand(%);
        f(x) (int(f(_t), _t = -infinity .. infinity)) + (int(f(_t) _t, _t = -infinity .. infinity))

Questions:

  • Why does Mean not behave as expected for an abstract random variable?
  • Is there a simple way to obtain the expected result (Mean (A+E) = A+mu) (maybe by completing the definition of the distribution of E, or by any other means)?

TIA

PS: I know that I can replace Mean(A+E)  by A+Mean(E)  to obtain the desired result: this is not the type of answer I look for.

PS: I know (since Carl Love showed me how long ago) that I can define a "random variable" plus an operator Expectation such that Expectation(A+E)  by A+Expectation(E) ... but it's not a way I would call simple

Expectation := proc(e::algebraic)
     local a,b;
     if not hastype(e, RV) then e
     elif e::RV then 'procname'(e)
     elif e::`+` then map(thisproc, e)
     elif e::`*` then
          (a,b):= selectremove(hastype, e, RV);
          b*thisproc(a)
     else 'procname'(e)
     end if
end proc:

#------------------------------------------------------------------------

TypeTools:-AddType(
     RV, 
     {RandomVariable, 
     'RandomVariable^posint', 
     '`*`'({RandomVariable, 'RandomVariable^posint'})
     }
):
eval(Expectation(f(x)+E), Expectation=Mean)
                           f(x) + mu

 

Hello everyone. I took part in a project in which we had to solve problems with Maple 2015. The managers gave us a permanent license. However recently I had trouble on my computer and now Maple doesn't work anymore because it somehow lost the license. The project ended last year, so I can't really ask them anymore. Is there any way to get the license working again? I checked on the site but didn't found anything useful and I'd really need it for the final exam of the last year of high school...

Thanks in advance!

Dear Users!

For a given piecewise function S(x)

I want to generate the following functions phi[1], phi[2],... for n = 9

I shall be very thankful for your positive response. Please take care and thanks in advance.

I'm solving this equation:

eq3 := 2*lambda*(q[1]+p[1]*exp(t))*(q[2]+p[2])^2*p[1]*exp(t) = s[1]

eq4 := 2*lambda*(q[1]+p[1])^2*(q[2]+p[2]*exp(u))*p[2]*exp(u) = s[2]

solve({eq3, eq4}, {t, u})

This is what I get:

{t = ln(RootOf(-s[1]+(2*lambda*p[2]*q[1]+2*lambda*q[1]*q[2])*_Z+2*lambda*_Z^2)/((q[2]+p[2])*p[1])), u = ln(RootOf(-s[2]+(2*lambda*p[1]*q[2]+2*lambda*q[1]*q[2])*_Z+2*lambda*_Z^2)/((q[1]+p[1])*p[2]))}

I'm completely new at maple.

I can't find what _Z  and _Z^2 mean. Can anybody help? and how I can solve this _z and _Z^2

Thanks in advance

I've finally decided to see what I could to do with DocumentTools.
I started with these simple lines from ?DocumentTools:-Do 

restart:
with(DocumentTools):
Do(int(%expression, x=%from::integer..%to::integer));
Error, (in DocumentTools:-GetProperty) Attempted to retrieve property of unknown component expression.

These next ones return the expected plot but an alert window 

restart:
with(DocumentTools):
Do(%Plot1=plot(x^2, x=0..1));


However the Click and Drag icon is disabled in the plot toolbar and invisible in the plot menu.

The behaviour of these commands do not depend on whether they are written in a worksheet, a section or a code edit region.

Could you detail me the very first steps do use DocumentTools features?

TIA

DT-Do.mw

Is there like https://oeis.org/   Library available in maple for enumerate in for loop?

i would like to like shift 9 times and create 100 mapping for each sequence 

Hello Users!

I want to assign some specific names of elements in a vector A:

A:=Vector[row](19, {(1) = 14.9057064333276, (2) = 14.4384716751962, (3) = 14.0155569170648, (4) = 13.6381346589334, (5) = 13.3075724008020, (6) = 13.0254476426706, (7) = 12.7935628845392, (8) = 12.6139606264079, (9) = 12.4889383682765, (10) = 12.4210636101451, (11) = 12.4131888520137, (12) = 12.4684665938823, (13) = 12.5903643357509, (14) = 12.7826795776196, (15) = 13.0495548194882, (16) = 13.3954925613568, (17) = 13.8253703032254, (18) = 14.3444555450940, (19) = 14.9584207869626});

like

y[1,1]:=14.9057064333276;

y[1,2]:=14.4384716751962;

y[1,3]:=14.0155569170648;

...

y[1,19]:=14.9584207869626;

Later, I have to use y[1,1], y[1,2],...,y[1,19] for further calculations. I used op command but it does not work. Please help me how I can assign the name. 

I am waiting for your respone. Thanks in advance.

1 2 3 4 5 6 7 Last Page 1 of 66