Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am learning how to use select with my own types defined, to find parts of expression. This is instead of using patmach.

For example, given   3+x^2*sin(x) and then I want to find any POLYNIMAL*sin function, if present. So I did the following

restart;
expr_1:=3+x^2*sin(x):
mytype_1 := `&*`( polynom(And(algebraic, satisfies(u -> not has(u, I))),x),specfunc('sin')):
select( z->type(z,mytype_1),expr_1);

Which works. Maple returned 

The problem is that if I change the order of multiplication, and also at same time change the polynomial by adding one more term, it no longer works!

I have no idea why. It seems Maple rememebrs something.  Here is a screen shot, followed by plain text code.

 

code

restart;
expr_1:=3+(1+x)*sin(x):
mytype_1 := `&*`( polynom(And(algebraic, satisfies(u -> not has(u, I))),x),specfunc('sin')):
select( z->type(z,mytype_1),expr_1);
expr_1:=3+sin(x)*(1+x):
select( z->type(z,mytype_1),expr_1);

#change polynomial but keep same order, it works
expr_2:=3+(1+x+x^2)*sin(x):
select( z->type(z,mytype_1),expr_2);

#change order BUT keep same polynomial, it works
expr_3:=3+sin(x)*(1+x+x^2):
select(z->type(z, mytype_1),expr_3);

#keep same order as above, but change polynomial, now it does not works
expr_4:=3+sin(x)*(1+x+x^2+x^4):
select(z->type(z, mytype_1),expr_4);

#keep same order as first one  but change polynomial, it does not work
expr_5:=3+(1+x+x^2+x^4)*sin(x):
select(z->type(z, mytype_1),expr_5);

#keep same order as first one but change polynomial back to what it was, now it works
expr_6:=3+(1+x)*sin(x):
select(z->type(z, mytype_1),expr_6);

What Am I doing wrong?

 

Maple 2021.1

 

Hi, 

I have  an expression made of a sum of different terms from which I want to extract all terms of a specific form.

A typical expression and the functions I want to extract is given in the attached file.

You will see in the example that the terms in the expression can be 

  • a constant
  • a continuous function of t
  • a piecewise function like
    something*piecewise(a(t) < 0, A(t), a(t) < 1, B(t), ...)
    
  • a piecewise function like
    something*piecewise(t < 0, A(t), t < 1, B(t), ...)

     

The functions I want to extract are only those of this latter form .

Thanks in advance

MyExpr.mw

PS: all the situations I have to manage contain expressions of the form of the prototype expression given in the attached file.
       Nothing more general than this.

This worksheet displays an ellipsoid internally tangent to the four sides of a tetrahedron.

The tetrahedron is a special case: it has a horizontal base with vertices A,B and C and its fourth vertex E is on the z axis.

However I have failed when trying to display an internally tangent ellipsoid in any other tetrahedron.

Will any tetrahedron support one or more internally tangent ellipsoids?

If so, are there conditions restricting the location of the mutual points of tangency?

Ellipsoid_in_a_tetrahedron.mw

How to obtain a dual branch solution in Maple.

Is there any specific method is there to get these type of solutions.

I have attached the document.

Link [copyright material removed by moderator]

Thank you.

I'm trying to construct an iterative procedure al1(f,x0) where f is a function, x0 is an initial estimate.

Now for example by defining f:= x-> 4*x^4-4*x^2 and inputting x0=0.75 and N=10 i should be able to check that my procedure calculates 1 correctly.

f := x -> 4*x^4 - 4*x^2;
f1 := D(f);
f2 := D(f1);
x0 := 0.75;
Digits := 100;
tol := 10.^(-15);

al1:= proc(f,x0)
local y, z, s, i, fs, a, de;
s := x0:
a[0]:=x0;
for i from 1 to 10
while abs(fs)>tol and de>tol do
y := evalf(s- f(s)/f1(s)):
s:=evalf(y-f(y)/f1(y)):
fs:=evalf(f(s)):
a[i]:=s:
de:=abs(evalf(a[i]-a[i-1])):
end do:
return n, s, fs, de;
end proc;

> n, s, fs, de := al1(f, 0.75);
Error, (in al1) cannot determine if this expression is true or false: 0.1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-14 < abs(fs) and 0.1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-14 < de

 

The code i've written so far is incorrect but i'm not sure where i'm going wrong. Would you be able to give me some pointers?

 

Hi !

Sorry but there is a bug in the "combine" command when combining double summations.
 Maple 2017,2018 and 2020 all give me a wrong answer. I have an old version of Maple which gives the correct answer.
I have put an example in the attached file.

bugcombine.mw

Best regards
Réjean 

Hello. looking for the numerical or analytical solution of the attached file and at the needed expression or value of lambda for different values of the involved parameter?

Help_numerically_solution.mw

 

I need the non-dimensional form of PDE with given non-dimensional variables. I have attached a worksheet please check it. 

Thank you nondimensional.mw

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/nondimensional.mw .
 

Download nondimensional.mw

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/nondimensional.mw .
 

Download nondimensional.mw

 

 

Hi MaplePrimes team,

 

Does Maple have a step detection command for a given step function f(x)?

The command has to return a list of jump detections in a given range [xmin... xmax].

For example, can Maple find the following jump detections:

 

Figure 1 (trivial case): f(x) = floor(x)

where it is easy to guess the list of step detections: [x1 = 1, x2 = 2, x3 = 3, …, xn = n]

 

Figure 2: g(x) = 2 + floor(x + 5*sin x)

a little more difficult.

 

Thank you in advance.

 

Guy.

Maple 2021.1/Windows 10.

When entering 2d expressions into the bottom line of a worksheet, i.e. at the bottom of the window, I can't see the underscores used to indicate bracketing.

A workaround is to use ^J to get another input prompt at the bottom of the window.

Is there some way to get a bigger margin at the bottom of the window?

Cheers,

Steve.

Hi,

 

In Maple 2020, the following line works fine:

Statistics:-HeatMap(Matrix(128,(i,j)->modp(binomial(i,j),2)),color=["White","Black"]);

 

 

 

 

With Maple 2021, I get

 

Interestingly, the exported PNG is better with Maple 2021 (not blurry as in Maple 2020). However, there is an alignment problem with the axes. And it appears in Maple, before exporting. Bug?

(Maple 2020/2021 on Windows 10)

Hi, Is it possible to convert a code written in Mathematica into maple correctly?

I need to check if an expression is polynomial in but with coefficients that are either symbolic, or do not include the complex numebr I.

The problem is that maple considers integers and reals complex also.   

type(1,complex) gives true. so I can't use

restart;
type(1+2*x,polynom(Not(complex),x))

Since this gives false. 

I could instead list all the types to be accepted using Or, like this

restart;
type(1+2*x,polynom(Or(float,realcons,rational,integer),x))

But I might overlook something if I have to enumerate every type accepted. It is easier to just exclude complex numbers. 

What is the correct way to tell Maple to check if expression is polynomial in where coefficients do not have the complex I in them? It it ok if the coefficient are any other numeric value, or a known Maple constant, or a parameter (symbol). I just want to exclude complex numbers.

I know I could do this

restart;
the_poly:=1+2*x;
if not has(the_poly,I) then
   type(the_poly,polynom(anything,x))
else
   print("not allowed");
fi;

But I wanted to learn how to make a type which excludes complex numbers.

Maple 2021.1

In this simple example, we are going to learn how to Plot Isocline & Trajectory to examine stability of a dynamical system with Lyapunov Stability Theorem in Maple.

iso.mw

Download iso.mw

You should be familiar with Dynamical Systems and Linear Control.

This content would be more useful for students who are studying

>> Linear Control &

>> ODE's Theory

I have a linear ctrl course this semester & I was trying to solve such problems. Finally I did.

Hope to enjoy

First 269 270 271 272 273 274 275 Last Page 271 of 2097