Ronan

1411 Reputation

16 Badges

14 years, 73 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

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

I am trying to set the default Cartesian and Parametric variables to set them golbally or locally in a command..

How do I achieve this? 

restart

interface(version)

`Standard Worksheet Interface, Maple 2026.0, Windows 10, March 05 2026 Build ID 2001916`

(1)

TM := module () local Cartvars, Parmvars; export Cartline, Parmline; global x, y, z;  Cartvars := [x, y, z]; Parmvars := [alpha, beta, rho]; Cartline := proc (p1::list, p2::list, { vars := Cartvars }) local l; global Cartvars; l := (p2[2]-p1[2])*vars[1]+(p1[1]-p2[1])*vars[2]-p2[2]*p1[1]+p1[2]*p2[1]; return l end proc; Parmline := proc (p1::list, p2::list, { varp := Parmvars }) local l; global Parmvars; l := `~`[`+`](p1, varp[1]*`<,>`(p2-p1)); return l end proc end module

TM:-Cartline([4, 3], [-8, 4])

Cartvars[1]+12*Cartvars[2]-40

(2)

TM:-Cartline([4, 3], [-8, 4], vars = [x, y])

x+12*y-40

(3)

NULL

TM:-Parmline([4, 3], [-8, 4])

Vector[column](%id = 36893490963638479436)

(4)

TM:-Parmline([4, 3], [-8, 4], varp = [alpha])

Vector[column](%id = 36893490963638469564)

(5)

NULL

Download 2026-03-26_Q_Module_Generic_Variables.mw

Does this symbol for equicalence exist in Maple ?  I can't find it in the pallets. 

If not is there a way of making it so I could add it to my favourites?

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