Maple 2016 Questions and Posts

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

Maplet file failed to open by double click in windows 7 x64 file browser

There is no response when double click a Maple file

But it runs correctly by using command line

Anyone knows why?

I attempted to show that two lines are parallel.  I started with a problem in Geometry for which I do not have the solution.

I tried several ways with Maple to show this to be true.  Most of the time, I ended when maple could not determine if a-b = c-d, etc.

brg_proof.txt contains a statement of the problem and my latest maple code.

Question: How should I approach the proof, by the compass and straight edge method?  Is this possible in maple?

intersection in the geometry package does not seem to recognize assume.

restart: with(geometry):

assume(p[1]<>0, p[2]<>0, p[3]<>0);
assume(q[1]<>0, q[2]<>0, q[3]<>0);
point(T,[p[1],q[1]]);
point(U,[p[2],q[2]]);
point(V,[p[3],q[3]]);
point(Op,[0,0]);

line(OT,[Op,T]);
line(OU,[Op,U]);
line(OV,[Op,V]);

point(B,2*q[2],solve(subs(x=2*q[2],Equation(OU)),y));
coordinates(B);
IsOnLine(B,OU);

PerpendicularLine(AD,B,OT);
ArePerpendicular(AD,OT);
sol:=solve({Equation(AD),Equation(OT)},{x,y});
eval(x,sol);
point(A,eval(x,sol),eval(y,sol));  ## the intersection exists
intersection(xA,AD,OT); ## fails
about(p[1]),about(q[1]);

I have several plots generated with geometry objects:

plt1 := draw(...); plt2 := draw(...)

I want to display all them with a reasonable window.  I have been looping and and using a rather dumb proc to find the window size. I use the view=[...] option with the values calculated to set the plot view.

I wanted to post the proc, but, really messed that up!  I will try the proc later.

 

Some of the plots I am working with have views like

> for itm in [relBrgLinePlot,relTgtPositPlot,relTgtLinePlot] do
    op(-1,itm);
end do;
                     VIEW(0. .. 95., -61.58179461 .. 16.)
                 VIEW(5.48225506 .. 95., -61.58179461 .. 16.)
                 VIEW(5.48225506 .. 95., -61.58179461 .. 16.)

> for itm in [geoSensPositPlot,geoSensLinePlot,\
            geoBrgLinePlot,geoTgtPositPlot,geoTgtLinePLot] do
    op(-1,itm);
end do;
                  VIEW(0. .. 35.35331852, 0. .. 87.13244438)
                  VIEW(0. .. 35.35331852, 0. .. 87.13244438)
                     VIEW(0. .. 95., 0. .. 87.13244438)
                 VIEW(40.83557358 .. 95., 16. .. 25.55064977)
                 VIEW(40.83557358 .. 95., 16. .. 25.55064977)

Is there an easier way to do this?

Linux.  I want to put grid lines on an x11 device.

The x11 device is better for plotting because if the window is resized, the plot resizes with it.

restart;
plotsetup(x11);plot(sin(x),x=-1..1,gridlines = true); ## no gridlines

restart;
plotsetup(maplet);
plot(sin(x),x=-1..1,gridlines = true); ## have gridlines

Any way to get gridlines on x11 device?

Tom Dean

I have a Maple result presented in the first (top) formula which I would like to format as in the second (bottom) formula:

Can this be done? This is Maple 2016.1

Hello

I have experienced that maple does not save all of the varibles. But some it does.

I calculate with units, could that be the reason?

I have allso been thinking that it has something to do with saving the document online in onenote. But that works like the file is saved on the Pc's harddrive.

Are there anybody else that has experienced this?

I calculate with units, but as the varible does not appear in the calculation with units, I make one varible with the same result, to get the next calculation to work.   

Regards

Heide

Why won't this procedure Compile? All I get is a cryptic and ungrammatical error message.

    step:= proc(
          n::integer[4],
          XYZ::Matrix(datatype= float[8]),
          E::Vector(datatype=integer[4]), F::Vector(datatype=integer[4]),
          W::Matrix(datatype= float[8]), #3x2 scratch matrix
          mu::integer[4]
     )
     option autocompile;
     local
          i::integer[4], j::integer[4],
          ed::float[8],
          fd::float[8],
          p::float[8], t::float[8]       
     ;
          to mu do
               for i to n do
                    ed:= 0;  fd:= 0;
                    for j to 3 do
                          p:= XYZ[i,j];
                          t:= XYZ[E[i],j] - p;
                          ed:= ed+t^2;
                          W[j,1]:= t;
                          t:= XYZ[F[i],j] - p;
                          fd:= fd+t^2;
                          W[j,2]:= t
                    od;
                    ed:= sqrt(ed) + .01;  fd:= sqrt(fd) + .01;
                    for j to 3 do
                         XYZ[i,j]:= 0.995*XYZ[i,j] - 0.01*W[j,1]/ed + 0.02*W[j,2]/fd
                    od
               od
          od
     end proc;
Compiler:-Compile(step);

Error, (in Compiler:-Compile1) In memory compilation failed

Hello guys,

I was just playing around with differential equations, when I noticed that symbolic solution is  different from the numerical.What is the reason for this strange behavior?


ODE := (diff(y(x), x))*(ln(y(x))+x) = 1

sol := dsolve({ODE, y(1) = 1}, y(x))

a := plot(op(2, sol), x = .75 .. 2, color = "Red");
sol2 := dsolve([ODE, y(1) = 1], numeric, range = .75 .. 2);

with(plots);
b := odeplot(sol2, .75 .. 2, thickness = 4);
display({a, b});

 

 

Strange_issue.mw

Mariusz Iwaniuk

Hello,

I need to crate a function to be evaluated in a range of values, and this function i would to use in other expression, example:

cel1      "seq(i,i=0.001..2,0.001)"

cel2      "A:=&1";cel1

cel3      "f:=x->diff(KelvinBei(0,x),x)"

cel4      ""B:=map(x->f(x),[A])"

 

This is ok with a lot of function but with diff(KelvinBei(0,x),x) in cel4 show this error "Error,(in f) invalid input:.1e-2, which is not valid for its 2nd argument.

Why??? How can I do??

The first example is very slow compared to the second.  The difference is in the definition of f().

restart;
y := int(1/(-0.4016e-1*m^(2/3)-0.211e-3*m^(5/3)), m);
f:= unapply(abs(y), m):
n := 500: ## sample size
M := <seq(2*idx/n,idx=1..n)>; ## m
Y := f~(M)+~Statistics:-Sample(Normal(0,3), n)^+; ## signal + noise

restart;
y := int(1/(-0.4016e-1*m^(2/3)-0.211e-3*m^(5/3)), m);
f:= (x) -> abs(subs(m=x,y));
n := 500: ## sample size
M := <seq(2*idx/n,idx=1..n)>; ## m
Y := f~(M)+~Statistics:-Sample(Normal(0,3), n)^+; ## signal + noise


The code below projects a torus illuminated by a point light source located at the origin onto an ellipsoid as the torus's centre moves along the x axis from [-0.8,0,0] to [0.8,0,0].

Ellipsoid := (1/32)*x^2+(1/18)*y^2+(1/12)*z^2 = 1:
EllipsoidTitle := Typesetting:-Typeset((1/32)*x^2+(1/18)*y^2+(1/12)*z^2 = 1):
DispEllipsoid := implicitplot3d(Ellipsoid, x = -10 .. 10, y = -10 .. 10, z = 1.25 .. 5, style = surface, color = yellow, grid = [30, 30, 30]):
TorusVorig := Vector([(1+.25*cos(v))*cos(u), (1+.25*cos(v))*sin(u), .6+.25*sin(v)]):

i := 0;

for x from -.8 by .1 to .81 do

i := i+1;

TorusV := `<,>`(x, 0, 0)+TorusVorig:

DispTorusV := plot3d(TorusV, u = 0 .. 2*Pi, v = 0 .. 2*Pi, shading = xyz):

NormTorusV := Normalize(TorusV, Euclidean):

Vadj := solve((1/32)*w^2*NormTorusV[1]^2+(1/18)*w^2*NormTorusV[2]^2+(1/12)*w^2*NormTorusV[3]^2 = 1, w):

if evalf(eval(Vadj[1]*NormTorusV[3], [u = Pi, v = Pi])) > 0 then

DispTorusVproj := plot3d(Vadj[1]*NormTorusV, u = 0 .. 2*Pi, v = 0 .. 2*Pi):

else

DispTorusVproj := plot3d(Vadj[2]*NormTorusV, u = 0 .. 2*Pi, v = 0 .. 2*Pi):

end if:

Disp[i] := display(DispTorusV, DispEllipsoid, DispTorusVproj, view = [-10 .. 10, -10 .. 10, 0 .. 5], scaling = constrained, Plot3Daxes, title = typeset("Project %1 onto %2 from a light at the origin", TorusV, EllipsoidTitle), titlefont = [Courier, bold, 14]):

end do:

display(seq(Disp[j], j = 1 .. i), insequence = true);

How can I plot the unmoving torus centred on the z axis projected onto the ellipsoid illuminated by a point light source moving on the x axis from [-0.8,0,0] to [0.8,0,0]?

Is there an elegant way to plot a surface with three given parameters, such as
x=(5+w\cos v)\cos u, y=(5+w\cos v)\sin u, z=w\sin v

with u,v between 0 and 2Pi and w between 0 and 3?

I would like the C-Text style in 14pt Times Roman while the C-2D-Math style is 12pt.

My use case is that I am typing in a single execution block.

I use Format >> Styles and select the style for C-Text and set it to 14pt Times. I click OK to close the dialog. Next I repeat this for the C-2D-Math style but this time set the font size to 12pt and, for testing, the colour to blue. The effect is to give me 14pt Times for both styles, though the C-text is black and the 2-D-Math is blue.

Can the effect I want be achieved, or is this a bug/feature?

This is Maple 2016.1 on Windows 10 64bit

 Thanks for any help

With a somewhat complicated equation for a line, draw fails.

with(geometry):

point(P1,[47+(38+22/60)/60, -(122+(43+4/60)/60)]);
point(P2,coordinates(P1) +~ [cos(30*Pi/180),sin(30*Pi/180)]);
line(L1,[P1,P2]);
Equation(L1);
draw(L1); ## no line

point(P1,[0,0]);
point(P2,[7,9]);
line(L1,[P1,P2]);
draw(L1);  ## works

Tom Dean

First 53 54 55 56 57 58 59 Page 55 of 60