Maple 2015 Questions and Posts

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

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.

Dear Users!

Hope everyone is fine here. I want to formulate the table like give bellow (Table 5.17) in maple so that I can copy it in word file and can edit.

The values of y[1,1],y[2,1],y[2,2],y[3,1],y[3,2],y[3,3]...y[nops(HAq),nops(HAq)] present in the following maple code. Thanks in advance

Refine_Extrapolation.mw

Hi,

I want to solve this system of PDEs. Please let me know how I can solve it.

Kindly find both my code written in Maple and the image of the problem.

Best,

 

PDE.mw

Is there a way to make a library file that automatically has the functions/procedures loaded on startup and after it any new or open ".mw" can use functions/procedures from library with no redefinition?

It's ok isolate command? I need the solution sin(a)=+-1/(3^0.5)

Let A a (linear) partial differential operator and f=f(x, y, t) a function of space (x, y) and time (t).
Let DXY=[a, b] x [c, d], DT=[0..e] and  dXY the boundary of DXY.
Is it possible, with Maple 2015, to solve numerically the pde Af=0 in the open domain  DXY * DT
with Dirichlet conditions on dXY and initial condition f(DXY, 0)?
It seems that the option 'numeric' of pdsolve doesn't work with more than 1 "non time" independent variable:
Error, (in pdsolve/numeric/process_PDEs) can only numerically solve PDE with two independent variables, got {t, x, y}

Nevertheles I seem to remember seeing this on Mapleprime (?)
If Maple 2015 can't do it, can Maple 2020?

Thanks in advance

  • Remark: Af=0 is the heat equation with rho=Cp=lambda=1.
    I guess I could code the alternate directions method to transform  Af=0 into a sequence Axf=0,  Ayf=0 Axf=0 ... of 1D diffusion equations but I'm a little bit lazzy and I'm waiting for your feedback before doing this.

 

First 6 7 8 9 10 11 12 Last Page 8 of 72