Maple 2018 Questions and Posts

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

Hello. I want to organize some parameter
F=fsolve(1+x^2=j).

If j=-5, for example, an empty value 'F=' will be returned. How can I write the expression

If F=(void), then action 1, else action 2 end if

The fact is that I just don't know how to write the result (void), that is, the result of 'F ='

Thanks

Hello 

Imagine you have an irregular polygon as follows:

restart; with(plottools):with(plots):

display(polygon([[0,0],[200,0],[200,300],[250,400],[500,300],[500,500],[0,500]]),color=yellow,linestyle=solid,thickness=2);

with vertices that can be easily defined, and that you have an arbitrary point P(x,y) with coordinates of (x) and (y). I want Maple to check whether the point P(x,y) is inside or outside the polygon. In Matlab, the command (inpolygon) can be used for such a task. Is there a similar readily available command in Maple. 

Thank you very much for your help and support. 

From
with(numtheory):
msolve(x^2=-1,5);                                I get
                        {x = 2}, {x = 3}
But I need the integers 2 and 3. Who can help me?

Good day!

I would welcome any help to explain how to plot a simple function, z, of two variables, (x, y) so that I can show the relationships between variables.

Basically, I need to plot a family of z-curves for varying x and y values and also would like to understand how to display the z-y and z-x plots. 

Thanks for reading!

MaplePrimes_Nov_29.mw

Hello.

I wrote some codes for solving equations in a special way. My codes work very fine when my differential system has only one equation.

But when I extend it to a system that has two or more equations, sometimes does not work and I face with error. However, in one system (2 eq) it also works. But it is only a special case. If you want, I can upload it here as well.

I am attaching the maple file containing the error. You can observe it. 

By examining many cases, I think that maybe the root of the problem is that I must change my codes in a way that they are for a "system". Indeed, instead of writing codes for each differential equation, I must define a system and write these codes for a system containing some differential equations.
However, I think that the boundary conditions sometimes also may be the root of the error.

I change the attached codes for this purpose, but I failed. I prefer to not present my wrong codes for this purpose. 

If it is possible, help me to change my codes.

Thanks a lot.

ERROR.mw

I need help on maple code for solving both linear and non linear boudary condition for fractional order partial differential equation 

My Maple worksheet, which was working fine a few days ago, suddently cannot be modified. Many elements on the top bar (execute group, execute entire worksheet, insert maple prompt) are grayed out. Additionally I cannot edit any commands in the worksheet; clicking a command does not show any cursor and keyboard input does nothing.

Apparently I have entered some kind of read-only mode. I do not know how I did this. Meanwhile, if I start a new worksheet I can edit and execute as normal.

How do I revert my worksheet back to normal?

Hello. Please help me solve the ODE system

ODU_v2.mw
 

restart

with(linalg):

r1 := 1:

1

 

0.1111110000e-2

 

0

 

1920.000000+0.7407400000e-3*I

(1)

J := proc (n, x) options operator, arrow; BesselJ(n, x) end proc:

nsize := floor(2*k)+1;

3

(2)

n := 1; A1 := matrix([[(lambda(r)+2*mu(r))*r^2, 0], [0, mu(r)*r^2]]); B1 := matrix([[(diff(lambda(r), r)+2*(diff(mu(r), r)))*r^2+(lambda(r)+2*mu(r))*r, I*n*(lambda(r)+mu(r))*r], [I*n*(lambda(r)+mu(r))*r, (diff(mu(r), r))*r^2+mu(r)*r]]); C1 := matrix([[(diff(lambda(r), r))*r-lambda(r)-(n^2+2)*mu(r)+omega^2*rho(r)*r^2, I*n*((diff(lambda(r), r))*r-lambda(r)-3*mu(r))], [I*n*((diff(mu(r), r))*r+lambda(r)+3*mu(r)), -(diff(mu(r), r))*r-n^2*lambda(r)-(2*n^2+1)*mu(r)+omega^2*rho(r)*r^2]]); U := vector([U1(r), U2(r)]); DU := vector([diff(U1(r), r), diff(U2(r), r)]); D2U := vector([diff(U1(r), `$`(r, 2)), diff(U2(r), `$`(r, 2))]); T1 := multiply(A1, D2U); T2 := multiply(B1, DU); T3 := multiply(C1, U); prav := evalm(T1+T2+T3); pr1 := prav[1]; pr2 := prav[2]; p1 := evalc(Re(pr1)); p2 := evalc(Im(pr1)); p3 := evalc(Re(pr2)); p4 := evalc(Im(pr2)); WWVV := evalf(subs(x = k*r1, H(n, x)))*evalf(subs(x = k2*r1, H(n, x)))*n^2-evalf(subs(x = k*r1, DH(n, x)))*evalf(subs(x = k2*r1, DH(n, x)))*k*k2*r1^2; `αv1` := I*evalf(subs(x = k2*r1, DH(n, x)))*k2*omega*r1^2/WWVV; `αv2` := -evalf(subs(x = k2*r1, H(n, x)))*n*omega*r1/WWVV; `αv3` := (evalf(subs(x = k*r1, DJ(n, x)))*evalf(subs(x = k2*r1, DH(n, x)))*I^n*k*k2*r1^2-I^n*n^2*evalf(subs(x = k*r1, J(n, x)))*evalf(subs(x = k2*r1, H(n, x))))/WWVV; `αv4` := evalf(subs(x = k*r1, H(n, x)))*r1*n*omega/WWVV; `αv5` := -I*evalf(subs(x = k*r1, DH(n, x)))*r1^2*k*omega/WWVV; `αv6` := I*I^n*n*k*r1*(evalf(subs(x = k*r1, DJ(n, x)))*evalf(subs(x = k*r1, H(n, x)))-evalf(subs(x = k*r1, DH(n, x)))*evalf(subs(x = k*r1, J(n, x))))/WWVV; gv1 := rho1*(-evalf(subs(x = k*r1, D2H(n, x)))*k^2*r^2*(4*nu+3*xi)-3*evalf(subs(x = k*r1, DH(n, x)))*k*r1*xi+evalf(subs(x = k*r1, H(n, x)))*(-4*k^2*r1^2*nu-3*k^2*r1^2*xi+(3*I)*omega*r1^2-2*n^2*nu+3*n^2*xi))/(3*r1^2); gv2 := (6*rho1/(3*r1^2)*I)*n*nu*(evalf(subs(x = k2*r1, H(n, x)))-k2*r1*evalf(subs(x = k2*r1, DH(n, x)))); gv3 := rho1*(-I^n*evalf(subs(x = k*r1, D2J(n, x)))*k*r1^2*(4*nu+3*xi)+I^n*evalf(subs(x = k*r1, DJ(n, x)))*k*r1*(2*nu-3*xi)+I^n*evalf(subs(x = k*r1, J(n, x)))*(-4*k^2*r1^2*nu-3*k^2*r1^2*xi+(3*I)*omega*r1^2-2*n^2*nu+3*n^2*xi))/(3*r1^2); gv4 := (2*nu*rho1/r1^2*I)*n*(evalf(subs(x = k*r1, H(n, x)))-evalf(subs(x = k*r1, DH(n, x)))*k*r1); gv5 := nu*rho1*(evalf(subs(x = k2*r1, D2H(n, x)))*k2^2*r1^2-evalf(subs(x = k2*r1, D2H(n, x)))*k2*r1+evalf(subs(x = k2*r1, H(n, x)))*n^2)/r1^2; gv6 := (2*nu*rho1/r1^2*I)*n*I^n*(evalf(subs(x = k*r1, J(n, x)))-k*r1*evalf(subs(x = k*r1, DJ(n, x)))); E := matrix([[`αv1`*gv1+`αv4`*gv2+lambda(r1)/r1, `αv2`*gv1+`αv4`*gv2+I*n*lambda(r1)/r1], [`αv1`*gv4+`αv4`*gv5+I*n*mu(r1)/r1, `αv2`*gv4+`αv5`*gv5-mu(r1)/r1]]); G := vector([-gv1*`αv3`-gv2*`αv6`-gv3, -gv4*`αv3`-gv5*`αv6`-gv6]); e1 := (lambda2*n^2*evalf(subs(x = kl*r2, J(n, x)))-kl^2*r2^2*evalf(subs(x = kl*r2, D2J(n, x)))*(lambda2+2*mu2)-kl*lambda2*r2*evalf(subs(x = kl*r2, DJ(n, x))))/r2^2; e2 := (2*mu2*I)*n*(evalf(subs(x = kt*r2, J(n, x)))-kt*r2*evalf(subs(x = kt*r2, DJ(n, x))))/r2^2; e3 := (I*n*2)*(evalf(subs(x = kl*r2, J(n, x)))-kl*r2*evalf(subs(x = kl*r2, DJ(n, x))))/r2^2; e4 := (kt^2*r2^2*evalf(subs(x = kt*r2, D2J(n, x)))-kt*r2*evalf(subs(x = kt*r2, DJ(n, x)))+n^2*evalf(subs(x = kt*r2, J(n, x))))/r2^2; gamma1 := kt*r2*evalf(subs(x = kt*r2, DJ(n, x)))/WW; gamma2 := I*n*evalf(subs(x = kt*r2, J(n, x)))/WW; gamma3 := I*n*evalf(subs(x = kl*r2, J(n, x)))/WW; gamma4 := -kl*r2*evalf(subs(x = kl*r2, DJ(n, x)))/WW; WW := (kl*r2^2*evalf(subs(x = kl*r2, DJ(n, x)))*kt*evalf(subs(x = kt*r2, DJ(n, x)))-n^2*evalf(subs(x = kl*r2, J(n, x)))*evalf(subs(x = kt*r2, J(n, x))))/r2; F := matrix([[r2^2*(gamma1*e1+gamma3*e2+lambda(r2)/r2), r2^2*(gamma2*e1+gamma4*e2+I*n*lambda(r2)/r2)], [mu2*r2^2*(gamma1*e3+gamma3*e4+I*n*mu(r2)/(mu2*r2)), mu2*r2^2*(gamma2*e3+gamma4*e4-mu(r2)/(mu2*r2))]]); Ur1 := vector([U1(r1), U2(r1)]); Ur2 := vector([U1(r2), U2(r2)]); DUr1 := vector([Dx1(r1)+I*Dy1(r1), Dx2(r1)+I*Dy2(r1)]); DUr2 := vector([Dx1(r2)+I*Dy1(r2), Dx2(r2)+I*Dy2(r2)]); CCR1 := multiply(A1, DUr1); CCR2 := multiply(E, Ur1); CR := evalm(CCR1+CCR2); CCR11 := multiply(A1, DUr2); CCR22 := multiply(F, Ur2); CR2 := evalm(CCR11+CCR22); ggr1 := expand(evalc(Re(CR[1]))); ggr2 := expand(evalc(Im(CR[1]))); ggr3 := expand(evalc(Re(CR[2]))); ggr4 := expand(evalc(Im(CR[2]))); ggr5 := expand(evalc(Re(CR2[1]))); ggr6 := expand(evalc(Im(CR2[1]))); ggr7 := evalc(Re(CR2[2])); ggr8 := evalc(Im(CR2[2])); gr1 := subs(Dx1(r1) = (D(x1))(r1), Dx2(r1) = (D(x2))(r1), Dy1(r1) = (D(y1))(r1), Dy2(r1) = (D(y2))(r1), r = r1, ggr1); gr2 := subs(Dx1(r1) = (D(x1))(r1), Dx2(r1) = (D(x2))(r1), Dy1(r1) = (D(y1))(r1), Dy2(r1) = (D(y2))(r1), r = r1, ggr2); gr3 := subs(Dx1(r1) = (D(x1))(r1), Dx2(r1) = (D(x2))(r1), Dy1(r1) = (D(y1))(r1), Dy2(r1) = (D(y2))(r1), r = r1, ggr3); gr4 := subs(Dx1(r1) = (D(x1))(r1), Dx2(r1) = (D(x2))(r1), Dy1(r1) = (D(y1))(r1), Dy2(r1) = (D(y2))(r1), r = r1, ggr4); gr5 := subs(Dx1(r2) = (D(x1))(r2), Dx2(r2) = (D(x2))(r2), Dy1(r2) = (D(y1))(r2), Dy2(r2) = (D(y2))(r2), r = r2, ggr5); gr6 := subs(Dx1(r2) = (D(x1))(r2), Dx2(r2) = (D(x2))(r2), Dy1(r2) = (D(y1))(r2), Dy2(r2) = (D(y2))(r2), r = r2, ggr6); gr7 := subs(Dx1(r2) = (D(x1))(r2), Dx2(r2) = (D(x2))(r2), Dy1(r2) = (D(y1))(r2), Dy2(r2) = (D(y2))(r2), r = r2, ggr7); gr8 := subs(Dx1(r2) = (D(x1))(r2), Dx2(r2) = (D(x2))(r2), Dy1(r2) = (D(y1))(r2), Dy2(r2) = (D(y2))(r2), r = r2, ggr8); sys := p1 = 0, p2 = 0, p3 = 0, p4 = 0; Inits := gr3 = evalc(Re(G[2])), gr4 = evalc(Im(G[2])), gr1 = evalc(Re(G[1])), gr2 = evalc(Im(G[1])), gr5 = 0, gr6 = 0, gr7 = 0, gr8 = 0; dde := dsolve({Inits, sys}, numeric, [x1(r), x2(r), y1(r), y2(r)], method = bvp[trapdefer], 'maxmesh' = 5000)

1

 

5860000000.*r^2*(diff(diff(x1(r), r), r))+5860000000.*r*(diff(x1(r), r))-4880000000.*r*(diff(y2(r), r))+(-6840000000.+0.1972224000e11*r^3-0.1380556800e11*r^2)*x1(r)-(15217.76256*r^3-10652.43379*r^2)*y1(r)+6840000000.*y2(r) = 0, 5860000000.*r^2*(diff(diff(y1(r), r), r))+5860000000.*r*(diff(y1(r), r))+4880000000.*r*(diff(x2(r), r))+(15217.76256*r^3-10652.43379*r^2)*x1(r)+(-6840000000.+0.1972224000e11*r^3-0.1380556800e11*r^2)*y1(r)-6840000000.*x2(r) = 0, 980000000.0*r^2*(diff(diff(x2(r), r), r))-4880000000.*r*(diff(y1(r), r))+980000000.0*r*(diff(x2(r), r))-6840000000.*y1(r)+(-6840000000.+0.1972224000e11*r^3-0.1380556800e11*r^2)*x2(r)-(15217.76256*r^3-10652.43379*r^2)*y2(r) = 0, 980000000.0*r^2*(diff(diff(y2(r), r), r))+4880000000.*r*(diff(x1(r), r))+980000000.0*r*(diff(y2(r), r))+6840000000.*x1(r)+(15217.76256*r^3-10652.43379*r^2)*x2(r)+(-6840000000.+0.1972224000e11*r^3-0.1380556800e11*r^2)*y2(r) = 0

 

980000000.0*(D(x2))(1)-3407670.437*x1(1)-979699593.0*y1(1)-982493864.9*x2(1)+2501551.625*y2(1) = -1147.143928, 980000000.0*(D(y2))(1)+979699593.0*x1(1)-3407670.437*y1(1)-2501551.625*x2(1)-982493864.9*y2(1) = 522.0509891, 5860000000.*(D(x1))(1)+1012610130.*x1(1)+3433520814.*y1(1)-3395293.932*x2(1)-3899703885.*y2(1) = 1553476.957-0.8860949e-3*r^2, 5860000000.*(D(y1))(1)-3433520814.*x1(1)+1012610130.*y1(1)+3899703885.*x2(1)-3395293.932*y2(1) = 582234.6500+.6073438988*r^2, 3750400000.*(D(x1))(.8)-0.1805979289e11*x1(.8)-3057.354840*y1(.8)+182.8516896*x2(.8)+0.2220128109e11*y2(.8) = 0, 3750400000.*(D(y1))(.8)+3057.354840*x1(.8)-0.1805979289e11*y1(.8)-0.2220128109e11*x2(.8)+182.8516896*y2(.8) = 0, 627200000.0*(D(x2))(.8)-182.8520640*x1(.8)-0.2610528071e11*y1(.8)-0.2508771663e11*x2(.8)-607.0797125*y2(.8) = 0, 627200000.0*(D(y2))(.8)+0.2610528071e11*x1(.8)-182.8520640*y1(.8)+607.0797125*x2(.8)-0.2508771663e11*y2(.8) = 0

 

Error, (in dsolve/numeric/BVPSolve) unable to store '-HFloat(8.860193192958832e-4)+0.8860949e-3*r^2' when datatype=float[8]

 

``


 

Download ODU_v2.mw

 

I don't know how overcoming this error . Thank you. MyPackage := module() export f1, f2; local loc1; option package; f1 := proc() loc1 end proc; f2 := proc( v ) loc1 := v end proc; loc1 := 2; end module: savelib('MyPackage'); Error, cannot open archive, C:\Program Files\Maple 2018\lib, for writing. restart; with(MyPackage); Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received MyPackage
How to build a library (package) containing my own procedures ? Could you give me an example. Thank you.

Hello,

I want to create a plot of a gradient field of a function with singularities I want to draw arrows only where the function has values below 3,   or written: where f(x,y) < 3.

MY CODE:

potfeld := f(x, y) -> 1/sqrt(y^2+x^2);
   for i to 5 do
           for j to 3 do
                    if sqrt(i^2+j^2) <> 0 and sqrt((i-2)^2+j^2) <> 0 and potfeld(i, j) < 3
                       then P[i, j] := arrow(`<,>`(i, j), `<,>`((D[1](potfeld))(i, j), (D[2](potfeld))(i, j)))
                       else P[i, j] := arrow(`<,>`(i, j), `<,>`(.1, .1))
                   end if
           end do
    end do;
Pseq := seq(seq([P[k, l]], k = 1 .. 5), l = 1 .. 3);
display(Pseq, view = [1 .. 5, 1 .. 3], scaling = constrained);

 

RESULTS IN:
Error, cannot determine if this expression is true or false:  (1/2)*2^(1/2) < 3.0

The "(1/2)*2^(1/2)" are the value of the function potfeld(x,y) evaluated at (1,1).

I ask for your help, as with many changes and variations I have not managed to solve this issue.
+Thx and regards+

A line is deternined on one side by 16*x-2*y-11*z=0, 14*x-y-10*z=3 and on the other by (x-2)/3=(y-5)/2=(z-2)/4. Are they equivalent  ?  Thank you. 

I have made a procedure named Eratosthenes that will return a sequence of all the primes less than some given number N which must be a positive integer. However, I couldn't figure out the error but still, the code is not working either. Can anyone please go through my code to let me know if I have a mistake? Thanks.

Eratosthenes := proc (N::posint) local L, primeslist, n, k; description "Calculate all primes less than or equal to N"; L := Array(2 .. N, proc (i) options operator, arrow; true end proc); for n from 2 to trunc(sqrt(N)) do if L__n = true then for k from n while k*n <= N do `L__k*n` := false end do end if end do; primeslist := NULL; for n from 2 to N do if L__n = true then primeslist := primeslist, n end if end do; primeslist end proc:

Warning, ``L__k*n`` is implicitly declared local to procedure `Eratosthenes`

 

``NULL


 

Download issue.mwissue.mw

I have been trying to solve the following question using Maple for quite some time but couldn't do it. Any guide will be highly appreciated. 

P.S: I have just started learning it by myself in the last few days. I have been following An Introduction to Modern Mathematical Computing: With Maple. If you could suggest a more useful text, that would be helpful.

Please find the question below.

1 2 3 4 5 6 7 Last Page 3 of 57