Maple 2018 Questions and Posts

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

Hello, 

For a few days Maple crashs everytime i try to use the command "plot3d()". 

I had'nt this problem befor and I have no idea what the reason could be. It ist irrelevant what Funktion I try to visualize,  the window just get closed evertime.

I hope someone can help me.

Thank you!

Tom

The question reads as follows: 

a) Use Maple to find the linear function f(x,y) = c +mx + ny, whose graph passes through the points P=(5,1,0), Q=(-1,7,1), and R = (2,1,4). 

b) Use Maple to graph the linear function whose formula you found in part a.

c) Use Maple to find the (exact) area of the triangle having P,Q and R as vertices. 

Thank you so much. I am new to Maple and just trying to figure it all out.  

I am trying to write a program for the representation of a function F with three variables i, j, x, where i, j are non-negative integers and x is real. I have tried with different indexings like F(i,j,x), F[i](j,x), F[i,j](x), but did not get the desired result. My objective is to get F as a function of i, j, x.

Here is my maple code with detailed description of my problems in each step.

 

test1702.mw

Plot the Vector Field f(x,y,z) = (-x,y,cos z).

How do I go about plotting this? I have tried everything and nothing is working for me. 

a1 := 5; b1 := 3; a2 := 3; b2 := 4; a3 := 3; b3 := 7; eq1 := expand((y-2)^2/b1^2+(x-5)^2/a1^2 = 1); 1 2 4 13 1 2 2 eq1 := - y - - y + -- + -- x - - x = 1 9 9 9 25 5 eq2 := expand((y+2)^2/b2^2+(x+1)^2/a2^2 = 1); 1 2 1 13 1 2 2 eq2 := -- y + - y + -- + - x + - x = 1 16 4 36 9 9 Sys := {eq1, eq2}; Sol := [solve(Sys, explicit)]; L := map(proc (t) options operator, arrow; eval([x, y], t) end proc, simplify(`~`[fnormal](evalf(Sol), 9), zero)):I don't want complex roots. Tank you.

Can you please help me in telling different ways to speed up the following code. thank you.

 

thread_map.mw

Can you guess what P() produces, without executing it?

P:=proc(N:=infinity) local q,r,t,k,n,l,h, f;
q,r,t,k,n,l,h := 1,0,1,1,3,3,0:
while h<N do 
   if 4*q+r-t < n*t
   then f:=`if`(++h mod 50=0,"\n",`if`(h mod 10=0," ","")); printf("%d"||f,n);   
        q,r,t,k,n,l := 10*q,10*(r-n*t),t,k,iquo(10*(3*q+r),t)-10*n,l
   else q,r,t,k,n,l := q*k,(2*q+r)*l,t*l,k+1,iquo(q*(7*k+2)+r*l,t*l),l+2
   fi
od: NULL
end:

I hope you will like it (maybe after execution).

While using the Physics package in Maple 2018, I am facing a few hurdles. In the file tov.mw ,

1. I have defined a dual-vector with components $u_a$ in step 12, but when I am trying to compute $g(u,u)$ using SumOverRepeatedIndices  in step 15, it is not evaluating the sum.

2. I want to define a tensor $B_{ab}=\nabla_a u_b$. Do I just write Define(B{a,b}=D_[a] u[b]) ?

3. Is there any command to find the symmetric and antisymmetric components and trace of the tensor B or do we evaluate them by writing out the expressions?

Thank you.

restart; with(plots); _EnvHorizontalName := 'x'; _EnvVerticalName := 'y'; para := -2*p*x+y^2 = 0; para1 := -2*p1*x+y^2 = 0; t := y-m*x-p/(2*m) = 0; t1 := y+x/m+(1/2)*p1*m = 0; sol := op(solve([t, t1], [x, y])); eliminate({rhs(sol[1]), rhs(sol[2])}, m); for example : m := 2; p := 1; p1 := -2; PARA := implicitplot(para, x = -3 .. 3, y = -3 .. 3, color = blue); PARA1 := implicitplot(para1, x = -3 .. 3, y = -3 .. 3, color = green); Tang := implicitplot(t, x = -3 .. 3, y = -3 .. 3, color = brown); Tang1 := implicitplot(t1, x = -3 .. 3, y = -3 .. 3, color = aquamarine); NULL; #m is not constant display([PARA, PARA1, Tang, Tang1], view = [-3 .. 3, -3 .. 3], scaling = constrained);#on what curve is the vertex of the angle of 2 tangents ? Thank you.

Hi,

I want to optimize a function f(g(e(x),x))  where g(x) is interpolated and e(x) is not known when the interpolation object is created. I found the intpolation Methods of Maple 2018 very helpful to quickly change the inpterpolation method.

Unfotunately the optimization fails when the interpolation object receives an expression as input.

It works if I just use x. Do you know my the first approach fails?

Is there maybe a way to convert the interpolation object to a piecewise function?

 

Thank you for your help
 

# Optimize with Interpolation Object


points :=  <<0.4000|  10.0000>,
            <0.7000|   10.0000>,
            <1.0000|   10.0000>,
            <0.3000|   30.0000>,
            <0.4000|   30.0000>,
            <0.5000|   30.0000>>;

Data := <0617,0767,0220,0444,0692,0789>*0.001;

intmethod := LinearInterpolation;

g := Interpolation[intmethod](points(1..-1,1),Data):

Matrix(6, 2, {(1, 1) = .4000, (1, 2) = 10.0000, (2, 1) = .7000, (2, 2) = 10.0000, (3, 1) = 1.0000, (3, 2) = 10.0000, (4, 1) = .3000, (4, 2) = 30.0000, (5, 1) = .4000, (5, 2) = 30.0000, (6, 1) = .5000, (6, 2) = 30.0000})

 

Vector[column](%id = 18446884324022199230)

 

LinearInterpolation

(1)

plot(g(x),x=0..1)

 

e := x/sqrt(2);

(1/2)*x*2^(1/2)

(2)

f := 5+g(e)*x^2

"5+(module() ... end module)(module() ... end module,1/2 x sqrt(2)) x^2"

(3)

f_simple := 5+g(x)*x^2

"f_simple:=5+[[["a linear interpolation object"],["with 6 points in 1-D"]]](x) x^2"

(4)

op_f := Optimization[Minimize](f(x),x=0 .. 1);

Error, (in Optimization:-NLPSolve) non-numeric result encountered

 

op_f_simple := Optimization[Minimize](f_simple(x),x=0 .. 1);

[HFloat(4.999979117244145), [x = HFloat(0.028901647183245588)]]

(5)

 

NULL


 

Download convert_interpolation_object.mw

 

 

Dear Sir/Madam, I am new in maple and willing to use an old (yet tested) Maple V code. The program first evaluates two integrals numerically, which depend on the values of "d" and "s" (user-defined), and then computes the values of a cumulative distribution function. The problem is that, when running the code on Maple 2018, the evalf(Int) of the first integrand (named "ex1") results in "Float (undefined)". I would really appreciate your help. Thank you in advance.

 

#Maple V program

assume(x, real, y, real, c1, real, c2, real);
d := 3:
s := .9:
ex1:=(1-exp(-(d-y)*I*x))/I/x*exp(y*I*x/(1-I*x)):
ex1:=simplify(Re(evalc(ex1))):
f1:= unapply(ex1,x,y):
ex2:=(1-exp(-(d-y)*I*x))/I/x*exp(y*I*x/(1-I*x))/(1-I*x):
ex2:=simplify(Re(evalc(ex2))):
f2:=unapply(ex2,x,y):
t1:=evalf(Int(f1(x,s),x=-infinity..infinity));
t2:=evalf(Int(f2(x,s),x=-infinity..infinity));
cumulativeprob:=evalf(subs(c1=1/2,c2=1/2,1-((c1*t1+c2*t2)/(2*Pi)+c1*exp(-s)/2)));

cumulativeprob:=.2503779941

 

How do I simplify KdV equation in Maple by using =fxt))xx)?)


 

``

   I am by using =2*difffxtxx)
    My aim is to get the form
   diff((f*(diff(f, x, t))-(diff(f, x))*(diff(f, t))+f*(diff(f, x, x, x))-4*(diff(f, x, x, x))*(diff(f, x))+3*(diff(f, x, x))^2)/f^2, x) = 0

NULL

``

restart; with(PDEtools); with(DEtools)

``

alias(u = u(x, t)); declare(u(x, t)); alias(f = f(x, t)); declare(f(x, t))

u

 

` u`(x, t)*`will now be displayed as`*u

 

u, f

 

` f`(x, t)*`will now be displayed as`*f

(1)

KdV := diff(u, t)+6*u.(diff(u, x))+diff(u, x, x, x) = 0

diff(u, t)+6*(u.(diff(u, x)))+diff(diff(diff(u, x), x), x) = 0

(2)

KdV_f := eval(KdV, u = 2*(diff(ln(f), x, x)))

2*(diff(diff(diff(f, t), x), x))/f-2*(diff(diff(f, x), x))*(diff(f, t))/f^2-4*(diff(f, x))*(diff(diff(f, t), x))/f^2+4*(diff(f, x))^2*(diff(f, t))/f^3+6*((2*(diff(diff(f, x), x))/f-2*(diff(f, x))^2/f^2).(2*(diff(diff(diff(f, x), x), x))/f-6*(diff(diff(f, x), x))*(diff(f, x))/f^2+4*(diff(f, x))^3/f^3))+2*(diff(diff(diff(diff(diff(f, x), x), x), x), x))/f-10*(diff(diff(diff(diff(f, x), x), x), x))*(diff(f, x))/f^2+40*(diff(diff(diff(f, x), x), x))*(diff(f, x))^2/f^3-20*(diff(diff(diff(f, x), x), x))*(diff(diff(f, x), x))/f^2-120*(diff(diff(f, x), x))*(diff(f, x))^3/f^4+60*(diff(diff(f, x), x))^2*(diff(f, x))/f^3+48*(diff(f, x))^5/f^5 = 0

(3)

df := collect(KdV_f, f)

6*((2*(diff(diff(f, x), x))/f-2*(diff(f, x))^2/f^2).(2*(diff(diff(diff(f, x), x), x))/f-6*(diff(diff(f, x), x))*(diff(f, x))/f^2+4*(diff(f, x))^3/f^3))+(2*(diff(diff(diff(f, t), x), x))+2*(diff(diff(diff(diff(diff(f, x), x), x), x), x)))/f+(-2*(diff(diff(f, x), x))*(diff(f, t))-20*(diff(diff(diff(f, x), x), x))*(diff(diff(f, x), x))-4*(diff(f, x))*(diff(diff(f, t), x))-10*(diff(diff(diff(diff(f, x), x), x), x))*(diff(f, x)))/f^2+(60*(diff(diff(f, x), x))^2*(diff(f, x))+4*(diff(f, x))^2*(diff(f, t))+40*(diff(diff(diff(f, x), x), x))*(diff(f, x))^2)/f^3-120*(diff(diff(f, x), x))*(diff(f, x))^3/f^4+48*(diff(f, x))^5/f^5 = 0

(4)

factor(simplify(df, size))

2*(12*(((diff(diff(f, x), x))*f-(diff(f, x))^2)/f^2.(((diff(diff(diff(f, x), x), x))*f^2-3*(diff(diff(f, x), x))*(diff(f, x))*f+2*(diff(f, x))^3)/f^3))*f^5+f^4*(diff(diff(diff(f, t), x), x))+f^4*(diff(diff(diff(diff(diff(f, x), x), x), x), x))-f^3*(diff(diff(f, x), x))*(diff(f, t))-10*f^3*(diff(diff(f, x), x))*(diff(diff(diff(f, x), x), x))-2*f^3*(diff(f, x))*(diff(diff(f, t), x))-5*f^3*(diff(f, x))*(diff(diff(diff(diff(f, x), x), x), x))+30*f^2*(diff(diff(f, x), x))^2*(diff(f, x))+2*f^2*(diff(f, t))*(diff(f, x))^2+20*f^2*(diff(diff(diff(f, x), x), x))*(diff(f, x))^2-60*(diff(diff(f, x), x))*(diff(f, x))^3*f+24*(diff(f, x))^5)/f^5 = 0

(5)

``

``

``

``


 

Download KdV_simplify

Here is the minimal working example: 

with(Physics):
Setup(noncommutativeprefix={W,V});
simplify(W^(-1)*(-W^(-1)-W*V^(-2)));

 

It gives the result  below, which is wrong. Or am I misinterpreting? (Maple 2018)

 

(-V^2-W^2)*(1/V^2)*(1/W^2)

 

Here's the recurrence equation I'm trying to solve and the weird answer that Maple 2018 gives me on Windows 10.

Out of curiosity, I started my old computer with  Windows 2000 and Maple V release V (1997 version).
I typed the same lines as before. I got the answer I was looking for immediately.
Answer which I easily improved.
What's happening ?     What am I doing wrong ?

I am often excited by the the latest versions of Maple but recently I have been rather surprised by the things it cannot do.
When that happens, I remember the story of the guy who wants to sell a great watch to another guy.
"This watch is full of new gadgets:
 gps, heart rate, body temperature, outside temperature, micro camera, voice recorder, email, internet ...
 
Only one problem . It doesn't tell time . "
 
Best regards .
 
Réjean
1 2 3 4 5 6 7 Last Page 2 of 46