MaplePrimes Questions

I'm encountering an error in the optimization process when adding constraints C1 and C2. I've attached the sheet for reference. 

Q4.mw
To obtain a graph similar to the one below, which parameters in the data should I adjust? As you can see in the attached sheet, the graph is concave with respect to tau1 but not tau2. What changes should I make to ensure the graph is also concave with respect to tau2?

Dummy graph:-

Hello

In my last question, I asked for help converting an old Maple V3 code to the latest version. With the help of  @Rouben Rostamian, I managed to get most of the procedures working again. Unfortunately, there is one procedure that I cannot figure out how to convert. Below is the procedure, along with an example that works and one that does not.

saturbasis := proc(ps,js,ord)
 local qs,gb,zz,j,aux;
     print("ps = ",ps):
     print("js = ",js):
	 print("ord = ",ord):
     if js <> {} then
         qs := [op(ps),'`@z`.j*js[j]-1' $ ('j' = 1 .. nops(js))];print("qs = ",%):
         zz := ['`@z`.(nops(js)-j+1)' $ ('j' = 1 .. nops(js))];print("zz = ",%):
         aux:= [op(zz),'ord[nops(ord)-j+1]' $ ('j' = 1 .. nops(ord))]:print("aux = ",aux):
         gb := grobner['gbasis'](qs,aux,'plex');
         qs := [];
         for j to nops(gb) do
             if {op(zz)} minus indets(gb[j]) = {op(zz)} then
                 qs := [gb[j],op(qs)]
             fi
         od
     else qs := ps
     fi;
     qs
end proc:

First example:

ps:=[2*x1^2 + 3*x2^2 + 4*x1 + x2, x1*x3 - 3*x2 - 1, 2*x1*x4 + 3*x2 + 1]:
js:={x1}:
ord:=[x1, x2, x3, x4]:

saturbasis(ps,js,ord);
             [    2       2                                
    "ps = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, 

                        ]
      2 x1 x4 + 3 x2 + 1]


                         "js = ", {x1}

                   "ord = ", [x1, x2, x3, x4]

             [    2       2                                
    "qs = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, 

                                   ]
      2 x1 x4 + 3 x2 + 1, @z x1 - 1]


                         "zz = ", [@z]

                 "aux = ", [@z, x4, x3, x2, x1]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
[    2       2                                                  
[2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, x2 x3 + 2 x1 + 4, 

           ]
  2 x4 + x3]


Second example:

ps:=[2*x1*x4^2 + 3*x1 + x4 + 6, x3*x4^3 + 2*x4^4 - 9*x3 - 18*x4, 2*x2*x4^2 + 3*x2 - 4*x4 + 1]:
js:={2*x4^2 + 3, x4^3 - 9}:
ord:={2*x4^2 + 3, x4^3 - 9}:

saturbasis(ps,js,ord);
           [       2                  
  "ps = ", [2 x1 x4  + 3 x1 + x4 + 6, 

         3       4                        2                  ]
    x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1]


                          /    2        3    \ 
                "js = ", { 2 x4  + 3, x4  - 9 }
                          \                  / 

                           /    2        3    \ 
                "ord = ", { 2 x4  + 3, x4  - 9 }
                           \                  / 

          [       2                  
 "qs = ", [2 x1 x4  + 3 x1 + x4 + 6, 

        3       4                        2                    
   x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1, 

      /    2    \           /  3    \    ]
   @z \2 x4  + 3/ - 1, 2 @z \x4  - 9/ - 1]


                      "zz = ", [2 @z, @z]

                      [            3          2    ]
            "aux = ", [2 @z, @z, x4  - 9, 2 x4  + 3]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
Error, (in grobner:-gbasis) invalid input: Groebner:-Basis expects its 2nd argument, tord1, to be of type Or(ShortMonomialOrder,name,MonomialOrder), but received plex(2*`@z`,`@z`,x4^3-9,2*x4^2+3)

I suppose that the "." is no longer used as it was back in Maple V3, and it seems that the author of the procedure was creating extra auxiliary variables to solve the problem.


What did the author use @ for creating the variables?  And how to fix the error?

Many thanks
 

I need to seperate vectors  from projective geometry vectors in my package. I am experimenting with using row and column matrices for projective points and lines reppresentation. Two approaches are use here. The 1st converts the Matrices to Vectors and back in the procedure. I dont like that way. The 2nd approach, I worked out the equivalent of CrossProduct and DotProduct for the row and column matrices. That I think is better.

1st Question are there any other approaches worth looking at?Is there something in the Physics package that could be of use?

2nd Qusetion could a new data type be made with the properties of a vector that could be displayed differently.?

Say, for a point [ x : y : z ] and a line < x : y : z >, because projecive quantities as basically ratios..


 

restart

with(LinearAlgebra):

 

#

projcross:=overload([

proc(A::Matrix(1,3),B::Matrix(1,3))
option overload;
description "join of points";
local a:=convert(A,Vector[row]),b:=convert(B,Vector[row]);
uses LinearAlgebra;
print("line thro' points");
convert((a &x b)^%T,Matrix);
end proc,

proc(A::Matrix(3,1),B::Matrix(3,1))
option overload;
description "meet of lines";
local a:=convert(A,Vector[column]),b:=convert(B,Vector[column]);
uses LinearAlgebra;
print("intersect point");
convert((a &x b)^%T,Matrix);
end proc,

proc(A::{Matrix(1,3),Matrix(3,1)},B::{Matrix(1,3),Matrix(3,1)})
option overload;
description "incidence of point and line";
uses LinearAlgebra;
local a,b;
if type(A,'Matrix'(1,3))and type(B,'Matrix'(3,1)) or type(A,'Matrix'(3,1))and type(B,'Matrix'(1,3))  then #not working
a:=convert(A,Vector[row]);
b:=convert(B,Vector[row]);
end if;
print("if = 0 coincident");
a.b ;
end proc


]):

projcross(<<1|2|4>>,<<3|-5|7>>)

"line thro' points"

 

Matrix([[34], [5], [-11]])

(1)

projcross(<<1,2,4>>,<<3,-5,7>>)

"intersect point"

 

Matrix([[34, 5, -11]])

(2)

projcross(<<1|2|4>>,<<34,5,-11>>)

"if = 0 coincident"

 

0

(3)

projcross(<<34,5,-11>> ,<<3|-5|7>> )

"if = 0 coincident"

 

0

(4)

#This section is to derive a CrossProduct and DotProduct for row and column matrix inputs

M:=<A[1,1]|A[1,2]|A[1,3]> ; #point

M := Vector[row](3, {(1) = A[1, 1], (2) = A[1, 2], (3) = A[1, 3]})

(5)

N:=<B[1,1]|B[1,2]|B[1,3]> ; #point

N := Vector[row](3, {(1) = B[1, 1], (2) = B[1, 2], (3) = B[1, 3]})

(6)

(M &x N)^%T ; #line thro' points

3

(7)

R:=<A[1,1],A[2,1],A[3,1]> ;# line

R := Vector(3, {(1) = A[1, 1], (2) = A[2, 1], (3) = A[3, 1]})

(8)

S:=<B[1,1],B[2,1],B[3,1]> ;# line

S := Vector(3, {(1) = B[1, 1], (2) = B[2, 1], (3) = B[3, 1]})

(9)

(R &x S)^%T  ;# intersect point

[`?`]

(10)

 

T:=<A[1,1]|A[1,2]|A[1,3]>  ;#point

T := Vector[row](3, {(1) = A[1, 1], (2) = A[1, 2], (3) = A[1, 3]})

(11)

U:=<B[1,1],B[2,1],B[3,1]>  ;# line

U := Vector(3, {(1) = B[1, 1], (2) = B[2, 1], (3) = B[3, 1]})

(12)

DotProduct(T,U,conjugate=false) ; #check coincidence of point and line

A[1, 1]*B[1, 1]+A[1, 2]*B[2, 1]+A[1, 3]*B[3, 1]

(13)

V:=<A[1,1],A[2,1],A[3,1]> ;# line

V := Vector(3, {(1) = A[1, 1], (2) = A[2, 1], (3) = A[3, 1]})

(14)

 

W:=<B[1,1]|B[1,2]|B[1,3]> ;#point

W := Vector[row](3, {(1) = B[1, 1], (2) = B[1, 2], (3) = B[1, 3]})

(15)

DotProduct(V,W,conjugate=false)  ; #check coincidence of line and point

A[1, 1]*B[1, 1]+A[2, 1]*B[1, 2]+A[3, 1]*B[1, 3]

(16)

# CrossProduct and DotProduct procedure for matrix inputs

 

ProjCp:=overload([

proc(a::Matrix(1,3),b::Matrix(1,3))
option overload;
description "join of points";
local A:=a,B:=b;
print("line thro' points");
<<A[1, 2]*B[1, 3] - A[1, 3]*B[1, 2],-A[1, 1]*B[1, 3] + A[1, 3]*B[1, 1],A[1, 1]*B[1, 2] - A[1, 2]*B[1, 1]>>;
end proc,

 

proc(a::Matrix(3,1),b::Matrix(3,1))
option overload;
description "meet of lines";
local A:=a,B:=b;
print("intersect point");
<<A[2, 1]*B[3, 1] - A[3, 1]*B[2, 1] | -A[1, 1]*B[3, 1] + A[3, 1]*B[1, 1] | A[1, 1]*B[2, 1] - A[2, 1]*B[1, 1] >>;
end proc,

proc(A::{Matrix(1,3),Matrix(3,1)},B::{Matrix(1,3),Matrix(3,1)})
option overload;
description "incidence of point and line";
local dp;
uses LinearAlgebra;
if type(A,'Matrix'(1,3))and type(B,'Matrix'(3,1))   then
dp:=A[1, 1]*B[1, 1] + A[1, 2]*B[2, 1] + A[1, 3]*B[3, 1];

elif type(A,'Matrix'(3,1))and type(B,'Matrix'(1,3)) then
dp:=A[1, 1]*B[1, 1] + A[2, 1]*B[1, 2] + A[3, 1]*B[1, 3];

end if;
print("if = 0 coincident");
return dp
end proc,

proc(A::{Matrix(1,3),list})
option overload;
description "convert to/from cartesian";
if type(A,'Matrix'(1,3)) and A[1,3]<>0 then
[A[1,1]/A[1,3],A[1,2]/A[1,3]];
elif A::list then
<<A[1]|A[2]|1>>;
end if;
end proc,

proc(A::{Matrix(3,1)},{vars:=[x,y]})
option overload;
description "convert to expression";

A[1,1]*vars[1]+A[2,1]*vars[2]+A[3,1];

end proc
 

]):

p1:=<<1|2|4>>:p2:=<<3|-5|7>>:p3:=a*p1-b*p2:

L1:=<<5,7,-8>>:L2:=<<-1,4,-6>>:

L3:=ProjCp(p1,p2)

"line thro' points"

 

L3 := Matrix(3, 1, {(1, 1) = 34, (2, 1) = 5, (3, 1) = -11})

(17)

ProjCp(L1,L2)

"intersect point"

 

Matrix([[-10, 38, 27]])

(18)

ProjCp(p1,L3)

"if = 0 coincident"

 

0

(19)

ProjCp(L3,p1)

"if = 0 coincident"

 

0

(20)

ProjCp(ProjCp(p1,p2),p3)

"line thro' points"

 

"if = 0 coincident"

 

0

(21)

Cartlist:=ProjCp~([p1,p2,p3])

[[1/4, 1/2], [3/7, -5/7], [(a-3*b)/(4*a-7*b), (2*a+5*b)/(4*a-7*b)]]

(22)

ProjCp~(Cartlist)

[Matrix(1, 3, {(1, 1) = 1/4, (1, 2) = 1/2, (1, 3) = 1}), Matrix(1, 3, {(1, 1) = 3/7, (1, 2) = -5/7, (1, 3) = 1}), Matrix(1, 3, {(1, 1) = (a-3*b)/(4*a-7*b), (1, 2) = (2*a+5*b)/(4*a-7*b), (1, 3) = 1})]

(23)

ProjCp~([L1,L2,L3])

[5*x+7*y-8, -x+4*y-6, 34*x+5*y-11]

(24)

 

 

 

 

 

 

 


 

Download 2024-08-16_Projective_Vectors_as_Matrices.mw

I want to solve a system of linear equation by LU decomposition method (Crout matrix decomposition). Most importantly, I want to take all elements of the principal diagonal of U as 1. 

 

How to do that?

 

Equations: 4x+y+z=4, x+4y-2z=4, 3x+2y-4z=6. 

 

What are the best techniques/tools/functions for rendering tabular data in more human-friendly ways within the Maple graphical user interface?

I work with large tables that would be too long to render completely in the interface, and doing so would not be an effective way to represent the data to readers of a Maple Document. However, rendering subsets of the data with headers, captions, colors, and footnotes would be beneficial. It would also be helpful to ensure each data type, such as dates, integers, and strings, was rendered appropriately. Ideally, the table would be rendered with sizing to fit the data rather than always the full width of the Maple Document.

Subsetting the data seems to be straightforward by indexing against the underlying variable. However, the operations available to define the rendering are unclear.

I see that the "Maple 2024 Help" includes documentation for "DocumentTools,Layout,Table." This appears to be the function to focus on specifically, and the DocumentTools Package seems to be the Package where control over layout is provided. Is this the only Package and Function to focus on, or are there alternative techniques?

There's no advanced search in the application center.

If I search for Maple 10 I get a total of 3 applications - I know there's at least a couple hundred maple 10 applications.  

How do I search for all Maple 10 applications?

Dear maple user i have a partial differential equation whose first approximation solution is w(r,z)=(r^2-h^2)/4 , i want to calculate the two approximations. I am attaching the file please see  

# I dont want to solve directly.

HP_Help.mw

restart

``

B := (sum(a__n*exp(n*x), n = -c .. p))/(sum(b__m*exp(m*x), m = -d .. q))

(exp((p+1)*x)/(exp(x)-1)-exp(-c*x)/(exp(x)-1))*a__n/((exp((q+1)*x)/(exp(x)-1)-exp(-d*x)/(exp(x)-1))*b__m)

(1)

 

NULL

Download open_series_and_take_derivative.mw

I found a case where PDEtools:-Solve fail and solve works. I do not understand why. 

Is this a bug or what is going on? I thought they should give same result.


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1787 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

eqs:=[-2*arctanh((_C1-1)^(1/2)/_C1^(1/2)) = _C2, 0 = _C1^(3/2)*tanh(1/2*_C2)*sech(1/2*_C2)^2];
unknowns:={_C1,_C2};

[-2*arctanh((_C1-1)^(1/2)/_C1^(1/2)) = _C2, 0 = _C1^(3/2)*tanh((1/2)*_C2)*sech((1/2)*_C2)^2]

{_C1, _C2}

sol1:=solve(eqs,unknowns);

{_C1 = 1, _C2 = 0}

sol2:=PDEtools:-Solve(eqs,unknowns);

 


 

Download why_PDEtools_Solve_fail_august_14_2024.mw

 

I am very confused about this result. 

I call the result of odetest the residual. Which should be zero or simplifies to zero if dsolve solution is correct.

Now, if I do     odetest(solution,ode), I get residual which simplifies to zero. OK. But doing odetest(solution,[ode,IC]) now gives output for the ode residual (first entry) completely different than the first case and which can't be simplified to zero any more. 

odetest also says the solution satisfies the IC, since the second entry of the residual is zero.     

So we have case where the solution satisfies the ODE itself and also satisfies the IC. But when calling odetest with both the ode and the IC, now it says the solution does not satisfiy the ode.

How could this be? What Am I overlooking here? Should not the ode residual remain the same in both calls?

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1787 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

restart;

ode:=diff(y(x), x, x) = sqrt(1 + diff(y(x), x)^2);

diff(diff(y(x), x), x) = (1+(diff(y(x), x))^2)^(1/2)

IC:=y(0)=1;

y(0) = 1

sol:=[dsolve([ode,IC])][-1]; #just interested in last solution now

 

y(x) = cosh(x+c__1)+1-cosh(c__1)

residual:=odetest(sol,ode)

cosh(x+c__1)-(1/2+(1/2)*cosh(2*x+2*c__1))^(1/2)

simplify(residual) assuming positive;

0

#Why now the residual changes on the ode??
residual:=odetest(sol,[ode,IC])

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

#no longer simplifes to zero.
map(X->(simplify(X) assuming positive),residual)

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

 

 

Download odetest_problem_august_14_2024.mw

Hello

I need to use the Ritt algorithm to find the characteristic sets of a set of differential equations. In the past, it seems there was a Maple package by D. Wang available through Maple Applications, but this no longer appears to be the case. I managed to download an old set of files from the author’s site, dated February 1996, which is a Maple V3 package. The instructions in the Readme file mention that using the provided Makefile, an m-file containing all the functions will be created, which can then be loaded into Maple. Unfortunately, running make -f Makefile did not create anything, so I am wondering if I could get some assistance on how to convert this package to something compatible with the latest Maple releases.

The source (txt) files are structured as follows:

Example: 


1) Comments
2) Definition of the User functions - something like

 

dcharsets[dcharset] := proc() `charsets/d_charset`(args) end:

dcharsets[dmcharset] := proc() `charsets/d_mcharset`(args) end:

dcharsets[dcs] := proc() `charsets/d_charser`(args) end:

dcharsets[dmcs] := proc() `charsets/d_mcs`(args) end:

dcharsets[dics] := proc() `charsets/d_ics`(args) end:

and

read `charsets.m`:

# set of non-zero remainders of d-polys in ps wrt d-ascending set as
#       user level function
`charsets/d_remset` :=

subs(`charsets/class`=`charsets/d_class`,
     `charsets/remseta`=`charsets/d_remseta`,
     `charsets/premas`=`charsets/d_premas`,op(`charsets/remset`)):

and lots of Maple procedures - Example below

 

`charsets/d_charset` := proc(ps,lst,medset)

....

end:

the source file ends with the following lines.

read dhelp;
save `dcharsets.m`:
quit

Many thanks

 

Note: Before posting this question here, I tried to contact the author but received no response.

I am attaching a sheet where i found error in the optimization function. Its not considering constrain C3 and C5 . Can anyone help?
N_7.mw

Also in the plot the tau1 value remain same for the optimal lambda. What parameter in the model can be changed in DATA so that i get dome like structure? 

Hi,
 i observe this error as if a sum() was used instead of a add() in dsolve

> assume(g > 0): dsolve({diff(r(t), t$2) + g * t * r(t), r(0) = r0, D(r)(0) = r1},  r(t));
Error, (in dsolve) unsupported type of index, _a

any help or advice, please ?

Sincerely.

Definition Let "F"  be a field with f(x), g(x), p(x) being polynomials in F[x] and "p(x)" nonzero. Then if "p(x)|f(x)-g(x)" we say "f(x)" is congruent to "g(x)" modulo "p(x)". 
               
For example, in Q[x], x^2+x+1 is congruent to x+2 modulo x+1 because (x^2+x+1)-(x+2) = x^2-1=(x+1)(x-1).

This congruence among polynomials is similar, but not quite the same as congruence among integers.

Is there a way, in Maple, to solve problems like this? Could Maple tell me, for example, what polynomials are congruent to x^2+x+1 modulo x+1? An answer might be in the form x^2 +x+1 belongs to [x-1], an  equivalence class of polynomials.

I have not been able to find any such function in Maple, nor any calculator for it on the web. Maybe I'm not using the right search terms.

Hello, consider 0<x<1, 0<y<1 and t >0 (t: fixed)

Let the region:
R={(x,y) | x*(1-y)/y*(1-x) < t}

How can I draw the region R in Maple. thanks.

First 8 9 10 11 12 13 14 Last Page 10 of 2354