Ronan

1521 Reputation

16 Badges

14 years, 245 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I am trying to follow a series of substitutions used in a paper. I have given some examples of the substitutions. But I am having difficulty getting them to work. I know if all else fails I can manually recreate an expression with the substitution variables and then check backwards using eval(f,vals).
Would appreciate any insight on substitution techniques here.
 

> 

restart

> 

 

> 

sidrels := [a*c - b^2 = Delta, a + c - 2*b = d, a - b = c__bar, a - c = b__bar, c - b = a__bar];

[a*c-b^2 = Delta, a+c-2*b = d, a-b = c__bar, a-c = b__bar, c-b = a__bar]

(1)
> 

vals:='rhs=lhs'~(sidrels)

[Delta = a*c-b^2, d = a+c-2*b, c__bar = a-b, b__bar = a-c, a__bar = c-b]

(2)
> 

t1:=a + c - 2*b;
simplify(t1,sidrels); #this should be d

a+c-2*b

 

d

(3)
> 

t2:=Vector[column](3, [-a + b, c - b, 0]);
simplify(t2,sidrels) ; # This should be <-c__bar,a__bar,0> or <c__bar,-a__bar,0,>r

Vector(3, {(1) = -a+b, (2) = c-b, (3) = 0})

 

Vector[column](%id = 36893490321805397396)

(4)
> 

t3:=normal(1 - b^2/(a*c));

(a*c-b^2)/(a*c)

(5)
> 

simplify((5),sidrels); # This should be Delta/(a*c)

Delta/(b^2+Delta)

(6)
> 

simplify(numer((5)),sidrels,'mindeg')/(denom((5)) ); # This works

> 

 

Delta/(a*c)

(7)
> 

t4:=[(-b^2 + b*c)/(a*c - b^2), (a*b - b^2)/(a*c - b^2)]

[(-b^2+b*c)/(a*c-b^2), (a*b-b^2)/(a*c-b^2)]

(8)
> 

simplify(t4,sidrels,'mindeg');# this should be [(b*a__bar)/Delta, (b*b__bar)/Delta]

[-b*(-c+b)/Delta, b*(a-b)/Delta]

(9)
> 

t5:=simplify(Vector[column](3, [3*b*c__bar - Delta, -3*a__bar*b + Delta, b*(-c__bar + a__bar)]))

Vector(3, {(1) = 3*b*c__bar-Delta, (2) = -3*a__bar*b+Delta, (3) = b*(-c__bar+a__bar)})

(10)
> 

t5[3]:=simplify(t5[3],sidrels)  ;#This should be b*b__bar

> 

 

-a__bar^2+(2*b+d)*a__bar-Delta

(11)
> 

t5

Vector(3, {(1) = 3*b*c__bar-Delta, (2) = -3*a__bar*b+Delta, (3) = -a__bar^2+(2*b+d)*a__bar-Delta})

(12)
> 

subs(sidrels[-2],b*(-c__bar + a__bar))

b*(-c__bar+a__bar)

(13)
> 

algsubs(sidrels[-2],b*(-c__bar + a__bar))

b*(-c__bar+a__bar)

(14)
> 

 


 

Download 2026-07-29_Q_Simplifications_and_Substitutions.mw

Are there any demonstration help videos on creating an eBook? Currently I am struggling with the pages Having a laid out example would really help.  

I would like to do an eBook version of my help pages to send to some people. Hopefully I can use the current help worksheets. The are formatted based on the Maple help structure.

My currrent structure in the help section is:

Rational Trigonometry

      (about 40 help topics)

       RTProjective

       (about 20 help topics)

       UHG

       (about 20 help topics)

     Edit:- I have made a small step of progress using the " Assistant eBook template" but I am getting this error on build. I don't know how to find the cause of the error.

I am trying to select from a default list and a modified list to get a third combined list of the unmodified default elements and the mdfified elements plus extra elements. This is for plot data. I have managed to extract the colour data using something I did a couple of years ago. Though at this stage I don't relly know how that works either but it works.

> 

restart

> 

with(ListTools)

[BinaryPlace, BinarySearch, Categorize, Classify, Collect, Deal, DotProduct, Enumerate, FindMaximalElement, FindMinimalElement, FindRepetitions, Flatten, FlattenOnce, Group, Interleave, InversePermutation, Join, JoinSequence, LengthSplit, MakeUnique, Occurrences, Pad, PartialSums, Reverse, Rotate, Search, SearchAll, SelectFirst, SelectLast, Slice, Sorted, Split, Transpose, Unpermute]

(1)
> 

PlotDefaults:=['colour' = ':-blue', symbol = ':-solidcircle', ':-symbolsize' = 8,thickness=2]; #for points and lines

[colour = blue, symbol = solidcircle, symbolsize = 8, thickness = 2]

(2)
> 

Inputs:=['color'=[red, black, blue],symbol=square,':-linestyle'=dash]; #'color'=[red, black, blue],

> 

 

[color = [red, black, blue], symbol = square, linestyle = dash]

(3)
> 

if has(Inputs,{colour,color}) then
Colourlist:=remove(has,remove(has,Flatten(eval([':-color',':-colour'],Inputs)),':-colour'),':-color')
else
Colourlist:=remove(has,remove(has,Flatten(eval([':-color',':-colour'],PlotDefaults)),':-colour'),':-color');
end if

[red, black, blue]

(4)


Make this list

> 

plotdata:=[symbol=square,':-linestyle'=dash,':-symbolsize' = 8,thickness=2]

[symbol = square, linestyle = dash, symbolsize = 8, thickness = 2]

(5)
> 

mx:=max(nops(PlotDefaults),nops(Inputs))

4

(6)
> 

Plotdata:=[];
for i to mx do

end do

> 

 

> 

 

[]

(7)
 

 

Download 2026-05-18_Q_Select_from_Two_Lists_to_get_New_List.mw

Insetr Table seems to default too test inpul in the cells. I am inserting it from this icon 

I can't figure out how to change the whole table to 1d or 2d math input without individually changing each cell..

What am I misssing here?

I have a example overloaded procdeure below. Due to '=' the optional input in the 2nd proc gets trapped in the 1st proc. I have tried various ways to get around this. Obviously I could make the  optional input in the 2nd proc non-optional if all else fails. Is there a way around this?

> 

restart

> 

Test:=overload([
proc(l1::{`+`,`*`,`=`, `symbol`,procedure,not(list)},
l2::{`+`,`*`,`=`, `symbol`,procedure,not(list)} ) #need to detect if 'point' is present

option overload;
if not(has([_params[2]],point)) then #if true need to go the next proc

print("1st proc ",l1," ",l2);
return
end if;
end proc,

proc(l1::{`+`,`*`,`=`, `symbol`,procedure,not(list)},
{point::list:=NULL}) #oprional input

print("2nd proc",l1,"point",point);

end proc
]):

> 

 

> 

l:=3*x+4*y-5;
h:=4*x-8*y = 5;
P:=[3,5]

3*x+4*y-5

 

4*x-8*y = 5

 

[3, 5]

(1)
> 

Test(l,h)

> 

 

"1st proc ", 3*x+4*y-5, " ", 4*x-8*y = 5

(2)
> 

Test(l,point=P)

> 

 

> 

Test(h,point=[2,7])

 

 

Download 2026-02-28_Q_Test_proc_Line_point_inputs.mw

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