Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello

Although I am (remotely) running the following piece of code in a linux machine with 256 GB of ram, the error msg "Execution stopped: Stack limit reached" comes out 

 

kernelopts(stacklimit);
NestList:= proc(f, x, n::nonnegint)
local R:= rtable(0..n, [x]), k;
   for k to n do R[k]:= simplify(f(R[k-1])) od:
   [seq(R)]
end proc:
n:=34;
yreal:=NestList(y-> 4*y*(1-y),1/8,n):

I have tried to increase stacklimit issuing the command "kernelopts(stacklimit=256000)" but to no avail.  Is there anything else I can do?  A similar code run successfully in a mac with Mathematica. 

Many thanks 

Ed

 

PS. The default kernelopts(stacklimit) shows 8192 on the linux machine and  but 32736 on the mac pro.  I was expecting a higher number on the linux machine.  

 

restart;
with(LinearAlgebra);
G := Matrix([[beta1^2, 0, -beta2^2, 0], [0, beta1*(b^2 - beta1^2), 0, beta2*(b^2 + beta2^2)], [beta1^2*cosh(beta1*l), beta1^2*sinh(beta1*l), -beta2^2*cos(beta2*l), -beta2^2*sin(beta2*l)], [beta1*sinh(beta1*l)*(b^2 - beta1^2), beta1*cosh(beta1*l)*(b^2 - beta1^2), -beta2*sin(beta2*l)*(b^2 - beta2^2), beta2*cos(beta2*l)*(b^2 + beta2^2)]]);
NULL;
NULL;
S := Determinant(G);
S := simplify(S);
S1 := S/(beta1^2*beta2^2);
F := Pi*d^2/4;
Q := F*d^2/8;
u := E/(2*(1 + v));
lambda := sqrt(w^2/c^2);
j := v*d*lambda/sqrt(8);
y1 := 1 - j^2 + sqrt((j^2 - 1)^2 + 4*j^2*u/(c^2*p))/(2*j^2*u/(c^2*lambda^2*p));
y2 := 1 - j^2 - sqrt((j^2 - 1)^2 + 4*j^2*u/(c^2*p))/(2*j^2*u/(c^2*lambda^2*p));
b := 2*(1 + v)*(8/(v^2*d^2) - w^2/c^2);
beta1 := sqrt(y1);
beta2 := sqrt(-y2);
S;
d := 24.8;
c := 5100;
v := 0.34;
l := 2000;
E := 2.1*10^5;
p := 7700;
S;
plot(S, w = 0*2*Pi .. 100000*2*Pi);

# Here I get an error

Error, (in plot) incorrect first argument (-HFloat(2.757556062608314e294)-HFloat(2.757556062608314e294)*I)*(HFloat(2.757556062608314e294)-HFloat(2.757556062608314e294)*I+(HFloat(2.918216722364015e-174)+HFloat(7.045198389075166e-174)*I)*(HFloat(1.2899139595562734e220)+HFloat(1.2899139595562734e220)*I+(HFloat(2.345679734289597e162)+HFloat(9.71612358926469e161)*I)*(.3015529528-0.1030372934e-6*w^2)^2)+(HFloat(2.739493386336394e-116)+HFloat(2.739493386336394e-116)*I)*(HFloat(1.5009648027561687e-231)-HFloat(2.757556062608314e294)*I+(-HFloat(5.478986772672788e-116)+HFloat(5.478986772672788e-116)*I)*(.3015529528-0.103 ... HFloat(2.739493386336394e-116)*I)*(.3015529528-0.1030372934e-6*w^2)^4)

w1 := fsolve(S, w = 0*2*Pi .. 100000*2*Pi);

# Here I get an error 

Error, (in fsolve) Digits cannot exceed 38654705646
 

I want to substitute the solution back into the original equation.  I get caught up in RootOf and have to manually do the substitutions.

F := [x^2+y+z-1, y^2+x+z-1, z^2+x+y-1];

soln1 := solve(F);

for s in soln1 do

subs(s,F)

end do;

The 4th soln has RootOf.

soln2 := solve(_Z^2 + 2*_Z - 1);

for s in soln2 do

evala(subs({x=s,y=s,z=s},F))

end do;

How do I do this all in one step?


I was starting to set up a curved axisymmetric metric using the Physics package and came across an error message that I could not resolve. I was actually writing the metric in the form given after output line (5) in the code attcahed below. This returned the error message:

Error, (in Physics:-Setup) invalid subscript selector

Then I started fiddling and discovered that somehow braces and order of coefficients are making a difference in the metric. I have written the flat space metric in three different ways after output line (2). The difference is only in the coefficient of the last $d\phi^2$ term. For some reason, $r^2 (sin(\theta))^2$ is shown as $r (sin(\theta))^4$ in output line (3). Removing the brackets around $sin(theta)$ or writing $r^2$ after it is resolving the problem. Is this in someway related to the whole square operation? Can you please help me understand why this is happening?

The original error message I was getting went away after I similarly changed the order of coefficients in the second term of the curved metric to get output (6). Here again, there was a whole square operation!

Thank you!

 

restart

with(Physics)

[`*`, `.`, Annihilation, AntiCommutator, Antisymmetrize, Assume, Bra, Bracket, Cactus, Check, Christoffel, Coefficients, Commutator, CompactDisplay, Coordinates, Creation, D_, Dagger, Decompose, Define, Dgamma, Einstein, EnergyMomentum, Expand, ExteriorDerivative, Factor, FeynmanDiagrams, Fundiff, Geodesics, GrassmannParity, Gtaylor, Intc, Inverse, Ket, KillingVectors, KroneckerDelta, LeviCivita, Library, LieBracket, LieDerivative, Normal, Parameters, PerformOnAnticommutativeSystem, Projector, Psigma, Redefine, Ricci, Riemann, Setup, Simplify, SpaceTimeVector, StandardModel, SubstituteTensor, SubstituteTensorIndices, SumOverRepeatedIndices, Symmetrize, TensorArray, Tetrads, ThreePlusOne, ToFieldComponents, ToSuperfields, Trace, TransformCoordinates, Vectors, Weyl, `^`, dAlembertian, d_, diff, g_, gamma_]

(1)

Setup(signature = `-+++`, coordinates = (X = [t, r, theta, phi]))

`* Partial match of  'coordinates' against keyword 'coordinatesystems'`

 

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (t, r, theta, phi)}

 

`Systems of spacetime Coordinates are: `*{X = (t, r, theta, phi)}

 

[coordinatesystems = {X}, signature = `- + + +`]

(2)

Setup(g_ = -dt^2+dr^2+r^2*dtheta^2+r(sin(theta))^4*dphi^2)

[metric = {(1, 1) = -1, (2, 2) = 1, (3, 3) = r^2, (4, 4) = r(sin(theta))^4}]

(3)

Setup(g_ = -dt^2+dr^2+r^2*dtheta^2+sin(theta)^2*r^2*dphi^2)

[metric = {(1, 1) = -1, (2, 2) = 1, (3, 3) = r^2, (4, 4) = sin(theta)^2*r^2}]

(4)

Setup(g_ = -dt^2+dr^2+r^2*dtheta^2+sin(theta)^2*r^2*dphi^2)

[metric = {(1, 1) = -1, (2, 2) = 1, (3, 3) = r^2, (4, 4) = sin(theta)^2*r^2}]

(5)

Setup(g_ = -exp(2*nu(r, theta))*dt^2+(exp(2*psi(r, theta)))(dphi-omega(r, theta)*dt)^2+(exp(2*mu(r, theta)))(dtheta)^2+exp(2*lambda(r, theta))*dr^2)

Error, (in Physics:-Setup) invalid subscript selector

 

Setup(g_ = -exp(2*nu(r, theta))*dt^2+(dphi-omega(r, theta)*dt)^2*exp(2*psi(r, theta))+exp(2*mu(r, theta))*dtheta^2+exp(2*lambda(r, theta))*dr^2)

[metric = {(1, 1) = -exp(2*nu(r, theta))+omega(r, theta)^2*exp(2*psi(r, theta)), (1, 4) = -omega(r, theta)*exp(2*psi(r, theta)), (2, 2) = exp(2*lambda(r, theta)), (3, 3) = exp(2*mu(r, theta)), (4, 4) = exp(2*psi(r, theta))}]

(6)

``


 

Download qstn.mw

Is it italic when copied and pasted?  Is it bold when copied from maple 8?  I just ahve not been able to work it out.

The only way that I can think of doing it is by multiplying by a tetrad.  Even then it does not work well see my worksheet:  The Dirac Equation in Robertson-Walker spacetime.

Factorise

   

into your Maple worksheet and copy and paste the Maple output into the answer box below.

I have a recursive function that spits out recursive formulates "evaluated inertly" so bascially it produces a formula simply like a symbolic formula(doesn't reduce the addition of values though).

 

What I would like is to color code each recursive step

e.g.,

F := proc(n)
    local i,k:
    if n <= 0 then return 1; end if:
    F(n-2) %+ F(n-1):
end proc:

F(5);

value(F(5));
 

so I would like to cover each part of the recursion differently so it is easier to see, maybe even use the previous colors so one can visualize the nestings of the recursion. (e.g., F(n-2) takes the previous formals color and tweaks it towards the red and and F(n-1) takes the porevious formulas color and tweaks it towards green)
(this would then pass an RGB value that(default, say blue) to the functions above).

 

Any way to accomplish this?

 

 

 

 

For the following system, the parameters D_1,D_2,D_3,D_4,D_5,D_6,S are all positive, How can I get all the  equilibrium  and their stability.

diff(x1,t)=fS;diff(x2,t)=fV;diff(x3,t)=fC;diff(x4,t)=fR;

fS := -D2*x1*x2-D1*x1-x1*x3+S; fV := D2*x1*x2-D4*x2+x1*x3; fC := -D6*x3*x4-D5*x3+x2; fR := D6*x3*x4-x4

Hello everyone

First day using Maple and I've been given the following task: 

Design a function rangetolist(intrange) which expects an expression intrange of the type .., i.e., of the form m..n as its argument and converts it to the list
[m,m+1,...n] Also test what happens if m is larger than n. Hint: This readily works using seq
.

I can't quite seem to get it working, online resources haven't been too helpful in resolving the issue unfortunately. 

Here is my attempt 

rangetolist := (x::range) -> seq(i = op(1, x), i .. op(nops(x), x), 1);
 
which gives me this error:  Error, (in rangetolist) unable to execute seq
 
Very grateful for any constructive input, thanks :)

 

 

Hi , I have a system of equations and initial or boundary conditions. My.question how to solve these equations and their conditions together? And I can’t use dsolve because my result system doesn’t contain any derivative. In addition I couldn’t use fsolve because I don’t know how to collect the system and the conditions to solve together as a one system , and some examples contains equations morethan number of variables.... please can you advice me a solution 

thanks 

Why won't simplify give the obvious result and Why does testeq give a Fail result in this case?

 

with(RealDomain);

assume(0<f,0<g);

simplify(f*sqrt(g/f));

testeq(f*sqrt(g/f)=sqrt(f)*sqrt(g))

Hi everyone,

I have 4 expression, each containing several parameters (3, I think).

I need to find the range of the values of the parameters for which one of the expressions is at least as great as any of the other expressions.

So the input of the program/function would be the expression and which one I want to be the (weakly) greatest, and the  output should be something like: [parameter a is a member of the set [0.1,0.5] and parameter b is a member of the set [1.2, 2.4] and parameters c is negative] (meaning if these are true, then the given exoression is the (weakly) greatest of all the given expressions.

 

Is there a way to do this in Maple?

 

(For the curious: I have a game-theoretic problem, where the payoff functions include several parameters. I am trying to find the best response functions to find the Nash.equilibria of the game for the different range of parameters)

 

Thank you in advance,

JTamas

I have a formula that essentially is a m-order sum over a totally ordered set(the integers).

 

sum_{n_1=1)^{n_0} ... m times ... sum_{n_m=1}^{n_{m-1}}

 

It may be a little confusing but essentially it is just summing over all monotonic lidyd of size m of [1..n_0]

e.g., if n_0 = 4 and m = 3 then

1 2 3

1 2 4

1 3 4

2 3 4

 

Does maple have a convient way to do this? Ideally some function like osum(..., i=1..n_0, m)

where i is a multi-index(just the ordered list here so I could access i[1] the smallest, value, i[2] is the next largest, etc).

 

How can i solve below equation?

diff(v,x,x)+diff(v,x)*cot(x)-v(cot2(x)+nu)=a2Q/D

that Q is function of x

Q=Q[x]

First 456 457 458 459 460 461 462 Last Page 458 of 2097