## Error in optimization? what parameter should ii ch...

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:-

## How to create auxiliary variables (maple V3 to Map...

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

## Using row/column matrices as projective vectors...

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>>)
 (1)
 > projcross(<<1,2,4>>,<<3,-5,7>>)
 (2)
 > projcross(<<1|2|4>>,<<34,5,-11>>)
 (3)
 > projcross(<<34,5,-11>> ,<<3|-5|7>> )
 (4)
 > #This section is to derive a CrossProduct and DotProduct for row and column matrix inputs
 > M:= ; #point
 (5)
 > N:= ; #point
 (6)
 > (M &x N)^%T ; #line thro' points
 (7)
 > R:= ;# line
 (8)
 > S:= ;# line
 (9)
 > (R &x S)^%T  ;# intersect point
 (10)
 >
 > T:=  ;#point
 (11)
 > U:=  ;# line
 (12)
 > DotProduct(T,U,conjugate=false) ; #check coincidence of point and line
 (13)
 > V:= ;# line
 (14)
 >
 > W:= ;#point
 (15)
 > DotProduct(V,W,conjugate=false)  ; #check coincidence of line and point
 (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"); <>; 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"); <>; 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 <>; 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)
 (17)
 > ProjCp(L1,L2)
 (18)
 > ProjCp(p1,L3)
 (19)
 > ProjCp(L3,p1)
 (20)
 > ProjCp(ProjCp(p1,p2),p3)
 (21)
 > Cartlist:=ProjCp~([p1,p2,p3])
 (22)
 > ProjCp~(Cartlist)
 (23)
 > ProjCp~([L1,L2,L3])
 (24)

 >
 >

## solve a system of linear equation by LU decomposit...

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.

## Techniques for rendering tables well....

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?

## Application Center - where's the advanced search?...

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?

## Error in procedure...

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

 >
 >
 >
 (1)
 >
 >

## why PDEtools:-Solve fails to same two equations in...

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);

 > Physics:-Version();

 > libname;

 > 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};

 > sol1:=solve(eqs,unknowns);

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

 >

## odetest gives different residual on the ode when a...

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);

 > Physics:-Version();

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

 > IC:=y(0)=1;

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

 > residual:=odetest(sol,ode)

 > simplify(residual) assuming positive;

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

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

## Help to convert a Maple V3 package to Maple 2024....

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:

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.

## Error in optimization? Constraint is not taken in ...

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?

## A curious error in dsolve...

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

Sincerely.

## Congruence of one polynomial modulo another...

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.