## 28100 Reputation

17 years, 244 days

## Interpolation...

You could construct an interpolating function from the x-y-z data, which could compute a z-value for any x,y pair within range.

Then you can make any usual kind of plot, and add coloring, options, etc.

For example, using the very small collection of data originally provided, see below.

I forced 20 contour values, but you could just as easily specifiy the contour values in steps of 100 ( ie, seq(...,100) instead of seq(...,numelems=20) ).

 > restart;
 > data := [[177.80000,0.,967.3266667],[169.80000,0.,963.5900000],          [100.00000,0.,188.8933333],[176.92000,17.703000,967.3266667],          [174.27000,35.230000,967.3200000],[169.90000,52.407000,967.3566667],          [163.84000,69.064000,967.3366667],[156.15000,85.034000,967.3100000],          [146.91000,100.16000,967.3366667],[136.20000,114.29000,967.3666667]]:
 > F := Interpolation:-Interpolate(data[..,1..2],data[..,3]):
 > P2:=plots:-contourplot(F,min(data[..,1])..max(data[..,1]),min(data[..,2])..max(data[..,2]),                        contours=[seq(min(data[..,3])..max(data[..,3])*(1-1e-9),numelems=20)],                        thickness=2, colorscheme=["Blue","Red"]):
 > plots:-display(   plottools:-transform((x,y)->[x,y,0])(P2),   plots:-surfdata(Matrix(data),source=irregular,                   style=point,shading=zhue,symbolsize=15,symbol=solidcircle) );

 > P2;

## assuming i>0...

Using Maple 18.02, since that's the version in which your attachment was last saved.

 >
 >

 >

 >

You could rearrange that result with various kinds of simplification. For example,

 >

 >

## execution groups...

You can insert a new execution group after the current line using either the keyboard shortcut Ctl j, or the main menubar item,
Insert -> Execution Group -> After Cursor

The keyboard shortcut for inserting before the cursor is Ctl k.

The keyboard shortcut for splitting an Execution Group at the current cursor position is the F3 key.

You can see a listing of the shortcuts on MS-Windows by looking at the Help page for topic
worksheet,reference,hotwin

For "Mac" (OS X) the variants are shown on the Help page with topic,
worksheet,reference,hotmac
For example, Cmd j and Cmd k

## indexing...

That can be attained directly by Matrix indexing, eg.

 > with(GraphTheory):
 > g:=Graph({{2,3},{1,2}}):

 > ind := [3,1,2];

 > foo[ind,ind];

## two simple ways...

If I understand the question correctly then here are two more ways, using reasonably terse syntax.

 > restart;
 > A := <<1, 5, 9, 13> | <2, 6, 10, 14> | <3, 7, 11, 15> | <4, 8, 12, 16>>;

 > B := <17,18,19,20>;

 > `<|>`(B\$4)/~A

 > `<|>`(seq(B/~A[..,i],i=1..4))

Those don't use any functionality new to only recent Maple versions.

ps. If you haven't already assigned the number of columns of Matrix A (here, the value 4) to some name, then it can be obtained as op([1,2],A) .

## something...

This is fiddly, but...

 > Typesetting:-mrow(Typesetting:-mo("Y"),                   Typesetting:-mspace(width="-1.2em"),                   Typesetting:-mo("○",mathsize=18));

## example...

Here is an example that you might find useful.

I'm using Maple here. I don't understand what you might want that's make it different for Maple Flow.

And I'm not sure what generality you're after.

 > restart;
 > x := T -> (A-1/T)/C;

 > y := x -> sqrt(1/27*8^3/C^3+1/4*x^2);

 > R := (x,y) -> exp((y-1/2*x)^(1/3)-(y+1/2*x)^(1/3));

 > R(x(T),y(x(T)));

 > # The same result R( (x,y@x)(T) );

 > comp := t -> R( (x,y@x)(t) ):
 > comp(T);

I'll mention that I'm not really sure that I've understood you precise goal. Here is a variant that might be closer to what you want.

 > restart;
 > x := T -> (A-1/T)/C;

 > y := x -> sqrt(1/27*8^3/C^3+1/4*x^2);

 > Rexpr := exp((y-1/2*x)^(1/3)-(y+1/2*x)^(1/3));

 > R := unapply(subs(x='x(t)',y='y(x(t))',Rexpr),t);

 > R(T);

Yet another possibility is that all your shown operators are actually starting off for you as just expressions, and you're trying to figure out how best to turn it all into the final (partially composed) operator.

For instance, you originally showed R as,
R := T -> exp((y-1/2*x)^(1/3)-(y+1/2*x)^(1/3));
where the parameter of that operator is T, which is not used within the body. As it stands that doesn't make syntactic sense. I can't tell whether you want that attempt to be fixed or to be accomodated.

Yet another possibility is that you're mostly trying to get (expressions or) operators to be legible when displayed. In that case you might be interested in commands such as PDEtools:-declare, so that the functional dependence of x & y upon T is visually suppressed.

Please let us know what you're really after.

## as x-y-z triples...

You can see the Help page for the ExportMatrix command, for exporting the Matrix M.

 > restart;
 > v_0 := 1: vstar := 10: r_0 := 1: k := 0.1: m := 0.1:
 > PDE := diff(v(r, t), t) = k*(diff(v(r, t), r, r) + diff(v(r, t), r)/r):
 > BC1 := eval(v(r, t) - v_0 = 0, r = 20):
 > BC2 := D[1](v)(0, t) = 0:
 > IC := v(r, 0) = v_0 + (vstar - v_0)*exp(-0.5*(r - r_0)^2/m^2)/(m*sqrt(2*Pi)):
 > sol := pdsolve(PDE, {BC1, BC2, IC}, numeric, time = t,                range = 0 .. 20, spacestep = 0.1, timestep = 0.1):
 > P := sol:-plot3d(r = 0 .. 10, t = 0 .. 20):
 > data := op(indets(plottools:-transform((x,y,z)->[x,y,z])(P),                   specfunc(anything,MESH))[1]):
 > M:=Matrix([seq(seq(data[i,j,..],j=1..25),i=1..25)]);

 > #  ?ExportMatrix

Another possibility is that you only want the heights (ie. v-values) from the plot P. You can get that using the plots:-getdata command applied to the plot assigned to P above. That relates to evenly sampled x- and t-values, for the number of data points (25 in each dimension, here), evenly sampled across their ranges. The central point here is that you haven't described the format you want for the exported data.

## how many of them?...

You seem to be concerned with prime factors. Is that right? (I'm supposing so. You didn't use that specific word. But you mentioned ifactor.)

For a given k, do you want to do this for all of the prime factors of k, or just some of them, or just one of them? (If you have a large number of examples, etc, then you might want an especially efficient approach that scales well. I don't know how you intend to use the information.)

If you want them all, and want to look up those values repeatedly, then you could turn the results from ifactors into a table.

Below, the procedure p scans the list g until it finds the entry (here, sublist) whose own first entry equals b. Then it stops and returns the second entry of that, ie. the corresponding multiplicity. I'm presuming that you will be calling it only for a b that you know is a present (you could adjust if you need a graceful fail, otherwise, or other sanity checking).

 > restart;
 > p := (b,g)->ListTools:-SelectFirst(u->u[1]=b,g)[2]:

 > G :=ifactors(24)[2];

 > p(2,G);

 > H := ifactors(114345000)[2];

 > p(3,H);

 > p(5,H);

 > T := table(map(u->u[1]=u[2],H)):
 > T[3], T[5], T[11];

But if your situation is that you want to test only a small number of factors for a number (that is, say,relatively expensive to factor completely) then you might wish to avoid ifactors altogether. I don't know your situation.

## Speaker component...

The Help page for the Play command of the AudioTools package has an example like that.

That example is preceded closely by a statement that one must insert a Speaker component.

## more recovery...

How's this?

Styrkelære2regneopgaver_ac1.mw

(There might be a missing input just after the line with the text "indersiden af beholderen har vi", in subsection "Opgave 12".)

@Tycho Brahe You can download the installer for the Maple 2022.2 update here.

## a better range...

It helps to use another range.

 > restart;
 > TWeq := 2.96736996560705*10^(-12)*p^2+1.31319840299485*10^(-13)*t^2         -8.89549693662593*10^(-7)*p+8.53128393394231*10^(-7)*t         -3.65558815509970*10^(-30)*p*t-1 = 0:
 > plots:-implicitplot(TWeq, p = -2e6 .. 2e6, t = -1e7 .. 1e7,                     scaling=constrained);

## example...

It's not entirely clear to me what you mean.

But you could use add, or a do-loop, as follows.

 > restart;
 > S1 := 441; S2 := 1109; S3 := 511; S4 := 900; S5 := 2904; S6 := 285;

 > S2 + S3 + S4 + S5 + S6;

 > S[1]:=0; for i to 5 do     S[i+1]:=S[i] + S||(i + 1); end do;

 > S1 + S2 + S3 + S4 + S5 + S6;

 > S[1]:=S1; for i to 5 do     S[i+1]:=S[i] + S||(i + 1); end do;

## SMTLIB:-Satisfiable...

You recently mentioned that SMTLIB was not working properly on your Windows 10 machine.

The command SMTLIB:-Satisfiable gets called on your example(s), returning false on my Maple 2023.0 for Linux.

I suspect that you might be seeing that FAIL result in consequence. Here is the trace of that command for the last example.

 > restart;
 > kernelopts(version);

 > _EnvTry := hard:
 > assume(Or(n < 0, 1 <= n), n*(n - 1)/2 < m);
 > is(m<0);

 > is(m>0);

 > trace(SMTLIB:-Satisfiable):
 > coulditbe(m,0);

{--> enter SMTLIB:-Satisfiable, args = {Or(1 <= n_2, n_2 < 0), m_1 = 0, 0 < m_1-(1/2)*n_2^2+(1/2)*n_2}, timelimit = .25

<-- exit SMTLIB:-Satisfiable (now in \`is/internal/SMTLIB\`) = false}

{--> enter SMTLIB:-Satisfiable, args = {Or(1 <= n_2, n_2 < 0), m_1 = 0, 0 < m_1-(1/2)*n_2^2+(1/2)*n_2}, timelimit = .25

<-- exit SMTLIB:-Satisfiable (now in \`is/internal/SMTLIB\`) = false}