Maple 2017 Questions and Posts

These are Posts and Questions associated with the product, Maple 2017

Hello,

I have a matrix of size m*n and I want to apply a procedure "f" to each entry of the matrix. But I want to do this in parallel to reduce the computation time.

I used: Matrix(n, m, (i,j) -> Grid:-Seq( f (M (i,j) ) ,i=1..n, j=1..m) ); 

but I'm not satisfied with the result, I want the calculation to be faster. Are there any other methods?

Hi, how can you in maple take the derivitve of a function that consists of sum terms in it? (preferable in document mode)

For example I have this expression (from a math book):

f = N+k*(sum(ln(x__i-B), i = 1 .. N))-N*k*(sum((x__i-B)^k*ln(x__i-B), i = 1 .. N))/(sum((x__i-B)^k, i = 1 .. N))

What I then want to do is to derive this function with respect to k.
However just writing the expression like above it seems like mable doesn't keep the summation terms but evaluates them in a sense. So not sure how to set it up correctly in order to make the derivitive.

Taking the derivitive of f with respect to k, the solution should give something like this:

 

 

I'm trying to plot a function involving exp but keep getting warnings.

How can i avoid this?

plot(2*cos(t)/sqrt((1+exp(-eps*t))*(4/a^2-1)))

but getting the warning message

"Warning, unable to evaluate the function to numeric values in the region; complex values were detected"

Hello

I have a series of plots saved in fig0 (fig0:=rtable(1..number_of_figures);).  I had them plotted using plot:-display(fig0) but I could not figure out how to remove the frame box that separates each figure nor how to control the space between them when using size.

 

An exaggerated example follows

Many thanks

Ed

 

 

Hello everyone

I try to solve the system of nonlinear equations, where three variables are inside of integrals, for different values of the real parameter q.

It seems that  not for all values of q the system has a solution because I substitute different q but the function fsolve does not give any numerical answer or the special message even after the long evaluation. 

Here the code:

restart;
q := 70;
k0 := 100; n := 3; r := 1.1; t := 0.1e-2; Eg := n/((n+1)^(3/2)+1)^(2/3); kF2 := (1/((n+1)^(3/2)+1))^(1/3);
R1 := int(a^2*tanh(sqrt((a^2-mu)^2+d1^2)/(2*t))/sqrt((a^2-mu)^2+d1^2), a = 0 .. k0);
R2 := int(a^2*tanh(sqrt((a^2-mu+Eg)^2+d2^2)/(2*t))/sqrt((a^2-mu+Eg)^2+d2^2), a = 0 .. k0);
R3 := int(a^2*(1-(a^2-mu)*tanh(sqrt((a^2-mu)^2+d1^2)/(2*t))/sqrt((a^2-mu)^2+d1^2)), a = 0 .. k0);
R4 := int(a^2*(1-(a^2-mu+Eg)*tanh(sqrt((a^2-mu+Eg)^2+d2^2)/(2*t))/sqrt((a^2-mu+Eg)^2+d2^2)), a = 0 .. k0);
Eq1 := evalf(k0+k0*(r-1)-(1/2)*Pi*r*kF2*q-R1);           
Eq2 := evalf(k0-(1/2)*Pi*kF2*q-R2);
Eq3 := evalf(2/3-R3-R4);
fsolve({Eq1, Eq2, Eq3}, {d1, d2, mu});

I know that this system has the solution for some values of q but why I can't get the solution or the answer using fsolve?

Thank you in advance.

 

Update. I apologize, I made some errors in expressions R2 and R4. I have corrected the question and the code. But the problem is still unresolved.

I'm working on several worksheets where I solve numerical DE's. I would like to compare the solutions by plotting in one graph So I though it would be nice to have a seperate worksheet for this.

My approach:

Statements from my original sheets:
> solution:=dsolve({ODES,ICS},maxfun=0,numeric,range=0..10,output=listprocedure):
> X__br:=eval(xbr(t),solution):


I can plot these variables in my original sheet with plot(X__br(t),t=0..10).
However, when I transfer it to a different sheet by:

> save X__br, "filename.mpl"

And then load it into a new sheet by
> read("D:/.../filename.mpl");

There seems to be no possible way to plot the X__br(t) anymore. How can I solve this?
My error when I try plot(X__br(t),t=0..10) is:

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Hi

I want to create a Heaviside function called MyStep() which will behave exactly like the built in Heaviside with one exception: for MyStep(0) it will return 1 instead of undefined.

 

MyStep(t) = 0, 0<t

MyStep(t) = 1, else

 

Thanks

I have this equation but maple solve root is 2

Root_eq.mw

Root is 4 x1 =1, x2= 8.95006470,

x3 =0 .6939575785

x4 = -0.6440222825

 

Hello, for an assignment I was given the task of iteratively calculating the water depth of a flow using Newton's method. For this I tried to create a procedure wich uses a number of input values. The code is listed below;

 

restart;
Newton := proc (n, y0, Q, b, m, k, S0) local A, P, Sf, y, F, dAdy, dPdy, Fdiff, i; global ylist; y[0] := y0; for i from 0 to n do A[i] := (b+m*y[i])*y[i]; P[i] := b+2*y[i]*sqrt(1+m^2); Sf[i] := Q*abs(Q)*P[i]^(4/3)/(k^2*A[i]^(10/3)); F[i] := S0/Sf[i]-1; dAdy[i] := b+2*m*y[1]; dPdy[i] := 2*sqrt(1+m^2); Fdiff := (2/3)*(F[i]-1)(5*dAdy[i]/A[i]-2*dPdy[i]/P[i]); y[i] := procname(evalf(y[i]-F[i](y[i])/Fdiff[i](y[i]))) end do; ylist := [seq(y[i], i = 0 .. n)]; return ylist end proc;

Newton(10, 1, 5, 12, 1, 30, 0.1e-4);
Error, (in Newton) invalid input: Newton uses a 2nd argument, y0, which is missing

 

As you can see, I get an error referring to the second argument y0, which is the starting value of the calculation. The error says the argument is missing, however it is right there in the brackets of the Newton procedure (along with the values of all other parameters). I have tried explicitly stating that y0:=1, and changing the name of the parameter, however that didn't help.

Am I missing something really simple, or is there something wrong with my code?

Thanks in advance.

I find the 2D math input in Maple to somewhat cumbersome for various expressions.
Specifically, I have a function f(z) = z^2, with w = f(I x + y) where I is the imaginary number.

I typed the line in 2D math

plots[implicitplot]({Im(w) = 2, Re(w) = 2}, x = -5 .. 5, y = -5 .. 5, colour = {"Blue", "Red"})
Error, (in plot/color) invalid color specification: {"Blue", "Red"}

For some reason this does not work in 2D math, but in Maple-input it works as expected.

I recall from past use of Maple, that there were other problems as well with the 2D math input.
I know you need to be particular with the use of space. 

Are there other common pitfalls or "bugs" related to use of 2D math input ?

Hello

I am revising the unstable period orbits of the Logistic map, y[n]=4*y[n-1]*(1-y[n]), in Maple.  Although I have implemented the equation and use a loop for the iterations, I wonder whether there is a faster and concise way to code the equation in Maple. 

Here it is what I did:

y[0] := (-sqrt(5)+5)*(1/8);

for n to 10 do y[n] := 4*y[n-1]*(1-y[n-1]) end do;
soly := [seq(simplify(expand(y[n]), radical), n = 0 .. 10)];
dat := [seq([n, Re(evalf(soly[n]))], n = 1 .. 10)]; plot(dat, labels = ["k", "x(k)"], style = pointline,title="Period 2");

Since only few iterations are needed, the solution is symbolic (and then convert to float).  

Many thanks.

Ed

 

 

Hello

I wonder how I could use Maple commands to do the following:

An irrational number, ir, (a huge symbolic expression as a result of iterating a discrete map) is converted to single precision (Real16) and then to hexadecimal as a string. Example: using matlab it will be something like single(ir)=0.25(float representation) =3e800000 (hexadecimal representation).

I am not sure if single precision is available in Maple 2017 but I guess Real32, Real64 and Real128 are.

Once the hexadecimal representation is acquired I need to convert it back to Real16, Real 32 and etc.

Your help is much appreciated.

Many thanks

Ed

Trying to simulate tossing 10 coins. What  am i doing rong? Thanks

 

``

restart

a := Vector[row](1 .. 10)

Vector[row](%id = 18446745395177063238)

(1)

randomize()

for k to 10 do r := rand(1 .. 2); if r < .5 then a[k] := "H" else a[k] := "T"; print(a[k]) end if end do

proc () (proc () option builtin = RandNumberInterface; end proc)(6, 2, 1)+1 end proc

 

Error, cannot determine if this expression is true or false: r < .5

 

a

Vector[row](%id = 18446745395177063238)

(2)

``


 

Download CoinToss.mw

 

 

If I add "restart" to a program, then interface(imaginaryunit=j) don't work. Why? 

***********************************
restart;
interface(imaginaryunit = j);
j^2;
************************************
The output is j^2  but the output should be -1. 

 

Hello,
I am new to Maple and have some problems with fonts in Maple's forms. How can I increase the size of the monospaced font? (see the screenshot).

First 8 9 10 11 12 13 14 Last Page 10 of 40