Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

This is still a  starting procedure and let's see what can be added?

restart;
# Define the procedure to draw a cylinder along the x-axis and a specifically positioned plane
CylinderAndPlane := proc(r, h, alpha_deg, beta_deg, P, axis_length)
    local alpha, beta, cylinder, plane, pointPlot, display, nx, ny, nz, px, py, pz, annotations, plane_type, titleStr, grafiek;  # Added: titleStr
    uses plots, LinearAlgebra;  
    # Convert angles from degrees to radians
    alpha := alpha_deg * Pi / 180;
    beta := beta_deg * Pi / 180;

    # Determine the normal vector based on angles
    nx := cos(alpha) * sin(beta);
    ny := sin(alpha) * sin(beta);
    nz := cos(beta);

    # Point P is directly used as given coordinates
    px, py, pz := op(P);

    # Cylinder along the x-axis
    cylinder := plots:-implicitplot3d(y^2 + z^2 = r^2, x = 0 .. h, y = -r .. r, z = -r .. r, style = surface, color = "LightBlue", transparency = 0.5);

    # Determine the type of plane based on angles alpha and beta
    if beta_deg = 90 then
        plane_type := "yz";
        plane := plots:-implicitplot3d(x = px, x = px - 10 .. px + 10, y = -axis_length .. axis_length, z = -axis_length .. axis_length, style = surface, color = "Yellow", transparency = 0.5);
    elif alpha_deg = 90 and beta_deg = 0 then
        plane_type := "xz";
        plane := plots:-implicitplot3d(y = py, x = -axis_length .. axis_length, y = py - 10 .. py + 10, z = -axis_length .. axis_length, style = surface, color = "Green", transparency = 0.5);
    elif beta_deg = 0 then
        plane_type := "xy";
        plane := plots:-implicitplot3d(z = pz, x = -axis_length .. axis_length, y = -axis_length .. axis_length, z = pz - 10 .. pz + 10, style = surface, color = "Blue", transparency = 0.5);
    else
        plane_type := "arbitrary";
        plane := plots:-implicitplot3d(nx * (x - px) + ny * (y - py) + nz * (z - pz) = 0, x = -axis_length .. axis_length, y = -axis_length .. axis_length, z = -axis_length .. axis_length, style = surface, color =            "Red", transparency = 0.7);
    end if;

    # Mark point P
    pointPlot := plots:-pointplot3d([px, py, pz], symbol = solidcircle, symbolsize = 10, color = "Red");

    # Create dynamic title - New
    titleStr := cat("Plane: ", plane_type, "\nAlpha: ", sprintf("%.2f", alpha_deg), " deg\nBeta: ", sprintf("%.2f", beta_deg), " deg\nPoint: [", sprintf("%.2f", P[1]), ", ", sprintf("%.2f", P[2]), ", ", sprintf("%.2f", P[3]), "]");

    # Display everything together - Modified: titleStr added in the display function
    grafiek := plots:-display(cylinder, plane, pointPlot, axes = normal, scaling = constrained, labels = ["x", "y", "z"], title = titleStr);

    return grafiek;
end proc:

# Example call to the procedure with coordinates of P and setting the axis length
# Alpha and Beta are now angles in degrees, P is a list of coordinates, axis_length is the length of the coordinate axes
CylinderAndPlane(15, 50, 0, 90, [15, 5, 5], 30);  # For yz-plane
#CylinderAndPlane(5, 15, 90, 0, [5, 5, 5], 10);  # For xz-plane
#CylinderAndPlane(5, 15, 0, 0, [5, 5, 5], 10);   # For xy-plane
#CylinderAndPlane(5, 55, 45, 45, [5, 5, 5], 10); # For arbitrary plane

 
 

 

Download maple_primes_-doorsnijdingsvlak_solids_procedureDEF.mw

I am stuck this command works seemlessly in Maple:

ThermophysicalData:-CoolProp:-Property(D, T = 20*Unit('degC'), P = 760*Unit('mmHg'), water)

but it does not work in Maple Flow. Does anyone knows why? Thank you so much for your help in the matter.

Hello :) 

I have a math problem, where I first need to use Linear regression to find the equation based on a set of data. I did that, no problem. 

However, in the next part of the problem I need to check if the residuals are under "normal distribution". Usually, I check if a dataset is normally distributed via "QQ-plot", and there will be no problems. But this time, because I need to check the residuals, I need to use the "residualQQplot(data,LinReg)" command to make it happen. But when I read the mean-value, mu, it says "-0," and nothing else? I know it should be "-3,2752*10^-15. 

The standard deviation is correct.

How do I fix this, so the residualQQplot shows me the right result? 

I have attached the worksheet here. worksheet_-_linear_reg_and_residuals_for_normal_distribution.mw

Thank you! 

I can't understand this behavior. Any idea why it happens?

Solve is able to solve equation   f(y)=x+A for y, but can't solve   f(y)=x for y.

This is unexpected for me. I do not see why it can solve it when RHS is x+A but not when RHS is just x.


 

21040

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1745. The version installed in this computer is 1744 created 2024, April 17, 19:33 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

restart;

21040

sol:=int(1/sqrt(sin(y)),y);
solve(sol=x,y)

(sin(y)+1)^(1/2)*(-2*sin(y)+2)^(1/2)*(-sin(y))^(1/2)*EllipticF((sin(y)+1)^(1/2), (1/2)*2^(1/2))/(cos(y)*sin(y)^(1/2))

Warning, solutions may have been lost

sol:=int(1/sqrt(sin(y)),y);
solve(sol=x+b,y):
{%}; #to eliminate duplicates

(sin(y)+1)^(1/2)*(-2*sin(y)+2)^(1/2)*(-sin(y))^(1/2)*EllipticF((sin(y)+1)^(1/2), (1/2)*2^(1/2))/(cos(y)*sin(y)^(1/2))

{arctan(JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2-1, -(1/2)*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))*(4-2*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2)^(1/2)*2^(1/2)), arctan(JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2-1, (1/2)*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))*(4-2*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2)^(1/2)*2^(1/2))}

 


I can trick it to solve  f(y)=x for y  by asking it to solve f(y)=x+A for y and then set A=0 in the solution. But one should not have to do this. Is this a bug or Am I missing something?

Download why_solve_when_adding_term_only_may_22_2024.mw

Hi,

I'm trying out the 2024 version of Maple and I'm getting the following warning message:

Warning, not a built-in function (`rtable_alias`)

which I didn´t get for the 2023 version. I have no clue where it is coming from since it happens even when I start a new worksheet:

 

 

I've also attached print outs of the same worksheets (from Maple help examples and from Maple Portal), one using Maple 2023 version and the other one using Maple 2024 version so youcould see the warning and some other problems.

I really appreciate if someone would have an idea of what is going on here. Thanks very much in advance.

interpolation_2023.pdf

interpolation_2024.pdf

optimization_2023.pdf

optimization_2024.pdf

Multiplaction "dot" in Maple 2022 is way too small - causes errors.

e.g. two variables multiplied s*m ends up being sm a new variable as I cannot really see that there is a missing multiplication operator between the variables. This causes huge unnecessary errors.

Maple 9.x e.g had nice clear and big operators and this kind of error was avoided.

How can I undo this unfortunate regression in Maple 2022 to increase the size of multiplication operator and other operators, so that they actually becom visible and not just a little dot almost a pixel in size.

If I was a falcon (20x20)^infinity then this would have been ok, but I am not, I am human.

So how do I change this unfortunate regression so that these errors can be avoided.?

See attached worksheet in Maple 2023.

This example is taken from the Maple help page. I want to 'zoom in' on a plot3d object. The only way I have found was from responses [1] on the maple primes forum. It uses InlinePlot and the scale option to perform the 'zoom in'. Since InlinePlot generates the plot in terms of XML there is no graphic out, only a text based output. In order to reconstitute the InlinePlot as a plot object I can view visually I need to use some additional commands from the DocumentTool package. This is all great but the output, which in our case is P3, is not a plot object and therefore cannot be exported as a png. Is there a way to convert the InlinePlot with the scaling applied back to a typical plot object so I can export it as a .png, using Export("output_plot.png",P3,base=worksheetdir)?

can_I_convert_InlinePlot(P3)_back_to_a_regular_plot_object_so_I_can_export_it_as_a_png.mw

When I try to contract the tensor with connection, maple encounters such promble:

Error, (in DifferentialGeometry:-Tensor:-ContractIndices) expected 2nd argument to be a tensor. Received: _DG([["connection", O, [["con_bas", "cov_bas", "cov_bas"], []]], [`...`]])

The expression is Cacd Hab

Could someone help me understand why Maple hangs solving these two equations when the names of unknowns is c__1,c__2   or the old _C1, _C2?

This worksheets shows this. I had to put timelimit of 90 seconds, else it hangs may be forever.    

This example came from looking at why Maple seems to hang randomly when I run the same problem. I still do not know why, but is seems to have something to do with the use of  lower case c__1 or _C1. 

16020

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1744 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

restart;

dsolve(diff(y(x),x$9)=1,arbitraryconstants=subscripted);

y(x) = (1/362880)*x^9+(1/40320)*c__1*x^8+(1/5040)*c__2*x^7+(1/720)*c__3*x^6+(1/120)*c__4*x^5+(1/24)*c__5*x^4+(1/6)*c__6*x^3+(1/2)*c__7*x^2+c__8*x+c__9

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*c__1)*sqrt(2)/sqrt(c__1))*sqrt(2)/sqrt(c__1) = c__2, 1 = (-exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)*sqrt(c__1)*sqrt(2)/(exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)];
unknowns:=[c__1,c__2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*c__1)^(1/2)*2^(1/2)/c__1^(1/2))*2^(1/2)/c__1^(1/2) = c__2, 1 = (-exp(2*c__2*c__1^(1/2)*2^(1/2))+1)*c__1^(1/2)*2^(1/2)/(exp(2*c__2*c__1^(1/2)*2^(1/2))+1)]

[c__1, c__2]

.609

Error, (in evalf/hypergeom) time expired

106.125

restart; #try again but do not do the arbitraryconstants=subscripted now.

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*c__1)*sqrt(2)/sqrt(c__1))*sqrt(2)/sqrt(c__1) = c__2, 1 = (-exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)*sqrt(c__1)*sqrt(2)/(exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)];
unknowns:=[c__1,c__2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*c__1)^(1/2)*2^(1/2)/c__1^(1/2))*2^(1/2)/c__1^(1/2) = c__2, 1 = (-exp(2*c__2*c__1^(1/2)*2^(1/2))+1)*c__1^(1/2)*2^(1/2)/(exp(2*c__2*c__1^(1/2)*2^(1/2))+1)]

[c__1, c__2]

106.234

[[]]

106.390

#see? it finisghed instantly now.


Download why_solve_hangs_with_subscripted_may_15_2024.mw

The same thing happens If I use the old _C1 and _C2 instead of c__1 and c__2. It also hangs. 

The following worksheet shows this.  If I change _C1 and _C2 to other symbols, say C1 and C2, then it does not hang. 

Why the names of the unknowns makes difference to solve?
 

18792

restart;

18792

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*_C1)*sqrt(2)/sqrt(_C1))*sqrt(2)/sqrt(_C1) = _C2, 1 = (-exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)*sqrt(_C1)*sqrt(2)/(exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)];
unknowns:=[_C1,_C2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*_C1)^(1/2)*2^(1/2)/_C1^(1/2))*2^(1/2)/_C1^(1/2) = _C2, 1 = (-exp(2*_C2*_C1^(1/2)*2^(1/2))+1)*_C1^(1/2)*2^(1/2)/(exp(2*_C2*_C1^(1/2)*2^(1/2))+1)]

[_C1, _C2]

.125

Error, (in evalf/cos) time expired

105.218

restart;

18792

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*C1)*sqrt(2)/sqrt(C1))*sqrt(2)/sqrt(C1) = C2, 1 = (-exp(2*C2*sqrt(C1)*sqrt(2)) + 1)*sqrt(C1)*sqrt(2)/(exp(2*C2*sqrt(C1)*sqrt(2)) + 1)];
unknowns:=[C1,C2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*C1)^(1/2)*2^(1/2)/C1^(1/2))*2^(1/2)/C1^(1/2) = C2, 1 = (-exp(2*C2*C1^(1/2)*2^(1/2))+1)*C1^(1/2)*2^(1/2)/(exp(2*C2*C1^(1/2)*2^(1/2))+1)]

[C1, C2]

105.312

[[]]

105.468

 

 

Download why_solve_hangs_with_OLD_C_also_may_15_2024.mw

Only thing I see in help related to name of symbols to solve for is this:

The solve command solves one or more equations or inequalities for the specified unknowns. The unknowns may be names, including indexed names (though for efficiency reasons, indexed names should be avoided when possible), 

ps. This looks like a bug to me. So I send bug report to Maplesoft support also.

 

pps. I tried this in Maple 2023 and Maple 2022 and same behavior. Could someone with earlier version of Maple try to see if this behavior was there also?   It can possibly be correct that the choice of letter used makes difference for solving equations. I have to use c__1 and c__2 etc.. since these equations come from differential equations and this is what I use for constants of integrations., Otherwise I have to make lots of changes now to use different letters.

Update

did trace on solve using _C1 and _C2 and then using A,B for variables to solve for. Code flow is different. This expalins why it hangs. The flow starts the same until it gets to 

TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order

Then when using _C1 and _C2 the code goes into different path than when using A,B. 

Here is flow when using _C1,_C2.

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*_C1)*sqrt(2)/sqrt(_C1))*sqrt(2)/sqrt(_C1) = _C2, 1 = (-exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)*sqrt(_C1)*sqrt(2)/(exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)];
unknowns:={_C1,_C2};
time();
infolevel[solve]:=5;
C_sol:=[timelimit(60,solve(eqs,unknowns))]; 
time()


Main: Entering solver with 2 equations in 2 variables
Main: attempting to solve as a linear system
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Transformer:   solving for linear equation in _X000001
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 3 equations and 2 inequations in 3 variables
Dispatch: dispatching to Exponentials handler
Transformer:   solving for linear equation in _S000004
Recurse: recursively solving 3 equations and 3 inequations in 4 variables
Dispatch: dispatching to Rename handler
Dispatch: renaming _S000005 = arctanh(1/2*_S000002*RootOf(_Z^2-2,index = 1)/_S000001)
Recurse: recursively solving 3 equations and 3 inequations in 5 variables
Dispatch: handling polynomials of the form a*x^n-b
Dispatch: dispatching to PolynomialSystem handler
Main: polynomial system split into 1 parts under preprocessing
Main: using RegularChains based methods
SolverVariableOrder: using the variable order  _S000003 > _X000002 > _S000005 > _S000002 > _S000001
TriangularDecomposition: using deterministic algorithm for decomposition
TriangularDecomposition: decomposition successfully found 1 components
TriangularDecomposition: backsubstituting to form solutions
TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order
Transformer:   solving the uncoupled linear subsystem in {_S000003, _X000002}
Linear: solving 2 linear equations
Polynomial: # of equations is: 2
Polynomial: best equation / unknown _S000005*_z1 _X000002 2*_S000001
Polynomial: # of equations is: 1
Polynomial: best equation / unknown -_z1*_S000001+1 _S000003 _z1*_S000001+1
Polynomial: backsubstitution at: 2
Polynomial: backsubstitution at: 1
Main: polynomial system split into 1 parts under preprocessing
Main: subsystem is essentially univariate
UnivariateHandler: subsystem has only one equation
UnivariateHandler: solving as if univariate in _S000002
Recurse: recursively solving 1 equations and 0 inequations in 1 variables
Dispatch: dispatching to OnlyIn handler
Transformer:   solving for linear equation in _S000006
Recurse: recursively solving 1 equations and 0 inequations in 1 variables
Transformer:   solving the uncoupled linear subsystem in _S000006
Recurse: recursively solving 1 equations and 1 inequations in 1 variables
Transformer:   solving the uncoupled linear subsystem in t
Error, (in evalf/hypergeom) time expired

 

This is trace when using A,B

 

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*A)*sqrt(2)/sqrt(A))*sqrt(2)/sqrt(A) =B, 1 = (-exp(2*B*sqrt(A)*sqrt(2)) + 1)*sqrt(A)*sqrt(2)/(exp(2*B*sqrt(A)*sqrt(2)) + 1)];
unknowns:={A,B};
time();
infolevel[solve]:=5;
C_sol:=[timelimit(90,solve(eqs,unknowns))]; 
time()


Main: Entering solver with 2 equations in 2 variables
Main: attempting to solve as a linear system
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Transformer:   solving for linear equation in A
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 3 equations and 2 inequations in 3 variables
Dispatch: dispatching to Exponentials handler
Transformer:   solving for linear equation in _S000004
Recurse: recursively solving 3 equations and 3 inequations in 4 variables
Dispatch: dispatching to Rename handler
Dispatch: renaming _S000005 = arctanh(1/2*_S000002*RootOf(_Z^2-2,index = 1)/_S000001)
Recurse: recursively solving 3 equations and 3 inequations in 5 variables
Dispatch: handling polynomials of the form a*x^n-b
Dispatch: dispatching to PolynomialSystem handler
Main: polynomial system split into 1 parts under preprocessing
Main: using RegularChains based methods
SolverVariableOrder: using the variable order  _S000003 > B > _S000005 > _S000002 > _S000001
TriangularDecomposition: using deterministic algorithm for decomposition
TriangularDecomposition: decomposition successfully found 1 components
TriangularDecomposition: backsubstituting to form solutions
TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order
Main: polynomial system split into 1 parts under preprocessing
Main: applying the solver for domain=absolute, engine=traditional
PseudoResultant: 225530 [1 200002087 _S000001] 3 3 151 2 45 0
PseudoResultant: 120059 [2 200004772 _S000003] 2 2 131 0 3 0
PseudoResultant: 134507 [1 700002396 _S000002] 1 1 53 0 3 0
PseudoResultant: -10 [] 0 0 3 0 3 0
PseudoResultant: 1 solutions found, now doing backsubstitution
PseudoResultant: backsubstitution of _S000002
PseudoResultant: backsubstitution of _S000003
PseudoResultant: backsubstitution of _S000001
SolutionsLost: setting solutions lost flag
Main: solving successful - now forming solutions
Main: Exiting solver returning 0 solutions

solve: Warning: no solutions found

 

 I can't achieve this using StringTools:-RegSplit. The StringTools,Regular_Expressions documentation doesn't seem to address these functionalities.

My goal is to split the string at the occurences of "." that are somewhere between "]" and "["* yet not enclosed between the two digits, and to ignore all other occurences of "."

This is new:

Maple 2024 frozen on opening recent files

Maple 2023 frozen on opening

Maple 2022 frozen on opening start page

Maple 2021 blinking

Maple 2020 opening start page

The above system state is constant for about 30 min. Maple sessions without start page are working. I can enter code but file opeing and saving does not work. The fact that Maple 2020 is also not working makes it unlikely that the Java environement is part of the problem.

I have several times restarted the system. The rest of the system is working.

Something happened to the system and I have no clue what is was and what I can do about it.

Any ideas or suggestions what I could try? Windows 10.

How can I get the evaluation of integration inside if-statement?

Thanks for your help in advance,

restart;

#L:=1:sigma:=0.01:beta:=0.2:k0:=-100:

#For Free particle
Projectile := proc({L:=1,sigma:=0.01,beta:=0.2,k0:=-100},n_max) local x0,g,c:
 x0:= beta*L;
 g := unapply(exp(-(x-x0)^2/2/sigma^2),x);
 #c := int(g(x)^2,x=-L/2..L/2,numeric=true);
 ub := (L/2-x0)/sqrt(2)/sigma;
 lb := (-L/2-x0)/sqrt(2)/sigma;
 a := Pi*sqrt(2)*sigma/L;
 b := sqrt(2)*k0*sigma;
 c := Pi*x/L;
 d := k0*x0;
 eq1 := [cos(a*n*z)*cos(b*z)/e^(z^2),cos(a*n*z)*sin(b*z)/e^(z^2),sin(a*n*z)*cos(b*z)/e^(z^2),sin(a*n*z)*sin(b*z)/e^(z^2)];
 eq1 := map(f->unapply(f,n,z),eq1);
 eq2 := [cos(n*c)*cos(d),cos(n*c)*sin(d),sin(n*c)*cos(d),sin(n*c)*sin(d)];
 eq2 := map(f->unapply(f,n,z),eq2);

 for j from 1 to n_max do:
   if (is(j,odd)) then eq11 := int(eq1[1](j,z),z=lb..ub,numeric=true);
   else 0;
   end if;
 end do:

end proc:

 

Warning, (in Projectile) `ub` is implicitly declared local

 

Warning, (in Projectile) `lb` is implicitly declared local

 

Warning, (in Projectile) `a` is implicitly declared local

 

Warning, (in Projectile) `b` is implicitly declared local

 

Warning, (in Projectile) `d` is implicitly declared local

 

Warning, (in Projectile) `eq1` is implicitly declared local

 

Warning, (in Projectile) `eq2` is implicitly declared local

 

Warning, (in Projectile) `j` is implicitly declared local

 

Warning, (in Projectile) `eq11` is implicitly declared local

 

Projectile(1);

int(cos(0.4442882938e-1*z)*cos(1.414213562*z)/e^(z^2), z = -49.49747467 .. 21.21320343)

(1)

 


Download SolnforProjectile_v3_3.mw

restart;
with(geometry);
with(plots);
_EnvHorizontalName := 'x';
_EnvVerticalName := 'y';
cb := color = blue;
t3 := thickness = 3;
l3 := linestyle = 3;
xA := 3;
yA := 0;
xB := -3;
yB := 0;
c := 6;
point(A, xA, yA);
point(B, xB, yB);
R := 5;
alpha := arctan(3/4);
evalf(%*180/Pi);
                          36.86989765

xH := (xA + xB)/2;
yH := (yA + yB)/2;
point(H, xH, yH);
xO1 := 0;
yO1 := 4;
point(O1, xO1, yO1);
xO2 := 0;
yO2 := -4;
point(O2, xO2, yO2);
segment(sAB, A, B);
segment(sHO, H, O1);
segment(sAO, A, O1);
segment(sBO, B, O1);
                              sAB

alpha1 := arctan((yO1 - yA)/(xO1 - xA));
beta := Pi + arctan((yO1 - yB)/(xO1 - xB));
AR1 := plottools[arc]([xO1, yO1], R, alpha1 .. beta, l3);
AR2 := plottools[arc]([xO2, yO2], R, -beta .. -alpha1, l3);
N := 80;
dt := (beta - alpha1)/(N - 1);
dr := draw({O1, O2, sAB, sHO, sAO(cb), sBO(cb)});
tex := textplot([[xA, yA - 0.5, "A"], [xB, yB - 0.5, "B"], [xO1, yO1 + 0.5, "O1"], [xO2, yO2 - 0.5, "O2"], [xH, yH - 0.5, "H"]]);
M1 := seq(plottools[disk]([R*cos(dt*t + alpha1) + xO1, R*sin(dt*t + alpha1) + yO1], 0.2, color = orange), t = 0 .. N);
M2 := seq(plottools[disk]([R*cos(dt*t + Pi + alpha1) + xO2, R*sin(dt*t + Pi + alpha1) + yO2], 0.2, color = orange), t = 0 .. N);
P1 := seq(plottools[polygon]([[R*cos(dt*t + alpha1) + xO1, R*sin(dt*t + alpha1) + yO1], [xA, yA], [xB, yB]], color = aquamarine, linestyle = dash), t = 0 .. N);
P2 := seq(plottools[polygon]([[R*cos(dt*t + Pi + alpha1) + xO1, R*sin(dt*t + Pi + alpha1) + yO1], [xA, yA], [xB, yB]], color = aquamarine, linestyle = dash), t = 0 .. N);
for t to N do
    E[t] := display(dr, tex, AR1, AR2, M1[t], P1[t]);
    F[t] := display(dr, tex, AR1, AR2, M2[t], P2[t]);
end do;
display([seq(E[t], t = 1 .. N), seq(F[t], t = 1 .. N)], insequence = true, axes = none, scaling = constrained, view = [-10 .. 10, -10 .. 10]);

NULL;
angle that does not turn on the lower arc. Thank you.

OS Linux

I have Maple 2022 open with a worksheet on a specific workspace.

I then move to a different workspace and want to start a new instance of maple for a new problem.

In command line I exacute

$]xmaple22 –standalone  filename.mw

Unfortunately when the new instance is started, the open maple instance on the first workspace is moved automatically to the second workspace together with the new instance opened, completely messing up the organization.

This is not expected behavior.

How can I make Maple execute absolutely independent instances of xmaple22 without indiscressionately and automatically moving existing open maple instances to the current workspace.

Severely annoying. Maple 9.5 e.g. does not have this behavior at all so Maple 2022 is a step backwards in this regard.

Thanks

I want to rescale a projective vector. Have been using gcd on the numerators and denominators. This works in simple situations. It doesn;t work well here, admitadely the points have been just made up for the question.  Square roots seem to make it mal-preform. I run into a lot of squate roots in symbolic situations. What would be a better way? I have been wondering if frontend would help?

restart

Prntmsg::boolean:=true;
Normalise_Projective_Point:=1;
ReScl::boolean:=true;

true

 

1

 

true

(1)

 

ProjLP:=overload([

      proc(A::Vector[row],B::Vector[row],prnt::boolean:=Prntmsg)
      description "2 projective points to create a projective line vector";
      option overload;
      local Vp ,gcdn,gcdd,vp ;
      uses LinearAlgebra;
       
      Vp:=CrossProduct(A,B)^%T;#print("2nd ",Vp);
      if ReScl then
         gcdn := gcd(gcd(numer(Vp[1]),numer(Vp[2])), numer(Vp[3]));
         gcdd := gcd(gcd(denom(Vp[1]),denom(Vp[2])), denom(Vp[3]));
         Vp:=simplify(Vp*gcdd/gcdn);
      end if;
      if Prntmsg then
         print("Line vector from two projective points. " );
      end if;
      return Vp
      end proc,



      proc(A::Vector[column],B::Vector[column],prnt::boolean:=Prntmsg)
      description "2 lines to get intersection projective point";
      option overload;
      uses LinearAlgebra;
      local  Vp;
    
      Vp:=CrossProduct(A,B)^%T;
     
     
      if Vp[3]<>0 and Normalise_Projective_Point<>0 then
           Vp:=Vp/Vp[3];
      end if;
      if Prntmsg then
           print("Meet of two Lines ");
      end if;
      return Vp
   end proc
     
]);

 

proc () option overload; [proc (A::(Vector[row]), B::(Vector[row]), prnt::boolean := Prntmsg) local Vp, gcdn, gcdd, vp; option overload; description "2 projective points to create a projective line vector"; Vp := LinearAlgebra:-CrossProduct(A, B)^%T; if ReScl then gcdn := gcd(gcd(numer(Vp[1]), numer(Vp[2])), numer(Vp[3])); gcdd := gcd(gcd(denom(Vp[1]), denom(Vp[2])), denom(Vp[3])); Vp := simplify(Vp*gcdd/gcdn) end if; if Prntmsg then print("Line vector from two projective points. ") end if; return Vp end proc, proc (A::(Vector[column]), B::(Vector[column]), prnt::boolean := Prntmsg) local Vp; option overload; description "2 lines to get intersection projective point"; Vp := LinearAlgebra:-CrossProduct(A, B)^%T; if Vp[3] <> 0 and Normalise_Projective_Point <> 0 then Vp := Vp/Vp[3] end if; if Prntmsg then print("Meet of two Lines ") end if; return Vp end proc] end proc

(2)

#maplemint(ProjLP)

pt1:=<a|sqrt(b^2+c^2)|1>:
pt2:=<c|sqrt(b^2+a^2)|1>:
pt3:=<f^2/sqrt(a^2+b^2)|f^2/sqrt(c^2+b^2)+sqrt(a^2+b^2)|1>:
pt4:=<b^2/sqrt(a^2+b^2)|f^2/sqrt(c^2+b^2)-sqrt(a^2+b^2)|1>:

 

l1:=ProjLP(pt1,pt2)

"Line vector from two projective points. "

 

Vector[column](%id = 36893490491002736020)

(3)

l2:=ProjLP(pt3,pt4)

"Line vector from two projective points. "

 

Vector[column](%id = 36893490491002712420)

(4)

l3:=ProjLP(pt1,pt4)

"Line vector from two projective points. "

 

Vector[column](%id = 36893490491064062908)

(5)

l4:=ProjLP(pt2,pt4)

"Line vector from two projective points. "

 

Vector[column](%id = 36893490491064037372)

(6)

pl1l2:=simplify(ProjLP(l1,l2))

"Meet of two Lines "

 

Vector[row](%id = 36893490491002741932)

(7)

pl2l3:=simplify(ProjLP(l2,l3))

"Meet of two Lines "

 

Vector[row](%id = 36893490491113907252)

(8)

(ProjLP(pl1l2,pl2l3));
length(%)

"Line vector from two projective points. "

 

Vector[column](%id = 36893490491113907972)

 

6223

(9)

ReScl:=false

false

(10)

# doing nothing seems to work better here than rescaling

(ProjLP(pl1l2,pl2l3));
length(%)

"Line vector from two projective points. "

 

Vector[column](%id = 36893490491125667468)

 

2796

(11)

 


 

Download 2024-05-09_Q_Rescale_projective_vector.mw

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