## Hoùology matrice...

what is the homology matrix that plates the ABCE square on the NPCM square
I think it may bi find out with the rotation angle, the vector of translation and the homothety ratio.
restart;
with(geometry):
with(plots):
_EnvHorizontalName = 'x':  _EnvVerticalName = 'y':

point(A, 0, 1):
point(B, 1, 1):
point(C, 1, 0):
point(E, 0, 0):
square(Sq, [A, B, C, E]):
Phi := (1 + sqrt(5))/2:
point(N, (2 - Phi)/(Phi - 1), 1):
line(BE, [B, E]):
MakeSquare(s1, [N, C, 'diagonal']):
point(M, (3 - sqrt(5))/(2*sqrt(5) - 2), (3 - sqrt(5))/(2*sqrt(5) - 2)):
point(P, (1 + sqrt(5))/(2*sqrt(5) - 2), (3*sqrt(5) - 5)/(2*sqrt(5) - 2)):
T:=<simplify(coordinates(midpoint(O1,E,B))-coordinates(midpoint(O2,M,P)))>:
simplify(distance(O1,O2)):
line(MN,[M,N]):eq:=Equation(%,[x,y]):sol:=solve(eq,y):
Ang:=Pi/2-arctan(diff(sol,x)):
r:=simplify(distance(N,M)):
line(MP,[M,P]):eq:=Equation(%,[x,y]):subs(y=0,%):point(Q,solve(%,x),0):
line(PQ,[P,Q]):
homology(Sq1, Sq, C, Ang, 'clockwise', r):

display(draw([A(color = black, symbol = solidcircle, symbolsize = 12),
B(color = black, symbol = solidcircle, symbolsize = 12),
C(color = black, symbol = solidcircle, symbolsize = 12),
E(color = black, symbol = solidcircle, symbolsize = 12),
N(color = black, symbol = solidcircle, symbolsize = 12),
Sq(color = red, filled = true, transparency = 0.9),
BE(color = green),
PQ(color = black),
Sq1(color = black),
s1(color = red, filled = true, transparency = 0.8)]),
textplot([[coordinates(A)[], "A"],
[coordinates(B)[], "B"],
[coordinates(E)[], "E"],
[coordinates(N)[], "N"],
[coordinates(P)[], "P"],
[coordinates(M)[], "M"],
[coordinates(Q)[], "Q"],
[coordinates(C)[], "C"]],
align = [above, right]), view = [-0.6 .. 1.5, 0 .. 1], axes = none);

## How to plot Iso-Lines from a set of values with co...

Hi,

I am struggling with a task of creating a 2D contourplot of temperature values showing Iso-Lines (lines of equal temperatures in steps of 100°C).

I have a set of temperature values with corresponding x and y coordinates of a cross section. The data is given as an unsorted set of X-Y-Temperature 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],...]

I can plot the data as a 3D pointplot and assign colors based on the temperature value:

plots:-pointplot3d(<ThermRes(2 .. (), 2) | ThermRes(2 .. (), 3) | ThermRes(2 .. (), TimeCol)>, colorscheme = ["zgradient", ["blue", "green", "yellow", "orange", "red"]], style = point, symbol = solidsphere, symbolsize = 20)

For better visualization, I would like to plot this data in a 2D contourplot showing coloured Iso-lines in 100°C steps, similar to the following scheme:

I know this is not directly possible from xyz datapoints. Therefore, I was trying to create an interpolation function using the Interpolation package. I have tried to find out if it is possible to get a working interpolation function for my data, but it seems like the x and y coordinates must be always in increasing order and there has to be a z value (temperature data point) for each pair of coordinates in matrix form, is that correct? Unfortunately, as you can see above, my x-y coordinate pairs are irregular and unsorted and I do not have a temperature value for every combination of x and y coordinate values.

Is there any way how to find an interpolation function for this kind of data that would enable a contourplot? Or any other ideas how to create a coloured 2D plot from this data with a legend showing the 100°C temperature color values?

Greetings, Oliver

## ode system is singular at the initial point...

Could you help me how to deal with this problem?

 > restart;
 > with(plots):with(plottools):with(DETools):
 >
 > Sys:=diff(T(R),R)=((1-1/R)*(sqrt(1-(alpha/R)^2*(1-1/R))))^(-1),diff(Phi(R),R)=(alpha/R)^2*(sqrt(1-(alpha/R)^2*(1-1/R)))^(-1);
 (1)
 >
 > inits:=[[T(0)=0.5,Phi(0)=0],[T(0)=0.5,Phi(0)=Pi/4]];
 (2)
 > K:=dsolve([Sys,op(op(1,inits))],[Phi(R),T(R)],numeric,parameters=[alpha],output=listprocedure);
 >

## dsolve Error in 1st argument...

Hi

I get the following error: "Error, (in dsolve) invalid input: 'PDEtols/sdsolve' expects its 1st argument, SYS, to be of type OR(set(..."

I don't know what's wrong. My equations look like a set to me.

My equations:

My solve:

Anyone can tell me what I'm doing wrong?

clutch.mw

## Root finder for the fourth power polynomial...

Could you help me to solve this problem for the parameter beta?

 > restart;
 > e1:= 0.5; e2:=0.2;theta:=5;yeq:=e2;
 (1)
 > f:=(theta*x-1)*(1-x)*(1+beta*x^2)-y; g:=x/(1+beta*x^2); gs:=unapply(g,x);
 (2)
 > fs:=subs(y=yeq,f);
 (3)
 > assumptions:=x>1/theta, x<1,beta>0,beta<1,gs(x)>e1; solve(fs=0,x,useassumptions) assuming assumptions;
 > gs2:=subs(beta=0.6,gs(x));
 (4)
 > sol:= solve(subs(beta=0.6,fs=0),x,useassumptions) assuming x>1/theta, x<1;
 (5)
 > subs(x=sol[1],gs2);
 (6)
 >

## how to calculate this sum correctly...

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

S2 + S3 + S4 + S5 + S6;
for i to 5 do
S*[i] + S[i + 1];
end do;
Thank you.

## How to create a loop in Physics package with one ...

I am trying to create a loop in the Physics package where I am interested in looking at the components of a tensor with one index up and one down. However, when I run the loop it returns the expression with both indices down in my attempts to solve the issue.

I have been fighting with it for an hour now and cant seem to find a fix. Any help will be appreciated, I have attached the file I am working with.

LoopQuestion.mw

## Check positivity...

Why did the last line is(ysol2[1]>0) give false?

Maple does not recognize the assumption?

 > restart;
 >
 >
 > interface(showassumed=0);
 (1)
 > assume(theta>1,alpha>0,sigma1>0,beta>0,sigma2>0,delta>0,x>0,y>0,z>0);
 >
 > f:=((theta*x-1)*(1-x)-y); g:=y/(1+beta*y^2); h:=(alpha*x-sigma1)*(1+beta*y^2); j:=(delta*g-sigma2); dxdt:=x*f; dydt:=g*(h-z); dzdt:=z*j;
 (2)

 > E0:=<0,0,0>;
 (3)

 > xsol1:=solve(h=0,x) assuming x>1/theta and x<1; ysol1:=solve(subs(x=xsol1,f)=0,y)assuming xsol1>1/theta and xsol1<1; E1:=;
 (4)

 > ysol:=[solve(j=0,y)]; ysol2:=simplify(subs(sigma2=delta*eta,ysol)) assuming (1-4*beta*eta^2>0 and eta>0);
 (5)
 > is(ysol2[1]>0)
 (6)
 >
 (7)
 >
 >

## Are there any bugs in eval['recurse'], applyrule, ...

The command for doing syntactical exact-match substitutions is subs, however, subs applies transformation rules throughout an expression only once. The documentation of eval claims that the (recursive) evaluation is repeated until either the result does not change, the documentation of applyrule claims that applyrule … applies the rules until no rule can be applied any more, and the documentation of MmaTranslator[Mma][ReplaceRepeated] claims that the single ReplaceRepeated command performs replacements until expression no longer changes.
So, if I comprehend correctly,

```restart;
x := [[[[]]]]: # Remove empty lists from x repeatedly.
(*⒈*) eval['recurse'](x, [[] = 'NULL']);
(*⒉*) applyrule([[] = 'NULL'], x);
(*⒊*) MmaTranslator:-Mma:-ReplaceRepeated(x, [[] = NULL])
```

should all return `NULL`, but in fact,

```eval['recurse'](x, [[] = 'NULL']);
=
[[[[]]]]

applyrule([[] = 'NULL'], x);
Error, (in PatternMatching:-AlgStruct:-TableLookup) invalid input: unknown uses a 1st argument, x, which is missing
MmaTranslator:-Mma:-ReplaceRepeated(x, [[] = NULL]);
=
() = ()

```

In other words, none of these replacements is feasible.

Have I missed something? (It seems to me that an explicit procedural `do...until` loop can be actually avoidable here!)

## How to plot vector fields?...

 > restart;
 > with(Physics):with(plots):with(DETools):
 > sys := {diff(r(t),t)=p(t)/m, diff(p(t),t)=l^2/(m*r(t)^3)-n*k*r(t)^(n-1), diff(phi(t),t)=l/(m*r(t)^2)};
 (1)
 > sys1:=subs({n=1,k=1},sys);
 (2)
 > conv:=plottools:-transform((a,b)->[a*cos(b),a*sin(b)]):
 > p1:=DEplot(sys1,[r(t),phi(t)],t=0..30,r=0..10,phi=0..2*Pi,stepsize=0.01);
 > plots:-display([conv(p1)],axiscoordinates=polar);
 >

Could you help how to fix the code?

## Maple keep freezing...

I just downloaded maple 2021 (I get i free from my school). I used maple for the last 4 years but, now when i opdatede to maple 2021 from version 2020, its just keep freezing i have try to uninstall 3 times by now and it still keep freezing.

## DEplot for polar coordinates...

What should I fix my code in order to work?

## unevaluated/inert Matrix-Vector product?...

Can Maple carry around an unevaluated/inert  Matrix-Vector product(A matrix product without executing the matrix multiplication)? See Maple sheet.

inert_matrix_products.mw

Can Maple carry around an unevaluated/inert explicit Matrix-Vector product?

Define a matrix K and vector U as:

 (1)

 (2)

I can take their product using MatrixVectorMultiply( ) I get,

 (3)

however output I am really looking for is

In the later case,  is still a product however the actual matrix multiplication is not carried out. Sure, eventually I will want to evaluate the matrix-vector product but sometimes when setting up a problem I want to look at the explicit matrix equation before any explicit matrix multiplication is carried out.

Here I show some ideas that don't work but may give a sense of what I am going for. I am essentially trying to mute the computation of the product while keeping the elements of the product together for further substitutions elsewhere. This there a standardized way to complish this? Or do I have to write my own procedure for something like this?

 (4)

 (5)

 (6)

 (7)

After a long hiatus I have come back to the issue of null tetrads in the physics package in light of the updates to  Maple in 2021. I have uploaded a document file to illustrate. See below. My first question concerns the labelling of elements of a null tetrad. After calling the metric 27,37 from Stephani et al, and using Setup to specify a null tetrad, Maple's choice is such that the elements labelled m and bar m are not complex. Rather, both these elements are in fact real, while the elements lablled l and n are complex, with one being the negative complex conjugate of the other. While these are just labels, they don't agree with the usual conventions for the Newman-Penrose formalism, which is disorienting. What convention is Maple using to label the elments of a null tetrad?

Next, I try to specify the null tetrad used by Stephani et al., first by converting it into covariant form (which I did by hand rather than in Maple). In Maple's default null tetrad, the order in which Maple listed the elements of the null tetrad is n, m, bar m, l (as rows in the matrix display for e_[ ]), so I followed that convention (in the conventions of Stephani et al., the first and fourh element should have scalar product -1, the second and third scalar product 1, and all other scalar products zero, which is the case). After entering the matrix and using Setup to specify the null tetrad by the matrix, I get an error message saying that the components of the metric with respect to my tetrad are not just 0, 1, and -1. Yet,  executing eta_[ ]  does not confirm this warning; nor does a computation by hand.

Finally, IsTetrad asserts the tetrad is not null, contrary to the fact that it is a null tetrad.

Since I have followed the conventions implicit in Maple's default null tetrad for this metric, I am puzzled as to what has gone wrong.SKMHH27_37_2021_New.mw

On the other hand, taking into account how Maple 2019 orders the coordinates in Stephani et al 27.37 and labels the null vectors in a null ttetrad, if I translate accordingly what I have in the 2021 Maple file, Maple 2019 confirms Stephani et al.'s null tetrad is indeed a null tetrad, as one would expect. See the following file.SKMHH27_37_2019_Var.mw.

## Why can a function evaluate a variable local to an...

Consider this example:

```    h := proc(x)         printf("h says: %a evaluates to %a.", x, eval(x));     end proc:     f := proc()         local z, g;         g := proc(x)             printf("g says: %a evaluates to %a.\n", x, eval(x));         end proc;         z := 2;         g('z');         h('z');     end proc:```

```    > f()     g says: z evaluates to 2.     h says: z evaluates to 2.```

I can't figure out, whats going on here. Now it comes as no surprise, of course, that g would be able to see z. After all, its definition is within the lexical scope of z. But how can h possibly see z?

When eval is called in h, does eval somehow look into the call stack, and find out it was called by h, which was in turn called by f and then inspect the local variables of f?

Could you explain, what's going on here, please?

Thank you all!

 5 6 7 8 9 10 11 Last Page 7 of 38
﻿