MaplePrimes Questions

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?


 

NULL

restart

with(plots)

Pr := 0.1e-1

0.1e-1

(1)

Eq1 := (101-100*d)*(diff(h(eta), eta))+2*f(eta) = 0; Eq2 := (101-100*d)*(diff(f(eta), `$`(eta, 2)))-h(eta)*(diff(f(eta), eta))-f(eta)^2+g(eta)^2-beta*(f(eta)+(1/2)*eta*(diff(f(eta), eta))) = 0; Eq3 := diff(g(eta), `$`(eta, 2))-h(eta)*(diff(g(eta), eta))-2*f(eta)*g(eta)-beta*(g(eta)+(1/2)*eta*(diff(g(eta), eta))) = 0; Eq4 := diff(p(eta), eta)-2*(diff(f(eta), eta))+beta*(h(eta)+eta*(diff(h(eta), eta))) = 0; Eq5 := diff(theta(eta), `$`(eta, 2))-Pr*h(eta)*(diff(theta(eta), eta))-Pr*beta*(3*theta(eta)+eta*(diff(theta(eta), eta))) = 0

(101-100*d)*(diff(h(eta), eta))+2*f(eta) = 0

 

(101-100*d)*(diff(diff(f(eta), eta), eta))-h(eta)*(diff(f(eta), eta))-f(eta)^2+g(eta)^2-beta*(f(eta)+(1/2)*eta*(diff(f(eta), eta))) = 0

 

diff(diff(g(eta), eta), eta)-h(eta)*(diff(g(eta), eta))-2*f(eta)*g(eta)-beta*(g(eta)+(1/2)*eta*(diff(g(eta), eta))) = 0

 

diff(p(eta), eta)-2*(diff(f(eta), eta))+beta*(h(eta)+eta*(diff(h(eta), eta))) = 0

 

diff(diff(theta(eta), eta), eta)-0.1e-1*h(eta)*(diff(theta(eta), eta))-0.1e-1*beta*(3*theta(eta)+eta*(diff(theta(eta), eta))) = 0

(2)

NULL

NULL

`V&lambda;` := [.5, 1, 1.5]; `V&beta;` := [0.5e-1, .1, .2, .4, .7, 1, 1.50, 2]

etainf := 1

bcs := h(0) = 0, p(0) = 0, theta(0) = 1, (D(f))(0) = lambda*f(0)^(4/3)/(f(0)^2+(1-g(0))^2)^(1/3), (D(g))(0) = -lambda*f(0)^(1/3)*(1-g(0)).(1/(f(0)^2+(1-g(0))^2)^(1/3)), f(etainf) = 0, g(etainf) = 0, theta(etainf) = 0

h(0) = 0, p(0) = 0, theta(0) = 1, (D(f))(0) = lambda*f(0)^(4/3)/(f(0)^2+(1-g(0))^2)^(1/3), (D(g))(0) = -f(0)^(1/3)*(1-g(0))*lambda/(f(0)^2+(1-g(0))^2)^(1/3), f(1) = 0, g(1) = 0, theta(1) = 0

(3)

NULL

dsys := {Eq1, Eq2, Eq3, Eq4, Eq5, bcs}

for j to 3 do for i to 8 do lambda := `V&lambda;`[j]; beta := `V&beta;`[i]; dsol[j][i] := dsolve(dsys, numeric, continuation = d); print(beta); print(lambda); print(dsol[j][i](0)) end do end do

Error, (in dsolve/numeric/bvp) singularity encountered

 

NULL

NULL

NULL


 

Download compre1try3.mw


I am facing the same problem with Maple 17. Which is also discussed here

https://www.mapleprimes.com/questions/222168-Maple-Not-Evaluating-Symbolic-Variables?reply=reply

But the link provided below is dead
https://www.maplesoft.com/support/faqs/detail.aspx?sid=34802

Can you recall how to solve it?  I have tried your solution below, but it did not solve it.  

"@peacess If the file isn't there you can just create a new file with a text editor (e.g. Notepad) and add the required option.
Or you can use the maplejava.l4j.ini file inside the .zip file I've attached:  maplejava.l4j.zip"

Thank you.  

This is a very general, basic question.  

When I supply an input is the calculuation/computation performed on my computer?  Is it uploaded to a Maple server for calculating? 

 

I am assuming it takes place on my computer but just wanted to double check.  

 

Also, is there a way to see the progress of a calculation?  If it is something that might take days or even weeks..

First 888 889 890 891 892 893 894 Last Page 890 of 2428