MaplePrimes Questions

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

 

 

Hello everyone!
Could you help me with the next problem:

1. I have a nonlinear pde system(two equations, two unknown functions: tau(t, r) & R(t, r)) of hyperbolic type.

2. And I have no idea how to solve it.

3. But I know some interesting things about it:

  • In direct variables (tau(t, r) & R(t, r)) this is a nonlinear system maple2.mw
  • But in inverse variables (t(tau, R) & r(tau, R)) it splits into two independent linear differential equations.maple3.mw And we can get a solutions of each in HeunC functions(it would be great if maple could give me an inverse Heun's functions, I couldn't find how). 

4(last). I have a condition in which one of two equtaions = 0, (this condition: tau(t, r) = t) and now I want to try to see what one of the unknown functions(R(t, r)) looks like. But I can not use numeric values. The system describes a spherical gravitational wave, depends on time and distance. r > mass so i want to see some discrete solutions of R(t, r)(jpeg file).the dimensions of t and r are the same. Maybe you have some ideas?
 

In the realm of tetrads where both world indices and Lorentz indices are present, contractions, say, using simultaneously the Minkowskian (galilean) Levi-Civita symbol,

and the curvilinear Levi-Civita (pseudo-)tensor,

can be considered. Although each of the two types of Levi-Civitas can easily be obtained separately by specifying Setup(levicivita = galilean) or Setup(levicivita = nongalilean), I cannot figure out how to have them both available at the same time. Any suggestions?

PS: I am, of course, aware of the fact that the two Levi-Civitas are related by some appropiate square-root of the determinant of the metric, but I have no desire to fiddle around with explicit such determinants if they can be avoided.

This is probably a question to Edgardo: In another thread, the following quantity is considered [Eqs. (5) and (6) combined]:

expand(gamma_[definition]);

This is all very well, but it seems to depend on the metric loaded: if the Schwarzschild metric g_[sc] is loaded, then the above output results, but if the Minkowski metric g_[minkowski] is loaded, then the output of the above expansion is identically zero. Does that make sense? Is that intentional? The explicitly evaluated Ricci rotation coefficients vanish identically for the Minkowski metric, of course, but if evaluation is performed for that case, then why not also for the Schwarschild metric [not meaning to say that I want evaluation]?

In the following codes I am very sure exp(-3*q) is a factor both at numerator and denominator. However, I dont know how to annihilate this factor. Can someone kindly help to ensure it cancels out? Thanks and kind regards.

restart:
s:=(sum(a[j]*x^j,j=0..2)+sum(a[j]*exp(-(j-2)*x),j=3..4)):
F:=diff(s,x):
p1:=simplify(eval(s,x=q))=y[n]:
p2:=simplify(eval(F,x=q))=f[n]:
p3:=simplify(eval(F,x=q+h))=f[n+1]:
p4:=simplify(eval(F,x=q+3*h/2))=f[n+3/2]:
p5:=simplify(eval(F,x=q+2*h))=f[n+2]:

vars:= seq(a[i],i=0..4):
Cc:=eval(<vars>, solve({p||(1..5)}, {vars})):
for i from 1 to 5 do
	a[i-1]:=Cc[i]:
end do:
Cf:=s:
T:y[n+2]=collect(simplify(eval(Cf,x=q+2*h)), [y[n],f[n],f[n+1],f[n+3/2],f[n+2]], recursive);

 

First 833 834 835 836 837 838 839 Last Page 835 of 2409