Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

what is the most elegant way to get coefficients of a series that contains negative powers.

for example in this:

tt := a*N__s^3 + N__s + CSxSx__0 + CSxSx__1/N__s + CSxSx__2/N__s^2 + CSxSx__3/N__s^3;

i would like

fancy_coeff(tt, 1/N__s, 3)

to give me `CSxSx__3`

while

fancy_coeff(tt, 1/N__s, -3)

give me `a`

(the standard coeff call doesn't work with this, as would be known to people here)

thanks!

 

Hi,

The black circle below is vanishing at the peak. How do I make the entire  circle visible?

Transparency=0.5 is not a good solution.

 

 

 

 

 

A1 := -12; A1 = log*sigma[matrix];
print(`output redirected...`); # input placeholder
                              -12
                    -12 = log sigma[matrix]
sigma[matrix] := 0.1e-11;
print(`output redirected...`); # input placeholder
                                -12
                            1 10   
A1 := 6; A1 = log*sigma[CNT];
print(`output redirected...`); # input placeholder
                               6
                       6 = log sigma[CNT]
a := phi;
print(`output redirected...`); # input placeholder
                              phi
sigma[CNT] = 0.1e7;
print(`output redirected...`); # input placeholder
                                        6
                       sigma[CNT] = 1 10 
eq := log10(sigma[CNT]*a+(1-a)*sigma[matrix]);
print(`output redirected...`); # input placeholder
             /                     -12       -12    \
           ln\phi sigma[CNT] + 1 10    - 1 10    phi/
           ------------------------------------------
                             ln(10)                  
plot(eq, phi = 0.15e-1 .. 0.21e-1);
%;
Warning, expecting only range variable phi in expression ln(phi*sigma[CNT]+.1e-11-.1e-11*phi)/ln(10) to be plotted but found name sigma[CNT]

How can i solve that please ?

How to find the values of unknown parameters for these equations with initial and  boundary conditions

where Pr=6.2,M=2,nu=0.3,phi=0.05 and lambda=Sc=Ks=1

Could some one help me out to find the exact way to find the values of unknown parameters

Hello everyone,


I'm trying to generate plots in Maple so that I can export the image and be easily read in a document. I usually use the plots [display] command as I often reuse "subplots". The main problem appears when entering a legend, as it disrupts the proportions and I have to rescale everything manually. In doing so I sometimes get small, hard-to-read images or captions. Is there any way to resize the image and caption other than manually? Even better, is there a way to scale both to a certain image size and to make the caption legible at that size (e.g. image 7 cm wide and font equivalent to 10 pt in Word)?

Thank you so much in advance

A is a 2 x 2 matrix with eigenvalue, eigenvector pairs:

5,<4,1> and 1,<3,4>.

1. Find an invertible matrix M and a diagonal matrix D such that A=MDM^(-1).

M=   Preview                                       D=   Preview   

2. For any integer n, find the matrix A^n   as a single matrix (i.e. explicitly entry-by-entry). Use Maple notation for a matrix.

   An=   Preview    

(Hint: compose your answer in Maple to make sure your syntax is correct and your answer is what you think it should be.)

Something goes wrong with the DE   : de  
Error, unexpected single forward quote

I solved this by converting this : de  to a 2 D Math input 
Something must be chanced
in the configuration settings ? 

Ch05Sec03Prob19.mw

 

 

 

Let A be an m×n matrix. The image of A  is the set of vectors

 

im(A)={y:y=Ax for some x∈Rn} ,

 

which is a vector space.

The dimension of im(A)  is called the rank of A, denoted by rank(A) .

(a)  Find the rank of the matrix 

v1:=<-146, -84, 28, -154>

v2:=<-203, 106, 34, -181>

v3:=<-94, -4, 106, -154>

v4:=<-36, 152, -86, 50>

v5:=< 173, 122, -390, 435>

A:=<v1|v2|v3|v4|v5>;

and enter in the box below.

rank(A)=    

(b) For the matrix A in (a), select all the statements below which are true.

(1) <97,-8,-49,-66> is in im(A)

(2) <-65,74,10,-52> is in im(A)

(3)im(A) is subspace of R^4

(4) <2,-2,-4,4,-2> is in im(A)

(5) <0,0,0,0> is in im(A)

(6) <0,0,0,0,0> is in im(A)

(7) <-1,-2,1,-2,1> is in im(A)

(8) im(A) is a subspace of R^5

Let A be an m×n matrix. The kernel of A  is the set of vectors

ker(A)={x:Ax=0} ,

which is a vector space.

The dimension of ker(A)  is called the nullity of A, denoted by nullity(A) .

   (a)  Find the nullity of the matrix 

v1:=<136, 40, 124, -94>

v2:=<-74, -54, 150, 99>

v3:=<-104, 68, 196, -134>

v4:=<-38, -142, -108, 280>

v5:=<342, -326, -634, 635>

A:=<v1|v2|v3|v4|v5>

and enter in the box below.

nullity(A)=     

      b) For the matrix A in (a), select all the statements below which are true.

 (1)  <71, -37, 44, 73> is in ker(A)

 (2) <-1,1,2,-2,1> is in ker(A)

 (3) <0,0,0,0> is in ker(A)

 (4) <0,0,0,0,0> is in ker(A)

 (5) ker(A) is a subspace of R^5

 (6) ker(A) is a subspace of R^4

 (7) <95,-72,-85,-12> is in ker(A)

 (8) <2,4,-2,4,-2> is in ker(A)

 

 

 

@Carl Love
@acer
Hi. 

This Carl code works

standings_DRAW.mw

Could someone please make my modified code work:

(Case D should be the same as P-Q=0 , when integer score P,Q is entered and P=Q)

standings_SCORE.mw

EDIT: corrected and reuploaded: should have been if P-Q <> 0 rather than P-Q=0. changes in purple.

(ps I don't want a substitution D when P-Q=0)

Dear house 

I am new to maple and will really appreciate some assistance in calculating the disease free , endemic equilibrium states and basic reproduction number for my model.

 

I have been trying for weeks. any asistance will be much appreciated

SCI_HELP.mw

 

Is there a way to get the generalized Fourier series with respect to an arbitrary orthogonal system (instead of just sin, cos, exp, etc.) using the OrthogonalExpansions package or any other way in Maple?

Hello!

Could you help me please...

There are lot's of packages and instructions how to expand function to Fourier Series but in 2006, 2010

Please help...

 

Hello there, 

I wonder if there is any method to eliminate the terms ((6.*10^(-11))*I) in this worksheet. Apparently, they came from the limitation of the numerical precision. 


 

restart;

M2[transform] := <<2/(sqrt(3)*a),-1/(sqrt(3)*a),-1/(sqrt(3)*a)> | <0, -1/a, 1/a>>;

Matrix(3, 2, {(1, 1) = (2/3)*sqrt(3)/a, (1, 2) = 0, (2, 1) = -(1/3)*sqrt(3)/a, (2, 2) = -1/a, (3, 1) = -(1/3)*sqrt(3)/a, (3, 2) = 1/a})

(1)

Iload := <i[T]*exp(-I*Phi[T])|I*i[M]*exp(-I*Phi[M])>;

Vector[row](2, {(1) = i[T]*exp(-I*Phi[T]), (2) = I*i[M]*exp(-I*Phi[M])})

(2)

alpha := exp(I*convert(120*degrees, radians));

-1/2+((1/2)*I)*3^(1/2)

(3)

ABC2SEQ :=  1/3 * <<1,1,1> | <alpha, alpha^2, 1> | <alpha^2, alpha, 1>>;

Matrix(3, 3, {(1, 1) = 1/3, (1, 2) = -1/6+((1/6)*I)*sqrt(3), (1, 3) = (1/3)*(-1/2+((1/2)*I)*sqrt(3))^2, (2, 1) = 1/3, (2, 2) = (1/3)*(-1/2+((1/2)*I)*sqrt(3))^2, (2, 3) = -1/6+((1/6)*I)*sqrt(3), (3, 1) = 1/3, (3, 2) = 1/3, (3, 3) = 1/3})

(4)

Iabc := M2[transform] . (Iload^(%T));

Vector(3, {(1) = (2/3)*sqrt(3)*i[T]*exp(-I*Phi[T])/a, (2) = -(1/3)*sqrt(3)*i[T]*exp(-I*Phi[T])/a-I*i[M]*exp(-I*Phi[M])/a, (3) = -(1/3)*sqrt(3)*i[T]*exp(-I*Phi[T])/a+I*i[M]*exp(-I*Phi[M])/a})

(5)

Iabcx := subs[eval]({a=1.0} , Iabc);

Vector(3, {(1) = .6666666667*sqrt(3)*i[T]*exp(-I*Phi[T]), (2) = -.3333333333*sqrt(3)*i[T]*exp(-I*Phi[T])-(1.000000000*I)*i[M]*exp(-I*Phi[M]), (3) = -.3333333333*sqrt(3)*i[T]*exp(-I*Phi[T])+(1.000000000*I)*i[M]*exp(-I*Phi[M])})

(6)

Ipnz := ABC2SEQ . Iabcx:

simplify( Ipnz );

Vector(3, {(1) = (.5773502693-0.6000000000e-10*I)*i[T]*exp(-I*Phi[T])+.5773502694*i[M]*exp(-I*Phi[M]), (2) = (.5773502693-0.6000000000e-10*I)*i[T]*exp(-I*Phi[T])-.5773502694*i[M]*exp(-I*Phi[M]), (3) = 0.})

(7)

 


 

Download Q20200727_2.mw

Having read-only, public proprty of class is very useful. But I am not able to see if Maple supports this.

The idea is to have an object with public variable that can only be read from outside. But to change it, one must call a setter() method.  The advantage of this over having a getter() method to read the variable back is that it simplifies the code and makes it easier to read.  

There is good discussion here on this subject https://www.python-course.eu/python3_properties.php  

and https://en.wikipedia.org/wiki/Property_(programming)  :


"A property, in some object-oriented programming languages, is a special sort of class member, intermediate in functionality between a field (or data member) and a method. The syntax for reading and writing of properties is like for fields, but property reads and writes are (usually) translated to 'getter' and 'setter' method calls. The field-like syntax is easier to read and write than many method calls"

 

In Maple, if I make the variable inside the object an export then now one can not only read it, but also change it from outside. I want to allow only reading from outside. Here is an example

restart;
module my_class()
  option object;

  export name::string; #made it export to allow direct reading
 
  export set_name::static:=proc(o::my_class,name::string)
      o:-name := name;
  end proc;

end module;

And now one can do

o:=Object(my_class);
o:-set_name(o,"me");
o:-name;  #read it

But one can also change it from outside by doing o:-name:="new name";  and this ofcurse breaks the whole idea of encapsulation.

I think allowing reading only of object variables is OK and many OO language allow this. They are called properties.

If the variable above is made local, then one can not read it directly, and a getter() method is needed for each object properties, in addition to setter() method.

Is it possible in Maple to make local object variables read only from outside? If not and if Maplesoft wants to improve its OO, this will be something useful to add for next version.

First 394 395 396 397 398 399 400 Last Page 396 of 2097