MaplePrimes Questions

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)

 

 

 

Hi there,

What is the algorithm implemented in Maple's function modp1(('Resultant')(...)?

Thank you.

@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.

Find x182 given that

 

x0=2.25

x1=1.75

xn= (1/6)*(sqrt(4+x(n-1))/(x(n-2))

 

and enter your answer correct to 10 significant figures in the box below.

To check that your calculations are correct, you should be able to calculate that  x93 is approximately 0.1348891.

[Note that you should do your calculations correct to 10 significant figures. Use ]

 

     x182=    Preview Change entry mode  

The terms of a sequence an are generated by the recurrence relation

a(n+1)=a(n)−2a(n−1)+a(n−2) for n=3,4,5,...

 

Using your Maple worksheet, write a for loop to find the value of a50 given that

a1=2,a2=-1 and a3=0

 

Copy (Ctrl-C) the correct value of a50 from your Maple worksheet and paste (Crtl-V) it in th answer box.

Preview Change entry mode 

 

 

Hi

When I try to substitute a value for j, it doesn't evaluate.

add.mw

Hi, I'm having trouble setting up a procedure for an assignment, we're trying to find root mean square error and remove variable by variable to find the best line of fit etc etc... hopefully from the coding you can see what I'm am trying to do, but I don't understand why it is not working? I wonder if it has something to do with the X and Y being read in?
 
M:=readdata("C:\\Users\\bjense04.CSUMAIN.001\\Documents\\ass1Q2.txt",[float,float,float,float,float]):
convert(M,matrix):
with(LinearAlgebra):
n:=RowDimension(convert(M,matrix));
X:=convert(M[1..n,1..4],matrix):
Y:=convert(M[1..n,5..5],vector):
with(Statistics):
FullEQN:=LinearFit([1,a,b,c,d],X,Y,[a,b,c,d]);
#the next part is incomplete
rmse_mlr:=proc(Full)
local i, sq, n, predicted;
sq:=0:
for i from 1 to n do
 predicted:=subs([a=X[i,1],b=X[i,2],c=X[i,3],d=X[i,4]],Full);
 sq:=sq+(Y[i]-predicted)^2;
end do:
return sqrt(sq/n);
end proc;
 
 
I then test the procedure with 
rmse_mlr(FullEQN,X,Y);
 
and the response i get is

Error, (in rmse_mlr) final value in for loop must be numeric or character
 
help?
First 521 522 523 524 525 526 527 Last Page 523 of 2428