MaplePrimes Questions

with(LinearAlgebra):
test1 := Matrix([[1,-1],[-1,1]]);
for i from 1 to 20 do
print(Eigenvectors(test1)[2]);
od:

i run the same command 20 times, but sometimes left has negative 1 , sometimes right has negative 1

why position is like random , is my maple has virus?

the result are not consistent, i am learning quantum computation, will this influence the quantum computation and result?

i am doing up and down and change to a differential equation, Pauli equation

It seems only one Pauli equation

i find 3*3 matrix 

has 3 different kinds of matrix

one is row 1 and row 2

second is row 1 and row 3

Third is row 2 and 3

column 1 is constant 

Is there any one has the same experience to predict these 3 kind of matrix, and know what I mentioned?

 

I am writing questions in Maple T.A.  I want to call Matlab functions to generate answers and compare to the student's answers. I want to call both built-in functions and my own functions.  I notice that Maple has Matlab Link for this purpose.  Can it be used also within Maple T.A.?  

Stig Larsson, Mathematical Sciences, Chalmers University of Technology, Sweden

 

 

 

 

What am I doing wrong here, or don't understand about Maple. I followed the 'IF' structure from Maple help. I am getting the wrong result.

a := 1:
b := 3:
if a > b then
    print(wrong)
else
    print(correct)
end if
                            correct
 

Is there a way to have Maple show me approximately how much time is left for a calculation?  

lets say I wanted to calculate the new Mersenne Prime and check to see if it is prime.. 

type(2^(74207281)-1, prime)

This would no doubt take a long time to verify but that is not my concern.  I am simply concerned with whether or not I can see how long maple thinks it will take to perform this action 

I would be in worksheet mode simply inputing a calculuation.

thanks.

Does any body have example of maple code for solving optimal control problem in deterministic model using Pontryagin's maximum (or minimum) principle?

how can solve this nonlinear integral eq?

Hi

How do I disable the black borders around each command line in worksheet mode? I've seen it at several occasions, but I don't know how to do it :)

I think it would make my worksheets look much better, especially when exporting them to PDF.

 

If you are unsure about what I meant, the black borders can be seen here: https://image.prntscr.com/image/Foc_EYldSXiqb9T_8wLuYA.png

Anybody have idea how to solve endemic equilibrium using maple? 

dS/dt=(1−p)π+φV+δR−(μ+λ+ϑ)S

dV/dt=pπ+ϑS−(μ+ϵλ+φ)V

dC/dt=ρλS+ρϵλV+(1−q)ηI−(μ+β+χ)C

dI/dt=(1−ρ)λS+(1−ρ)ϵλV+χC−(μ+α+η)I

dR/dt=βC+qηI−(μ+δ)R

 

Or solve by hand?

Look at the following code:

M1 := (t,lambda1,k,lambda2) -> exp( -(1/2)*(log(1-2*lambda1*t) + k*log(1-2*lambda2*t)) )

int( diff(M1(z,2,9,1/2),z)/sqrt(abs(z)),z=-infinity..0 )/GAMMA(1/2) 

simplify(%)

evalf(%)

returns:    -4.682354481-5.587737200*I

 

which cannot be true. 

I tried a number of "simplify" options, none of which yielded the desired simple result.

In Maple12 and 2017 we can load a .wav file and Preview no problems. 

The problem occurs when we apply a moving average from the Statistics package and then attempt to Preview the result. Warning - if you don't limit the size of the number of elements when executing the Preview you will freeze and lock up your computer as it attempts to output to the display the errors on each element.

For example.

Using the windows Ding.wav

with(AudioTools):
a:=Read("c:/test/Ding.wav"): #just a random test location I have the Ding.wav file in.
b:=ToMono(a): #changing to Mono.
c:=b^2: #squaring the signal.

with(Statistics):

d:=MovingAverage(c,30):

Preview(d[1..5]) #selecting a small number of values so I don't lock up my system.

Now Preview(d) works in M12 (ie there were no errors and a plot was presented). 

Why doesn't this work in 2017? 

Hello,

I need to construct a sequence of matrices of different sizes, but with similar structure, and to study their determinants etc.

I wrote the following code:

restart: with(LinearAlgebra):
for n from 5 to 8 do:
for i from 1 to n do for j from 1 to n do A[i,j]:=0 od: od:
for i from 1 to n-1 do A[i,i+1]:=3 od:
for i from 1 to n do A[i,i]:=4 od:
for i from 2 to n do A[i,i-1]:=5 od:
A:=([seq([seq(A[i,j],j=1..n)],i=1..n)]);
Determinant(evalm(1-t*A));
od:

 

However, I get the following error message: "Error, out of bound assignment to a list".

If I add evalm to A:=..., it changes to "Error, 2nd index, 6, larger than upper array bound 5".

I don't see why. I think that by the moment that i and/or j can assume 6, n is already 6.

So what is wrong, and how can this be fixed? Thanks in advance.

I wish to solve three linear simultaneous equations and obtain the solutions in floating point form.

the following works...

solvec:=fsolve({T+N1-m1=0, N2-N1-m2=0,T-N2-m3=0}, {T,N1,N2});

...but the solutions are given in either symbolic, or equation form.  I would like numbers - floating point form.

Below is my attempt to solve this.  with(plots) & with(plottools) is not necessary for this - but I was doing some related graphic work.  I did try with(RealDomain), but it seemedto make little difference.  I have done a copy & paste of an rtf file, but the Maple output has not come out so well.  Any help would be appreciated. 

> restart:

with(plots):

with(plottools):

with(RealDomain);

#Masses in kg (or pounds!)

m1:=70.0:m2:=25.0:m3:=3.0:

#Equations

solvec:=fsolve({T+N1-m1=0, N2-N1-m2=0,T-N2-m3=0}, {T,N1,N2});

#Above gives the solutions in symbolic or equation form, as well as putting the solutions in a set.  How can the programme distinguish between the various values?

 

# From here is my attempt to form floating point values – to no avail.

NTab:=convert([solvec],table);

N1A:=evalf(solvefor[N1](T+N1-m1*g=0, N2-N1-m2*g=0,T-N2-m3*g=0));

N1B:=convert(N1A, float);

 

#Problem to isolate the solutions in the vector in floating form,

#and also get the correct ones.  NB the solution is a set - not an ordered list.

maxvec:=max(solvec[1],solvec[2],solvec[3]);

#maxvec:=convert(max(solvec[1],solvec[2],solvec[3]), float);

maxvec:=convert(solvec[2], float);

solvec[2];

whattype(solvec[2]);

type(N2,symbol);

type(solvec[2],equation);

N2_fl:=evalf(solvec[2]);

N2_fl:=convert(solvec[2], float);

 

N3:=N2_fl+3;

#Actual true answers

#T:=(m1+m2+m3)/2;

#N1:=(m1-m2-m3)/2;

#N2:=T-m2;

 

OUTPUT:

 

 

Error, (in simpl/max) arguments must be of type algebraic

 

Error, (in simpl/relopsum) invalid terms in sum

Is there a way for Maple to tell where the error occurs? For example I am not able to find the error that says 'Error, missing operator or `;'' in the following code.

 

# ctrl + del to delete a Maple cell
# golden search implementation
# chapra 7th ed
golden_search := proc(f, xl, xu, es100, maxiter)
description "find the optimal point using golden-search optimization method";
locals R, d, xopt, x1, x2, f1, f2, iter, ea, xint;
R := (sqrt(5)-1)/2;
d := R*(xu-xl);
x1 := xl + d;
x2 := xu - d;
f1 := evalf(eval(f, x = x1));
f2 := evalf(eval(f, x = x2));
# declare iterator and ea
iter := 1;
ea := 1.00;
# start while
while ea*100 > es100 and iter < maxiter do
    d := R*d; # new golden ratio
    xint := xu - xl;
    if f1 > f2 then
        xopt := x1;
        fx := f1;
        x1 := x2;
        x2 := x1;
        x1 := x1 + d;
        f2 := f1;
        f1 := evalf(eval(f, x = x1));
    else
        xopt := x2;
        fx := f2;
        xu := x1;
        x1 := x2;
        x2 := xu - d;
        f1 := f2;
        f2 := evalf(eval(f, x = x2));
    end if
    # calculate new ea
    if xopt <> 0 then
        ea := (1 - R)* abs(xint/xopt);
    end if
    iter = iter + 1;
end do;
# return xopt and fx here
xopt;
end proc:
 

While using a version of Maple on the inverse symbolic calculator I first described my idea for a new constant in 1999 and other people named it after me, calling it the MRB constant. While looking for an applied math purpose for the MRB constant =sum((-1)^k (k^(1/k)-1),k=1..infinity), I noticed that the absolute value of its summand is the interest rate to multiply an investment k times in k years=k^(1/k)-1. Any ideas on how this might be related to other subjects?

First 893 894 895 896 897 898 899 Last Page 895 of 2433