MaplePrimes Questions

can we express 'X' in terms of 'L'? i.e., X = (some const)*L XintoL.mw

Hello,
can anyone tell me why the following expression evaluates to false in Maple?

restart;
evalb(sin(x + y) = sin(x)*cos(y) + cos(x)*sin(y));                 
false

The underlying term "sin(x+y) = sin(x) cos(y) + cos(x) sin(y)" is one of the addition theorems that have been proven to be valid.

Thank you in advance for your answer.

Best regards
Jan

I tried to solve a ODE system using rkf45 with shooting technique. But I have a lot of errors. How to resolve this...

See the attachment: Shoot_Blasius.mw

I have some long expressions that would be more readable if common sections were substituted out. There are many sets of radicals often stacked inside each other.  The other one is (a*x..........) I see repeated in some other expressions. indets is good, but is there a way to use it to select  (a*x..........) types
At these eexpressions are returned from procdures would probably put them in an array/table with their substitution components. 
I dont need to substitute everything. What I have done below is reasonable for reading and seeing the structure.

What would be a good approact here?

restart

 

18*x^2+21*x*y+7*y^2-29*x-37*y-56

(1)

vals:=[a=18,b=21,c=7,d=-29,e=-37,f=-56]

[a = 18, b = 21, c = 7, d = -29, e = -37, f = -56]

(2)

vars[1]:=x:vars[2]:=y:

eqn:= 8*(2*((a^2-2*a*c+b^2+c^2)*(4*a*c*f-a*e^2-b^2*f+b*d*e-c*d^2)^2)^(1
                /2)+(-8*a*f+2*d^2)*c^2+(8*a^2*f-2*a*d^2+2*a*e^2+2*b^2*f-2*b*d*e)*c-2*a^2*e^2-2*
                a*b^2*f+2*a*b*d*e)^(1/2)*(a*c-1/4*b^2)/(4*a*c-b^2)^2*(vars[1]-(1/4*b*e-1/2*c*d)/(a*c-\
                1/4*b^2))-8*csgn((4*a*c*f-a*e^2-b^2*f+b*d*e-c*d^2)*(Complex(1)*a+Complex(-1)*c-
                b))*(a*c-1/4*b^2)*(2*((a^2-2*a*c+b^2+c^2)*(4*a*c*f-a*e^2-b^2*f+b*d*e-c*d^2)^2)^
                (1/2)+(8*a*f-2*d^2)*c^2+(-8*a^2*f+2*a*d^2-2*a*e^2-2*b^2*f+2*b*d*e)*c+2*a^2*e^2+
                2*a*b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^(1/2)+(8*a*f-2*d^2)*c^2+(-8*a^2*f+2*a*d^2-2*a*e^2-2*b^2*f+2*b*d*e)*c+2*a^2*e^2+2*a*b^2*f-2*a*b*d*e)^(1/2), csgn((4*a*c*f-a*e^2-b^2*f+b*d*e-c*d^2)*(I*a-I*c-b))}

(6)

Subs:=[((a^2 - 2*a*c + b^2 + c^2)*(4*a*c*f - a*e^2 - b^2*f + b*d*e - c*d^2)^2)=A^2,
         (-8*a*f + 2*d^2)*c^2 + (8*a^2*f - 2*a*d^2 + 2*a*e^2 + 2*b^2*f - 2*b*d*e)*c - 2*a^2*e^2 - 2*a*b^2*f + 2*a*b*d*e=B^2,
           f*b^3 - b^2*d*e - (-(-4*c*f + e^2)*a - c*d^2)*b=C]:

eqn1:=simplify(eqn,Subs)

(-8*csgn(C+((1/2)*I)*B^2)*(-(1/4)*y*b^2-(1/4)*b*d+a*(y*c+(1/2)*e))*(-B^2+2*(A^2)^(1/2))^(1/2)+8*(B^2+2*(A^2)^(1/2))^(1/2)*(-(1/4)*b^2*x-(1/4)*b*e+c*(a*x+(1/2)*d)))/(4*a*c-b^2)^2

(7)

Subsnumeric:=eval(Subs,vals)

[74635047712 = A^2, -253528 = B^2, 242004 = C]

(8)

simplify(eval(eqn1,[(rhs=lhs)~(Subsnumeric)[],vals[] ]))

(4/567)*(9*x+53)*(-63382+5762*562^(1/2))^(1/2)+(4/1323)*(241-21*y)*(63382+5762*562^(1/2))^(1/2)

(9)
 

 

Download 2024-05-27_Q_Pick_Apart_an_Expression.mw

I was trying to solve a system of eight cubic equations, with eight variables. Note that the particular solutions should exist and my goal is to find all  possible solutions using solve. However, when executing, the solve keeps running for a whole day and did not throw any results. I also set the parameter infolevel[solve] to be 3 and find out that it is stuck in the step "GroebnerBasis: computing a factored plex basis using Groebner[Solve]". Can anyone tell me how to deal with that? Here's the Maple file.

solve_test.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

How do I calculate and plot an Orthogonal Trajectory on Maple 2024?

Here's the equation of the contour lines:

x*y^2 - x^2 - y^2 = k

I need to make it pass through a precise point on my contour lines graph, and everything I do doesn't seem to work.

I have tried to understand why ODESteps cannot find a solution for cases where an ODE can separated into a polynomial expression and an ODE.

or example, when I trace like this

restart;
trace(Student:-ODEs:-ODESteps:-ModuleApply);
printlevel:=10;
Student:-ODEs:-ODESteps:-ModuleApply(x*(diff(y(x), x)) = 0);
printlevel:=1

trace is tracing an unknown procedure

and not showing any further details of this procedure.
What unknow function/procedure is traced?

Can, in this particular case, the message "Cannot compute integral"   be traced (it’s not an error message, which are traceable).

I have tried to increase printlevel which reveals some unkown procedures but did not get down to this one. Hence my questions.

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.

At here https://mathematica.stackexchange.com/questions/297104/how-can-i-convert-a-list-containing-three-points-and-its-equation-passing-three is discussing about "How can I convert a list containing three points and its equation passing three points to text file?" With mylist

mylist := [[[-12, 2, -1], [-11, 1, -5], [-10, -2, 3], 10*x + 6*y + z + 109 = 0], [[-12, 2, -1], [-11, 1, -5], [-10, 6, 3], 2*x - 2*y + z + 29 = 0], [[-12, 2, -1], [-11, 1, -5], [-9, 5, -7], 3*x - y + z + 39 = 0]]

How can I get the LaTeX file like this?

\documentclass[12pt,a4paper]{article}
\usepackage[letterpaper,margin=1.2in]{geometry}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\arabic*)]
\item $A(-12; 2; -1)$,\quad $B(-11; 1; -5)$,\quad $C(-10; -2; 3)$,\quad $(P) : 10 x+6 y+z+109=0$
\item $A(-12; 2; -1)$,\quad $B(-11; 1; -5)$,\quad $C(-10; 6; 3)$,\quad $(P) : 2 x-2 y+z+29=0$
\item $A(-12; 2; -1)$,\quad $B(-11; 1; -5)$,\quad $C(-9; 5; -7)$,\quad $(P) : 3 x-y+z+39=0$
\end{enumerate}
\end{document}


 

Given the ode   y''(x)*y'(x)=0, clearly it has solutions for y''=0 and y'=0.

These are y=c1+x*c2 and y=c1. But Maple gives 3 solutions

12592

interface(version);

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

ode:=diff(y(x),x$2)*diff(y(x),x)=0;

(diff(diff(y(x), x), x))*(diff(y(x), x)) = 0

dsolve(ode)

y(x) = c__1, y(x) = -c__1*x+c__2, y(x) = c__1*x+c__2

dsolve(diff(y(x),x$2)=0)

y(x) = c__1*x+c__2

dsolve(diff(y(x),x)=0)

y(x) = c__1

 

 

Download why_3_solutions_may_24_2024.mw

Where did the third solution come from? The 3 solutions are correct ofcourse, but why 3? There should only be two. 

FYI, I am using 

Physics:-Version()

The "Physics Updates" version in the MapleCloud is 1746. The 

   version installed in this computer is 1745 created 2024, May 

I have to check earlier Maple versions to see if same thing happens there.

This ode can be solved by just looking at it

ode:=(x+y(x))*diff(y(x),x)=0;

We see the solution is y=-x and y=c__1 because either (x+y)=0 or y'=0

But for some reason ODESteps(ode) says it cannot compute integral.

Any idea why?


 

26348

interface(version);

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

ode:=(x+y(x))*diff(y(x),x)=0;
Student:-ODEs:-ODESteps(ode);

ode := (x+y(x))*(diff(y(x), x)) = 0

"[[,,"Let's solve"],[,,(x+y(x)) ((ⅆ)/(ⅆx) y(x))=0],["•",,"Highest derivative means the order of the ODE is" 1],[,,(ⅆ)/(ⅆx) y(x)],["•",,"Integrate both sides with respect to" x],[,,∫(x+y(x)) ((ⅆ)/(ⅆx) y(x)) ⅆx=∫0 ⅆx+`c__1`],["•",,"Cannot compute integral"],[,,∫(x+y(x)) ((ⅆ)/(ⅆx) y(x)) ⅆx=`c__1`]]"

 


 

Download odestep_quadrature_unable_to_solve_maple_2024.mw

update:

Here is another simpler example that also confused it
 

26348

interface(version);

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

ode:=x*diff(y(x),x)=0;
Student:-ODEs:-ODESteps(ode);

ode := x*(diff(y(x), x)) = 0

"[[,,"Let's solve"],[,,x ((ⅆ)/(ⅆx) y(x))=0],["•",,"Highest derivative means the order of the ODE is" 1],[,,(ⅆ)/(ⅆx) y(x)],["•",,"Integrate both sides with respect to" x],[,,∫x ((ⅆ)/(ⅆx) y(x)) ⅆx=∫0 ⅆx+`c__1`],["•",,"Cannot compute integral"],[,,∫x ((ⅆ)/(ⅆx) y(x)) ⅆx=`c__1`]]"

 

 


 

Download odestep_quadrature_unable_to_solve_v2_maple_2024.mw

update

Here is another one which it gets wrong. 
 

26348

interface(version);

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

ode:=y(x)*diff(y(x),x)=0;
Student:-ODEs:-ODESteps(ode);

ode := y(x)*(diff(y(x), x)) = 0

"[[,,"Let's solve"],[,,y(x) ((ⅆ)/(ⅆx) y(x))=0],["•",,"Highest derivative means the order of the ODE is" 1],[,,(ⅆ)/(ⅆx) y(x)],["•",,"Integrate both sides with respect to" x],[,,∫y(x) ((ⅆ)/(ⅆx) y(x)) ⅆx=∫0 ⅆx+`c__1`],["•",,"Evaluate integral"],[,,((y(x))^2)/2=`c__1`],["•",,"Solve for" y(x)],[,,{y(x)=sqrt(2) sqrt(`c__1`),y(x)=-sqrt(2) sqrt(`c__1`)}]]"

dsolve(ode);

y(x) = 0, y(x) = -c__1

 


The correct solution is given by dsolve, which is y=0 and y=constant (I do not know why dsolve put minus sign in front of the constant, but it is still correct).

Download odestep_quadrature_unable_to_solve_v3_maple_2024.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.

Why does 'simplify' not work when calculating Eigenvectors? Further, how can we express (2) in a more simplified form by using 'simplify'?simplify.mw

First 7 8 9 10 11 12 13 Last Page 9 of 2332