MaplePrimes Questions

I am trying to make a library, and therfore package that contains a bunch of objects that inherit from each other.

I understand how to create objects that inherit from one another and my code here works fine:

module ParentObject()
   option object;
end module;

module ChildObject()
   option object(ParentObject);
end module;

However when I put it all in a package with code below:

module Package()
   option package;
   export ParentObject, ChildObject;
   
   module ParentObject()
      option object;
   end module;

   module ChildObject()
      option object(ParentObject);
   end module;

end module;

I get the error "Error, argument of option object(ParentObject) refer to another object in module Package:-ChildObject".

Any sugguestions?

Near the top of the large loop at the bottom of the uploaded worksheet IntSect is copied to IntSectRoll.

IntSectRoll is then modified several times within the loop. However IntSect also changes content even though there are no commands within the loop to cause this.

To avoid this is the reason IntSect is recreated from previous data each time before it is copied.

Is this a bug in my worksheet or in Maple 2016?

Constant_Diameter.mw

The theory behind the worksheet is described, without attribution, in the book The Penguin Dictionary of Curious and Interesting Geometry by David G. Wells.

Does this theory have a name and a discoverer?

f(x)=sqrt(sin(x)); x over the intervall [0,T]

can anyone help me to find this integral ?

 

I might be doing something wrong since I expected Maple to be able to solve this. Could some Maple manage to make Maple solve the following beam PDE problem taken from a textbook?

 

This is what I tried.

restart;
pde:=diff(u(x,t),t$2)+diff(u(x,t),x$4)=0;
bc:=u(0,t)=-12*t^2,u(1,t)=1-12*t^2,D[1,1](u)(0,t)=0,D[1,1](u)(1,t)=12;
ic:=u(x,0)=x^4,D[2](u)(x,0)=0;
sol:=pdsolve({pde,ic,bc},u(x,t));

But Maple returns no solution.

I am using Maple 2017.3 on windows.

 

When I enter this code:

de3a := diff(x(t), t) = (x(t))(1-.5*x(t)-.5*y(t)); de3b := diff(y(t), t) = (y(t))(-.25+.5*x(t));
sys3 = {de3a, de3b};

window := x = -1 .. 3, y = -1 .. 3;
DEplot(sys3, [x(t), y(t)], t = 0 .. 14, window);

 

I get the error message "Error, (in DEtools/DEplot) system must have same number of dependent variables as DE's." What am I doing wrong? I'm just trying to create a plot on the phase plane.
 

 

Hi all, 

 

How could I be certain about the correctness of these answers? I am sure that the variation of the parameter, C1, must be monotonic; just in one dircetion... increasing or decreasing. As you could see from the last result in the first command, the data are false... However, by the second method, the answer is different from that of the first!!!? Both of them are derived by 'fsolve'
In the third way, the command dsolve, produced an array of resutls, C1 and Nu, and there is just one correct solution... It is confusing.

DeriveNu-T.mw

I am puzzled by the strange behaviour of the following exampleSectionaken directly from the Programming Guide section 8.6. When I copy the example from the help to a worksheet as follows, I get an error stating that module m does not evaluate to a module in the use statement. 

> m := module() export a, b; a := 2; b := 3; end module:
use m in a + b end use;

Error: `m` does not evaluateto a module.

However, after a restart, when I execute the two statements as separate statements (separate prompts), the module does evaluate properly.

My question is, what is the safe workaround in coding to avoid this situation.

I have attached the worksheet.moduleeval.mw

can you pls help with that

 

if 0 denotes the zero matrix,

then show that e^0 = I, the identity matrix 

A[k]:= x;
A:= table().

how to sort hashtable by key which is a list of matrix

after sort, is possible to group by key? and how?

I have two tensors, E_ and F_ below, that I believe should be equal. But they are not, and I cannot understand why. The problem does not appear in, say, Schwarschild spacetime, but it appears in Boyer-Lindquist spacetime, metric [5,29,1]; perhaps it appears only if the vierbein is nondiagonal?

The code: Loading the packages and the metric:

restart:
with(Physics):
with(Tetrads):
g_[[5,29,1]];   # The Boyer-Lindquist metric

Set up galilean and nongalilean Levi-Civita's, respectively, following the recipe given elsewhere:

Define(varepsilon[a,b,c,d] = Array((1..4)$4,rhs(LeviCivita[nonzero])),quiet):
Setup(levicivita = nongalilean):
# Checking that the Levi-Civita's are indeed different
varepsilon[1,2,3,4];   # The galilean case
LeviCivita[1,2,3,4];   # The nongalilean case

Define the two tensors E_ and F_, using mixed type Levi-Civita's for the latter:

Define(
   E_[~a,mu] = varepsilon[~a,~b,~c,~d]*LeviCivita[mu,nu,rho,sigma]*e_[b,~nu]*e_[c,~rho]*e_[d,~sigma],
   F_[~a,mu] = varepsilon[~a,b,c,d]*LeviCivita[mu,~nu,~rho,~sigma]*e_[~b,nu]*e_[~c,rho]*e_[~d,sigma]
,quiet):
E_[definition];
F_[definition];

Compare the two expressions, which should be equal, I believe.

expr := simplify(TensorArray(E_[~a,mu] - F_[~a,mu])) assuming a::real,theta > 0,theta < Pi;
eval(expr,{a = 1,m = 1,r = 2,theta = Pi/4});   # Just to make the difference completely obvious

[I have trouble copy-pasting the output from these two lines, so you will have to execute the worksheet provided below to see it.]

However, they are not equal. Why not?

Download worksheet: MixedTypeLeviCivitas.mw.

Hi all, I wish to solve in Maple 4 equations with 4 unknowns. I do exactly what is in the example, but Maple produces an error. Perhaps someone can see, where I make the mistake.

restart:
G1:=a*x^3 + b*x^2:
G2:=c*(x-1)^3 +d*(x-1)^2:
eq1:=subs(x=u, G1=G2):
eq2:=subs(x=u, diff(G2,x)-diff(G1,x)):
eq3:=subs(x=u, diff(G2,x$2)-diff(G1,x$2)):
eq4:=subs(x=u, diff(G2,x$3)-diff(G1,x$3)):
sol:=solve({eq1=0, eq2=0, eq3=0, eq4=1},{a,b,c,d});
Error, invalid input: solve expects its 1st argument, eqs, to be of type {`and`, `not`, `or`, algebraic, relation(algebraic), ({list, set})({`and`, `not`, `or`, algebraic, relation(algebraic)})}, but received {6*c-6*a = 1, 6*c*(u-1)+2*d-6*a*u-2*b = 0, 3*c*(u-1)^2+2*d*(u-1)-3*a*u^2-2*b*u = 0, (a*u^3+b*u^2 = c*(u-1)^3+d*(u-1)^2) = 0}

 

how do i solve the following expression in maple and how do i plot sigma wrt a?

sigma = 4*sigma[s](1/4-(int((BesselJ(1, y))^2/y(1+y(400*10^(-10)/a)^2+sqrt(1+y(400*10^(-10)/a)^2)), y = 0 .. 10^4)))

 


 

Suppose I am given the following summation:

 

sum(a*i, i = 1 .. n)

``

Can Maple write the first few terms of the summation? For example, if I want to see first three terms of the summation, I'd like Maple to output the following:

 

a + 2 a + 3 a

 

My use case is that if I am given a complicated summation, it can be useful to look at the first few terms to see if there are any patterns.

 

The things I've tried are:

 

sum(a*i, i = 1 .. 3)

6*a

(1)

'sum(a*i, i = 1 .. 3)'

sum(a*i, i = 1 .. 3)

(2)

eval(sum(a*i, i = 1 .. 3))

6*a

(3)

expand(sum(a*i, i = 1 .. 3))

6*a````

(4)

``


 

Download expandsum.mw

I really need help to understand this i know it is a non associative operation but i just cannot see how no operator is handled in the computation here


 

A := (rand(1 .. 100))():

8

 

8

 

9424

(1)

A := (rand(1 .. 100))():

33

 

33

 

33

(2)

``


 

Download please_HELP.mw

This will be my last question i promise then i will go to bed for a week.

(its what happens when the government decide after 20 years they are going to make it illegal for me taking stimulants therefore must purchase from non pharmacy sources and can barely afford 1 out of every 2 weeks supply, they charge $6 AUD per tablet on the street so, i was prescribed 8 per day, i earn $250 a week, so yes, that is more than all of my money)

Sorry, just want to repeat that as much as possible to embarass my government an infintesimal amount in public forums, never go to australia, my country is a piece of shit and the people here are on the most part uncivilized socially backward morons 

 

 

Edit: Here is a better worksheet for you comrades 
 

restart

X := proc (A, B) options operator, arrow; (`mod`((`mod`(A, n))*(`mod`(B, n)), n))((`mod`(A, n))*(`mod`(B, n))) end proc:

Y := proc (A, B) options operator, arrow; (`mod`((`mod`(A, n))*(`mod`(B, n)), n))*(`mod`(A, n))*(`mod`(B, n)) end proc:

is(X(A, B) <> Y(A, B))

false

(1)

is((`mod`((`mod`(A, n))*(`mod`(B, n)), n))((`mod`(A, n))*(`mod`(B, n))) <> (`mod`((`mod`(A, n))*(`mod`(B, n)), n))*(`mod`(A, n))*(`mod`(B, n)))

false

(2)

A := (rand(1 .. 100))():

is((`mod`((`mod`(A, n))*(`mod`(B, n)), n))((`mod`(A, n))*(`mod`(B, n))) <> (`mod`((`mod`(A, n))*(`mod`(B, n)), n))*(`mod`(A, n))*(`mod`(B, n)))

true

(3)

is(X(A, B) <> Y(A, B))

true

(4)

``


 

Download helpPlz.mw

 Hi, I've been trying to solve these PDE below 

Omega*(diff(c(y, t), t))+6*pe*Lambda*(-y^2+y)*cos(2*Pi*x)+pe = diff(c(y, t), y, y)

BC = diff(c(t,1),y)=0,diff(c(t,0),y)=0 

I have got the solution. but could not implement the boundary condition ( maybe those conditions are not correct,/ suggestion needed )

and also have to eliminate those arbitrary constants. pde.mw

 

 

First 851 852 853 854 855 856 857 Last Page 853 of 2427