## 1157 Reputation

12 years, 151 days

## Overload Procedures with default values ...

Maple 2023

The overloaded  procedure here test returns based on 2 lists or 3 lists entered. The two list has a mixed input type with a default value. The default value of "a" can cause a problem if an explicit value in not entered for "a" in foo1. I not sure is the mixed input type is adding to the problem.
By changing the order of the procedures the problem is avoidable here. But this just a simple example. When there are 6 or so procedures it can be very difficult to select a correct ordering.

Is there a way around this, apart from don't have default values?

I could experiment with changing the input order in each proc but that would break up some logical input sequences on me.

 > restart
 >
 > foo:=overload([                         proc(P1::list,P2::list,a::algebraic:=4,\$)                          option overload;                          print("2 lists");                           end proc,                        proc(P1::list,P2::list,P3::list,\$)                          option overload;                          print("3 lists");                           end proc                        ]);
 (1)
 > foo([1,2],[3,4])
 (2)
 > foo([1,2],[3,4],[4,7])
 (3)
 >
 >
 >
 > foo1:=overload([                                                 proc(P1::list,P2::list,P3::list,\$)                          option overload;                          print("3 lists");                           end proc,                         proc(P1::list,P2::list,a::algebraic:=4,\$)                          option overload;                          print("2 lists");                           end proc                        ]);
 (4)
 > foo1([1,2],[3,4]); #incorrect output
 (5)
 > foo1([1,2],[3,4],4)
 (6)
 > foo1([1,2],[3,4],[4,7])
 (7)
 >

## Check if '=' is or is not in an equation...

How do i check if an equation or function does not contain an '=' sign, to convert it?

if eq:= a+b=c

If it has an  '=' I can use eq1:=lhs(eq)-rhs(eq).

If eq=d+e+f there is no lhs/rhs and checking produces an error.

```eq := a*x^2 + b*x = v;
2
eq := a x  + b x = v

eq1 := lhs(eq) - rhs(eq);
2
a x  + b x - v

eq2 := a*x^2 + b*x - v;
2
eq1 := a x  + b x - v

lhs(eq1);
Error, invalid input: lhs received a*x^2+b*x-v, which is not valid for its 1st argument, expr
NULL;
has(eq,'=');
Error, invalid uneval
Typesetting:-mambiguous(hasApplyFunction(eqcomma

Typesetting:-mambiguous((equals),

Typesetting:-merror("invalid uneval"))))

has(eq2, rhs(eq2));
Error, invalid input: rhs received eq2, which is not valid for its 1st argument, expr
NULL;
```

## Inputs to whorksheet changed after windo...

Maple 2023

I have done a complete clean reinstall of windows 10 and all programs on my pc.

In worksheet mode new files do not have the "default" red/brown text coluor ond the font is different.

Might not be a problem but thought that was the default?

What have I changed or have Maple defaults changed?

 >
 >
 >
 (1)
 >
 >
 (2)
 >

## Animate a Line....

Maple 2023

I am asking this beacuse I am rusty on using animate in plots. Just trying to show the line segment moving.

 (1)

## Solving for intersect of two circles...

Maple

If if solve for two circles intersecting the general solution conteint a factor of (xc1-xc2) i.e. x co-ors of the circle centres in both numerator and denominator. So the solution fails if they are equal i.e circles vertically aligned.
I can get arount the problem using  "RealDomain" but that introduces Signum which I dont like and is much slower to solve. I substitued out substitued signum out signum(xc1-xc2)=1. Works.

Just looking for is neater solution approach.

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)

 (8)

 (9)

 (10)

 (11)

 (12)

 (13)

 (14)