Maple 2019 Questions and Posts

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

I'm trying to solve the following linear system

eq1 := -t*x + y*z = j;
eq2 := t*x + y*z = -m;
eq3 := t*z - x*y = -b;
eq4 := t*z + x*y = a;

I have made many unsuccessful attempts.

Would anyone have the solution to the problem?

Thanks!

I do not understand why Maple sometimes shows singular solution to Clairaut ODE and sometimes not.

Clairaut ODE has the form y(x) = x y'(x) + G(x, y')

In the following ODE when I ask Maple to dsolve it as is, it does give singular solution. Next, when solving explicity for y(x) first, which will generate 2 ODE's, each is Clairaut ODE, then ask Maple to dsolve each, now Maple no longer gives the singular solution. But when I solve each one of these ODE's, I see that there is the singular solution there. It must be there, since this is Clairaut ODE and it has singular solution.

When I do PDEtools:-casesplit on each of the two ODE's generated by solving for y(x) first, I see the singular solution there.

The question is, why Maple dsolve does not show the singular solution in the second case? And how to make it show it? Or did I do something wrong?

restart;

Typesetting:-Settings(typesetprime=true):

ode:=x^2*diff(y(x),x)^2-(1+2*x*y(x))*diff(y(x),x)+1+y(x)^2 = 0;

x^2*(diff(y(x), x))^2-(1+2*x*y(x))*(diff(y(x), x))+1+y(x)^2 = 0

DEtools:-odeadvisor(ode)

[[_1st_order, _with_linear_symmetries], _rational, _Clairaut]

Vector([dsolve(ode,y(x))]); #now it shows singular solution (first one below)

Vector(3, {(1) = y(x) = (1/4)*(4*x^2-1)/x, (2) = y(x) = _C1*x-sqrt(_C1-1), (3) = y(x) = _C1*x+sqrt(_C1-1)})

PDEtools:-casesplit(ode)

`casesplit/ans`([(diff(y(x), x))^2 = (2*y(x)*(diff(y(x), x))*x+diff(y(x), x)-y(x)^2-1)/x^2], [2*(diff(y(x), x))*x^2-2*x*y(x)-1 <> 0]), `casesplit/ans`([y(x) = (1/4)*(4*x^2-1)/x], [])

ode:=convert(ode,D): #solve for y(x) first, this will generate 2 ODE's
sol:=[solve(ode,y(x))]:
odes:=Vector(map(z->y(x)=z,convert(sol,diff)))

Vector(2, {(1) = y(x) = (diff(y(x), x))*x+sqrt(diff(y(x), x)-1), (2) = y(x) = (diff(y(x), x))*x-sqrt(diff(y(x), x)-1)})

DEtools:-odeadvisor(odes[1]);
DEtools:-odeadvisor(odes[2]);

[[_1st_order, _with_linear_symmetries], _rational, _Clairaut]

[[_1st_order, _with_linear_symmetries], _rational, _Clairaut]

dsolve(odes[1],y(x)); #where is singular solution?

y(x) = _C1*x+(_C1-1)^(1/2)

dsolve(odes[2],y(x)); #where is singular solution?

y(x) = _C1*x-(_C1-1)^(1/2)

PDEtools:-casesplit(odes[1])

`casesplit/ans`([diff(y(x), x)-1 = (-(diff(y(x), x)-1)^(1/2)+y(x)-x)/x, diff(y(x), x) = (-(diff(y(x), x)-1)^(1/2)+y(x))/x], [1+2*x*(diff(y(x), x)-1)^(1/2) <> 0]), `casesplit/ans`([y(x) = (1/4)*(4*x^2-1)/x], [])

PDEtools:-casesplit(odes[2])

`casesplit/ans`([diff(y(x), x)-1 = ((diff(y(x), x)-1)^(1/2)+y(x)-x)/x, diff(y(x), x) = ((diff(y(x), x)-1)^(1/2)+y(x))/x], [2*x*(diff(y(x), x)-1)^(1/2)-1 <> 0]), `casesplit/ans`([y(x) = (1/4)*(4*x^2-1)/x], [])

 

 

Download missing_singular.mw

The commands

with(LinearAlgebra):interface(rtablesize=50);Matrix([[1,1],[4,5]]);

give the output


50
Matrix(2, 2, {(1, 1) = 1, (1, 2) = 1, (2, 1) = 4, (2, 2) = 5}, datatype = anything, storage = rectangular, order = Fortran_order, shape = [])

 

Why won't it display properly?

 

To help decide the type of ODE, I need a function which moves all derivatives to lhs and everything else to the rhs of the ODE. This way I can more easily analyze the ODE.

The ode will be only first order. Any term which contains  (y')^n, is to be moved to the lhs. Rest to rhs. Couple of examples will help illustrate the problem. This is done in code only, without looking at the screen. The dependent variable is always y and the independent variable is x.  So I need to turn the ODE to the form 

                    G(y',y'^2,y'^3,.....,y'^n)  = F(x,y)

I can find all derivatives in the ODE using

indets['flat'](ode,{`^`('identical'(diff(y(x),x)),'algebraic'),'identical'(diff(y(x),x))})

But not sure how this will help me do what I want. isolate does not help, since it only takes one term at a time. Collect also did not help for same reason.  If the ODE contains only ONE derivative, then it is easy to do. But the question is about how to do it for ODE which contains more than y' term of different powers as the examples below show.

What methods to do this in Maple? I looked at DEtools but so far did not see anything.

Example 1

 

restart;
ode:=3*diff(y(x),x)^2+diff(y(x),x)^3+sin(x)+y(x)=x*y(x)+x*diff(y(x),x);

3*(diff(y(x), x))^2+(diff(y(x), x))^3+sin(x)+y(x) = x*y(x)+x*(diff(y(x), x))

indets['flat'](ode,{`^`('identical'(diff(y(x),x)),'algebraic'),'identical'(diff(y(x),x))})

{(diff(y(x), x))^2, (diff(y(x), x))^3, diff(y(x), x)}

ode_wanted:= 3*diff(y(x),x)^2+diff(y(x),x)^3-x*diff(y(x),x)=-sin(x)-y(x)+x*y(x)

3*(diff(y(x), x))^2+(diff(y(x), x))^3-x*(diff(y(x), x)) = -sin(x)-y(x)+x*y(x)

Example 2

 

restart;
ode:=3*diff(y(x),x)^2+diff(y(x),x)=x*diff(y(x),x)+5;

3*(diff(y(x), x))^2+diff(y(x), x) = x*(diff(y(x), x))+5

indets['flat'](ode,{`^`('identical'(diff(y(x),x)),'algebraic'),'identical'(diff(y(x),x))})

{(diff(y(x), x))^2, diff(y(x), x)}

ode_wanted:= 3*diff(y(x),x)^2+diff(y(x),x)-x*diff(y(x),x)=5

3*(diff(y(x), x))^2+diff(y(x), x)-x*(diff(y(x), x)) = 5

 

 

Download lhs_rhs.mw

 

Dear Maple users

Some students have come to us to report, that something doesn't seem to work properly in Maple 2019.1 in Document Mode. And they seem to be right: writing an passive math formula by using Shift+F5 (the formula is gray, not blue), then using F5 to get out of that Math field and back into Text Mode. Using the Enter key to go to the next line: It doesn't work! The cursor stays in the same line. This behavior is new in Maple 2019. It worked properly in Maple 2018 and earlier. I assume it is not the intention? 

I know it can easily be dealt with by making a new Paragraph by using the shortcut Ctrl+Shift+J. I call the assumed bug 'severe' though, because it will severely delay the workflow for many students. They are used to deliver a document mixed with formulas (active or passive) and text. 

NB! I have tested it on several computers (Mac and Windows), and it doesn't work on any of them.

Regards,

Erik V.

I've recently changed to maple 2019, from the 2016 version as my license for that product had expired. 
However I find it really frustrating that often upon evaluating an expression I can't convert the units. 

For instance I had a calculation that evaluated to: 

2.114163508*10^7 [kg/s^2]
 

When I try to directly replace the units within maple to instead be [J/m^2] I recieve the following error message: 


"Error, (in  Units:-TestDimensions) 'op(3, i) does not  evaluate to module" 

There is no explanation for this error when I try to look it up. However if I once again manually write the answer: 
2.114163508*10^7 [kg/s^2] and use the replace units function. 
No problem. 
I find this quite annoying and frustrating and I hope you can help.
 

Best regards 

Anders Alexander Wagenblast 

Hello all

I am going to find the diffusion constant in the following equation :

PDE:=diff(C(x,t),t)=d*diff(C(x,t),x,x);

In a way that ,

evalf(Int(C(x,t=specific),x=0..L))/L - m_number(t=specific)=0
 

In other words, It would be an iterative procedure to guess "d" and then find the solution C (something like shooting method). The objective is to find "d" in a way that the average of C (solution of PDE) would be equal to m_number at that specific time.

Also, Since I have 5 specific time and m_number, I will have 5 different d. So, I need to use least square method or other optimization technique find one finalized d value.

I have uploaded my code.

inverse_numerical_diffusion.mw

I am not good at using Proc command and  I think the error of my code is because of that.

Would you help me to find out my problem in the code and any new idea for solviong this equaltion would be greatly appreciated.

Thank you for your kind attentions in advance

Amir

 

 

The integral of y = Dirac(phi-m), in which phi is a continuously variable quantity and m is a positive integer, from -infinity to infinity yields 1 as an answer.   The analogous integral of y2 yields no answer.  Is it possible that the latter integral has some mathematical meaning that might yield an answer?

This is may be a philosophical question. But sometimes Maple suprises me when telling it to "simplify" expression. As in this example.

expr:=1/(y^3+1)^(2/3);

1/(y^3+1)^(2/3)

int(expr,y)

y*hypergeom([1/3, 2/3], [4/3], -y^3)

simplify(%)

(2/9)*y*Pi*3^(1/2)*LegendreP(-1/3, -1/3, (-y^3+1)/(y^3+1))/((-y^3)^(1/6)*(y^3+1)^(1/3)*GAMMA(2/3))

 


For me, the original result is "simpler". (Not only smaller leaf count, but it has one special function, vs. two: Legendre and Gamma). But may be Maple considers hypergeom always more "complex" than any other?

That is why I use simplify(expr,size) because I am scared of simplify without any option, as I have little idea how it decides which is simpler.

Any thoughts from the experts on how Maple decided to simplify something when no option is used? What kinds of rules it uses to decide how to transform the expression?

Maple 2019.1

 

Download simplify.mw

In the DE solution below I cannot convert the RootOf function to radicals.
macro(solve = allvalues@solve);
_EnvExplicit := true;
de := x^4*diff(y(x), x $ 2) + omega^2*y(x) = 0;
bc := y(a) = 0, y(b) = 0, D(y)(a) = 1;
dsol := (dsolve({bc, de}, {omega, y(x)}) assuming (0 < a, a < b));
convert(dsol, radical);
{omega = RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b, y(x) = x*(-cos(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b/x)*sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b*_C2/a) - arccos(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b*_C2/a))*a/(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b) + sin(RootOf(tan(_Z)*_Z*b*_C2 - sin(-2*_B5*Pi + 2*Pi*_Z10 + 2*_B5*arccos(_Z*b*_C2/a) - arccos(_Z*b*_C2/a))*a)*b/x)*_C2)}

Does anyone know how to convert the above expression to radicals?
I'm grateful.
Oliveira
RootOf_to_radical.mw
 

In the DE solution below I cannot convert the RootOf function to radicals.

macro(solve = `@`(allvalues, solve))

_EnvExplicit := true

de := x^4*(diff(y(x), `$`(x, 2)))+omega^2*y(x) = 0

bc := y(a) = 0, y(b) = 0, (D(y))(a) = 1

dsol := `assuming`([dsolve({bc, de}, {omega, y(x)})], [a > 0, b > a])

convert(dsol, radical)

{omega = RootOf(tan(_Z)*_Z*b*_C2-sin(-2*_B5*Pi+2*Pi*_Z10+2*_B5*arccos(_Z*b*_C2/a)-arccos(_Z*b*_C2/a))*a)*b, y(x) = x*(-cos(RootOf(tan(_Z)*_Z*b*_C2-sin(-2*_B5*Pi+2*Pi*_Z10+2*_B5*arccos(_Z*b*_C2/a)-arccos(_Z*b*_C2/a))*a)*b/x)*sin(-2*_B5*Pi+2*Pi*_Z10+2*_B5*arccos(RootOf(tan(_Z)*_Z*b*_C2-sin(-2*_B5*Pi+2*Pi*_Z10+2*_B5*arccos(_Z*b*_C2/a)-arccos(_Z*b*_C2/a))*a)*b*_C2/a)-arccos(RootOf(tan(_Z)*_Z*b*_C2-sin(-2*_B5*Pi+2*Pi*_Z10+2*_B5*arccos(_Z*b*_C2/a)-arccos(_Z*b*_C2/a))*a)*b*_C2/a))*a/(RootOf(tan(_Z)*_Z*b*_C2-sin(-2*_B5*Pi+2*Pi*_Z10+2*_B5*arccos(_Z*b*_C2/a)-arccos(_Z*b*_C2/a))*a)*b)+sin(RootOf(tan(_Z)*_Z*b*_C2-sin(-2*_B5*Pi+2*Pi*_Z10+2*_B5*arccos(_Z*b*_C2/a)-arccos(_Z*b*_C2/a))*a)*b/x)*_C2)}

(1)

Does anyone know how to convert the above expression to radicals?
I'm grateful.

Oliveira


 

Download RootOf_to_radical.mw

 

I am playing around with certain "simple" integrals, and came across this strange behavior in Maple. Maple is able to integrate sin(x)^(1/2)*cos(x)^3, but not sin(x)^(1/3)*cos(x)^3. Any idea why?

trig_integral.mw
 

int(sin(x)^(1/2)*cos(x)^3, x)

-(2/7)*sin(x)^(7/2)+(2/3)*sin(x)^(3/2)

(1)

int(sin(x)^(1/3)*cos(x)^3, x)

int(sin(x)^(1/3)*cos(x)^3, x)

(2)

 

I am not able to understand why this ODE is quadrature. It is first order ODE of second degree. Solving for y'(x) gives two ODE's. Only one of these two ODE's is quadrature and the second is Abel.

So  why and how did odesdvisor come to conclusion that it is  quadrature? Did it pick the first ODE that comes from solving for y'(x)?

Note that from help, quadrature is ODE (for first order) is one which
the ODE is of first order and the right hand sides below depend only on x or y(x)

And the above definition only applied here for one of the 2 ODE's embeded inside this first order ODE of second degree. So I am just trying to understand the logic behind this result of odeadvisor

ode:= (x^2-a*y(x))*diff(y(x),x)^2-2*x*y(x)*diff(y(x),x) = 0;

(x^2-a*y(x))*(diff(y(x), x))^2-2*x*y(x)*(diff(y(x), x)) = 0

DEtools:-odeadvisor(ode);

[_quadrature]

odes:=[solve(ode,diff(y(x),x))]; #solve for y' we get 2 first order ODE's

[0, -2*x*y(x)/(a*y(x)-x^2)]

DEtools:-odeadvisor(diff(y(x),x)=odes[1]); #find type of first one

[_quadrature]

DEtools:-odeadvisor(diff(y(x),x)=odes[2]); #find type of second one

[[_homogeneous, `class G`], _rational, [_Abel, `2nd type`, `class A`]]


Download why_only_quadrature.mw

btw, the above is just one example. I have many more. below show one more such example

#example 2

ode:=diff(y(x),x)^3-(2*x+y(x)^2)*diff(y(x),x)^2+(x^2-y(x)^2+2*x*y(x)^2)*diff(y(x),x)-(x^2-y(x)^2)*y(x)^2 = 0;

(diff(y(x), x))^3-(2*x+y(x)^2)*(diff(y(x), x))^2+(x^2-y(x)^2+2*x*y(x)^2)*(diff(y(x), x))-(x^2-y(x)^2)*y(x)^2 = 0

DEtools:-odeadvisor(ode);

[_quadrature]

odes:=[solve(ode,diff(y(x),x))]; #solve for y' we get 3 first order ODE's

[y(x)^2, x+y(x), x-y(x)]

DEtools:-odeadvisor(diff(y(x),x)=odes[1]); #find type of first one

[_quadrature]

DEtools:-odeadvisor(diff(y(x),x)=odes[2]); #find type of second one

[[_linear, `class A`]]

DEtools:-odeadvisor(diff(y(x),x)=odes[3]); #find type of third one

[[_linear, `class A`]]

 

 

Download why_only_quadrature_2.mw

Maple 2019.1

 

I gave up. Spend 40 minutes trying everything and can't figure the right syntax. 

I need to use indets to obtain all occurrences of specific function in expression. Such as sin() or cos() or ln(), etc...

The indets commands has the form indets(expression, type).

But what is the type of ln ? It is of function type. But this picks up all other functions in the expression. I tried specfun and could not make it work. For example

expr:=x+sin(x)+ln(y)+10+ln(x+y)^2;

I want  to obtain  {ln(y),ln(x+y)^2}

I tried

indets(expr,function); 
indets(expr,specfun(ln));

and many more. Since indets needs a name of a type in the second argument, then what is the type name for ln or sin or cos, etc... I can't use indential, it did not work, since it is not a symbol I am looking for. I could use patmatch, but I am trying to learn indets for all these things.

Do I need to use subsindets for this? I still do not know how to use subsindets.

Maple 2019.1

hi i did this in maple and i get an error when i try to solve the system of equation  :

restart;
with(Student[VectorCalculus]);
with(PDEtools);with(plots);

h_f := 300;
h_a := 1000;
T_f := 1500 + 273;
T_a := 30 + 273;
k_r := 15;
k_s := 70;
Ra := 5;
Rf := 6.05;
Rc := 6;

Lap1 := Laplacian(T_r(r, theta), polar[r, theta]);
Lap2 := Laplacian(T_s(r, theta), polar[r, theta]);
Bc_r := k_r*eval(Gradient(T_r(r, theta), polar[r, theta])[1], r = 5) = h_a*(T_r(5, theta) - T_a);
Bc_s := k_s*eval(Gradient(T_s(r, theta), polar[r, theta])[1], r = 6.05) = h_f*(T_s(6.05, theta) - T_f);
systemThermal_r := Lap1 = 0;
systemThermal_s := Lap2 = 0;
Bc1_rs := eval(T_r(r, theta), r = 6) = eval(T_s(r, theta), r = 6);
Bc2_rs := k_r*eval(Gradient(T_r(r, theta), polar[r, theta])[1], r = 6) = -k_s*eval(Gradient(T_s(r, theta), polar[r, theta])[1], r = 6);
pdsolve([systemThermal_r, systemThermal_s, Bc_r, Bc_s, Bc1_rs, Bc2_rs]);
 
 
 
Error, (in PDEtools:-Library:-NormalizeBoundaryConditions) unable to isolate the functions {T_r(5, theta), T_r(6, theta), T_s(6, theta), T_s(6.05, theta), (D[1](T_r))(5, theta), (D[1](T_r))(6, theta), (D[1](T_s))(6, theta), (D[1](T_s))(6.05, theta)} in the given boundary conditions {15*(D[1](T_r))(5, theta) = 1000*T_r(5, theta)-303000, 15*(D[1](T_r))(6, theta) = -70*(D[1](T_s))(6, theta), 70*(D[1](T_s))(6.05, theta) = 300*T_s(6.05, theta)-531900, T_r(6, theta) = T_s(6, theta)}
 
 

I like using Record in Maple. It allows me to collect related variables to pass around inside one object. (Like with Pascal or Ada records or C struct).

But I find myself copying the record definition over and over everywhere I want to use the same specific record layout.

Is there a way to define specific record layout somewhere, may be as a type and give it a name, and then in each proc I want to make a variable of this record type, just tell Maple that this variable is a record of that type so I do not have to explicity define the record there each time? 

Here is a simple example to make it more clear

foo:=proc() #some proc that uses same Record layout
   local S;
   S:=Record('name','age');   
   S:-name:="joe doe 1";
   S:-age:=99;
   return S;
end proc:

boo:=proc() #another proc that wants to use same Record layout
   local S;
   S:=Record('name','age');   
   S:-name:="joe doe 2";
   S:-age:=80;
   return S;
end proc:

S1:=foo();
S2:=boo();

These proc's can be anywhere, such as inside package or module, either local or exported.

I just want to avoid having to type   S:=Record('name','age');   Each time. I want to tell Maple that a local variable is of this specific Record layout, without having to type the layout explicitly.

This way, when I add new field to this Record,  I just have to do it in one place and not in 10 places in the code. 

I think I need to add a new type? But do not know how to do this.  I hope the question is clear. If not, will add more information.

 

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