Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear all

I have a data, how can I study this data using N-soft set : Normalized the data, membership function, analyse the risk, ..... compute the risk, interpret the results

Cancer_patient.xlsx

N_soft_set.mw

Thank you for your help

Maybe someone get the code working ?
 

with(plots):
with(VectorCalculus):

# Example 1: Vector Field and Visualization
V := [x, y, z]:
print("Vector Field V:", V):
fieldplot3d([V[1], V[2], V[3]], x = -2..2, y = -2..2, z = -2..2, arrows = slim, title = "Vector Field in 3D"):

# Example 2: Tangent Vector to a Curve
curve := [cos(t), sin(t), t]:
print("Curve:", curve):
tangent := diff(curve, t):
print("Tangent Vector:", tangent):
plot3d([cos(t), sin(t), t], t = 0..2*Pi, labels = [x, y, z], title = "Curve in 3D"):

# Example 3: Curvature of a Surface
u := 'u': v := 'v':
surface := [u, v, u^2 - v^2]:
print("Surface:", surface):

# Compute the first fundamental form
ru := [diff(surface[1], u), diff(surface[2], u), diff(surface[3], u)]:
rv := [diff(surface[1], v), diff(surface[2], v), diff(surface[3], v)]:
E := ru[1]^2 + ru[2]^2 + ru[3]^2:
F := ru[1]*rv[1] + ru[2]*rv[2] + ru[3]*rv[3]:
G := rv[1]^2 + rv[2]^2 + rv[3]^2:
firstFundamentalForm := Matrix([[E, F], [F, G]]):
print("First Fundamental Form:", firstFundamentalForm):

# Compute the second fundamental form
ruu := [diff(surface[1], u, u), diff(surface[2], u, u), diff(surface[3], u, u)]:
ruv := [diff(surface[1], u, v), diff(surface[2], u, v), diff(surface[3], u, v)]:
rvv := [diff(surface[1], v, v), diff(surface[2], v, v), diff(surface[3], v, v)]:
normal := CrossProduct(ru, rv):
normal := eval(normal / sqrt(normal[1]^2 + normal[2]^2 + normal[3]^2)):
L := ruu[1]*normal[1] + ruu[2]*normal[2] + ruu[3]*normal[3]:
M := ruv[1]*normal[1] + ruv[2]*normal[2] + ruv[3]*normal[3]:
N := rvv[1]*normal[1] + rvv[2]*normal[2] + rvv[3]*normal[3]:
secondFundamentalForm := Matrix([[L, M], [M, N]]):
print("Second Fundamental Form:", secondFundamentalForm):

# Compute the Christoffel symbols
# Ensure DifferentialGeometry package is loaded
with(DifferentialGeometry):
DGsetup([u, v], N):
Gamma := Christoffel(firstFundamentalForm):
print("Christoffel Symbols:", Gamma):

# Visualize the surface
plot3d([u, v, u^2 - v^2], u = -2..2, v = -2..2, labels = [u, v, z], title = "Saddle Surface in 3D"):

 

Simple question. I hope it has simple answer. I have always thought that what int() returns should match exactly what "default" result shows when using int() with the option _RETURNVERBOSE 

I mean exact match. But this below shows that int() result underwent some simplification as it is not the same as default.

restart;

integrand:=sin(x)/(sin(x) + 1);
maple_result_1 :=int(integrand,x);
maple_result_2 := int(integrand,x,'method'=':-_RETURNVERBOSE')[1]

Ofcourse maple_result_2 can be made the same as maple_result_1

simplify(rhs(maple_result_2)) assuming 0<x and x<Pi;

But this is beside the point. Why is "default" is not excatly the same as int() result?  It seems that int() does something more after obtaining the :"default" result as shown.

Should default not match exactly result from int() ?

Maple 2024.

 

I put together the attached worksheet to help me determine the cheapest way to buy "refreshments" for a party by comparing price and volume of different bottle size options.  The spreadsheet works fine as is.  However, when I right click on the output of line (14) and format pct_difference as percent with 2 decimal places and execute the worksheet, Maple hangs on that line and progresses no further.  This doesn't happen in Maple 2018 but the problem does show up in Maple 2024.  Suggestions please?

cost_comparison_-_liquid_(v01MP).mw

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

sol := y = -3283/4253 - (3283*x)/4253, How can I determine the value of the coefficient of x?
How can I take the value of the coefficient of x? Thank you.

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

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

First 8 9 10 11 12 13 14 Last Page 10 of 2152