C_R

4039 Reputation

21 Badges

7 years, 8 days

MaplePrimes Activity


These are answers submitted by C_R

You have asked an interesting question. Let's approach it from first principles

The energy of a bead is

"T = m/(2) v^(2)= const."

At the vertices (long axis) and co-vertices (short axis) of an ellipse, we can fit a circle as if the bead was rotating about the center of a circle (the `Osculating Circle`) with the energy

T__ = (1/2)*m*v^2 and (1/2)*m*v^2 = (1/2)*m*(r__a*`ω__a`)^2 and (1/2)*m*(r__a*`ω__a`)^2 = (1/2)*m*(r__b*`ω__b`)^2

leading to

(1/2)*m*(r__a*`ω__a`)^2 = (1/2)*m*(r__b*`ω__b`)^2

(1/2)*m*r__a^2*omega__a^2 = (1/2)*m*r__b^2*omega__b^2``

(1)

or

simplify(map(sqrt, 2*(((1/2)*m*r__a^2*omega__a^2 = (1/2)*m*r__b^2*omega__b^2)*(1/m))), symbolic)

r__a*omega__a = r__b*omega__b

(2)

The angular momentum for the same centers of rotation should obey

L = m*r*v

leading to

L__a = m*r__a*v and m*r__a*v <> m*r__b*v and m*r__b*v = L__b

Conversely, this means the following: Only when r__a = r__b , the angular momentum is conserved.
In this case the center of the osculating circles of the orbital points do not move and coincidence with the origin of an inertial system at the midpoint of the ellipse.

It is therefore justified to question the usefulness of calculating the angular momentum of a single point mass on a track about a single point of reference or about instantaneous points of reference (see here for the evolute of an ellipse).
The magnitude of the angular momentum will in any case not be the same for both ways of calculation.

When more than one bead rigidly connected to each other is investigated, things change.
In this case the kinematics of a moving rigid body can be decomposed into a translation of the center of mass of the body and a rotation about the center of mass.
The kinetic energy can be decomposed into a translational term and a rotational term.

Two opposing beads on a elliptical trajectory are not equivalent to a rigid body. Hence my question about the nature of the ellipse (massless or not; fixed or not).

Asking differently: What is the physical significance of the angular momentum of a solitary, unbound particle?

NULL

Download Beads_on_an_ellipse.mw


 

xx := 2.5;
yy := 2.5;
a := plot3d(exp(-x^2 - y^2), x = -xx .. xx, y = -yy .. yy, shading = zhue);
b := plots:-spacecurve([x, yy, exp(-x^2)], x = -xx .. xx, color = blue);
c := plots:-spacecurve([xx, y, exp(-y^2)], y = -yy .. yy, color = red);
plots:-display([a, b, c], orientation = [-120, 60, 0]);


Gridlines could be done in several ways, but for that I would do a procedure that generates 3d plotstructures with lines. 
It would be nice to have Matlab colorshemes within Maple. Defining them on your own is possible but a bit tricky.
How close you want to mimick Matlab?

I also had the impression that AI is reponsible for "fewer and fewer" questions. However seasonal variations make it diffcult to show an AI effect by punctual browsing questions and counting.
The only way I found that worked without spending too much time is to count the page number of MaplePrimes Questions. (In the attached only 15 pages were counted for 2026. Today we are up to 24).
Assuming that always 15 questions are listed per page we can get and idea of the number of questions that are still in the data base. (Note that the actual question number, 243774-Just-For-Fun-Partition-Problem-For-A-Number, is much higher than the actual page number 2464 times 15. Maybe because of deleted spam).

To demonstrate an AI effect with the introduction of Maple 2026 the anual profiles should be compared. Doing it manually is tedious so I did not further investiagate.
Mybe AI can help with code that reads all question and dates from the website that such anual profiles could be generated.

Sampling: url page number containing the new year
 
https://www.mapleprimes.com/questions/?page=15 was the page containing the first post in 2026, 78 was the first post in 2025 and so on...
 

page_no := 15, 78, 175, 278, 385, 490, 636, 769, 917, 1059, 1212, 1363, 1512, 1676, 1816, 1943, 2084, 2202, 2315, 2392, 2442

15, 78, 175, 278, 385, 490, 636, 769, 917, 1059, 1212, 1363, 1512, 1676, 1816, 1943, 2084, 2202, 2315, 2392, 2442

(1)

pages := [page_no[2 .. -1]]

[78, 175, 278, 385, 490, 636, 769, 917, 1059, 1212, 1363, 1512, 1676, 1816, 1943, 2084, 2202, 2315, 2392, 2442]

(2)

years := [seq(2026-i, i = 1 .. nops(pages))]

[2025, 2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006]

(3)

plots:-pointplot(years, pages, view = [2004 .. 2027, 0 .. 2500], title = "Question page number beginning of year \n (15 questions per page)")

 

``

pages_per_year := [seq(page_no[i+1]-page_no[i], i = 1 .. nops([page_no])-1)]

[63, 97, 103, 107, 105, 146, 133, 148, 142, 153, 151, 149, 164, 140, 127, 141, 118, 113, 77, 50]

(4)

plots:-pointplot(years, pages_per_year, view = [2004 .. 2027, 0 .. 200], title = "Question pages per year \n (15 questions per page)")

 

NULL

Download MaplePrimes_Question_pages.mw

I am getting additional error messages and therefore do not get to the error of your attachment.

However simplifying (assuming real) the output from UCode of your worksheet results in a much simpler ODE

that should require only two intial conditions.

Derived from your ICs these should be

Edit:
Also D is not used correctly. Look at your first IC

D(cos(phi(t)))(0) = 0;# your IC
                     D(cos(phi(t)))(0) = 0

convert(%,diff); # does not convert because the independent variable is not obvious
                     D(cos(phi(t)))(0) = 0

Eval(diff(cos(phi(t)),t)=0,t=0); # what your probably meant
             / / d        \                \|     
             |-|--- phi(t)| sin(phi(t)) = 0||     
             \ \ dt       /                /|     
                                            |t = 0

convert(%,D)
            eval(-D(phi)(t) sin(phi(t)) = 0, t = 0)

Maybe of interest since you have used addition in functional form with the function name `+`.

Here is a short (perhaps cryptic) version in functional form of the above answers that does not repeat the list L

L:=[1/2, 1/3, 1/4];
(`%+`@op=add)(L);

It applies the functions and operators grouped in the first pair of parentheses to the argument L in the second pair of parentheses.

Or you define an inert function of add for better readability which I name here Add

local Add;
Add:=x->(`%+`@op)(x); 
(Add=add)(L);
value(%)

If I understand correctly you are looking for a library function that does something like evalp in the below


 

[alpha, 2, 1, b, Pi]

[alpha, 2, 1, b, Pi]

(1)

[1, 2, alpha, b, Pi]

[1, 2, alpha, b, Pi]

(2)

evalp := proc (x::list, y::list) options operator, arrow; {`~`[`@`(evalb, `=`)](sort(x), sort(y))[]}[] end proc

proc (x::list, y::list) options operator, arrow; {`~`[`@`(evalb, `=`)](sort(x), sort(y))[]}[] end proc

(3)

evalp([alpha, 2, 1, b, Pi], [1, 2, alpha, b, Pi])

true

(4)

Or for lists without duplicates

is(`minus`({[alpha, 2, 1, b, Pi][]}, {[1, 2, alpha, b, Pi][]}) = {})

true

(5)

NULL

which also works on expression sequences

NULL


Edit: comment added @sand15

Download Permutation_check.mw

Maple AI only listed procedures that either throw errors or do not come with a true/false statement, but more importantly did not list a library function. I also checked ListTools.

You are asking for an important feature: Combining units to Joule when possible in a unit expression (and not fully expanding to SI base units). I have not discovered a feature that would easliy allow for it.

If the task of converting to units (that are meaningfull) is often repeated you could define a function that gets the unit and converts it. Below is an example that does this for the molar gas constant (I could not find a scientific constant in J/kg/K but I hope you get the idea). In an existing worksheet with many GetUnit calls you can realtivley quickly find and replace GetUnit with GetMyUnit.

If you have more than one unit to convert back either you can define more functions or a procedure that scans for unit expressions that you want to convert back.

with(ScientificConstants)

Constant(R)

ScientificConstants:-Constant([molar_gas_constant])

(1)

GetUnit(ScientificConstants[Constant]([molar_gas_constant]))

Units:-Unit(m^2*kg/(s^2*mol*K))

(2)

GetMyUnit := proc (x) options operator, arrow; convert(GetUnit(x), units, kg*J/(mol*kg*K)) end proc

proc (x) options operator, arrow; convert(ScientificConstants:-GetUnit(x), units, Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(kg, Units:-Simple:-`/`(mol)), J), Units:-Simple:-`/`(kg)), Units:-Simple:-`/`(K))) end proc

(3)

GetMyUnit(ScientificConstants[Constant]([molar_gas_constant]))

Units:-Unit(J/(mol*K))

(4)

NULL

Not brilliant but maybe something to work around

Download GetMyUnit.mw

I am not sure what exactly you mean by moving but reading the examples in help pages there is some sorting going on when the indicees are symbolic.

According to ?Physics,LeviCivita :

"The symmetry property of LeviCivita is taken into account when the indices have symbolic values: they are sorted so that zero recognition is automatic".

Simliarily in ?Physics,Riemann 

"Now when the indices are not numerical, Riemann returns itself after normalizing its indices taking advantage of their symmetry properties, so that different forms of the same tensor enter computations in the same manner, for example, if you interchange the positions  as in ..."

Something like that?
(Not sure if I understood correctly).

For a partial evaluation you could use subs(Int=int,...) and subs(Sum=sum,...)

 

swapIntSum :=

NULL

> 

expr := Int(Sum(f[i](t, x), i = n), x = a .. b)

Int(Sum(f[i](t, x), i = n), x = a .. b)

(1)

NULL

> 

swapIntSum(expr)

Sum(Int(f[i](t, x), x = a .. b), i = n)

(2)

NULL

Download swapIntSum.mw

If you increase the spatial samplig points the solutions do not look too different for the same time steps.
The pde solution "propagtes" faster which indicates a mismatch in initial conditions.

(I had no time to check this). Hope this helps

pdsolve_exercise_damping_ini_linear_a_reply.mw

For your example type: 2!//1

to avoid unintended cursor jumps.

I agree that not interrupting the flow is important. In your case the feature you want to turn off is against common UI behaviour. Not all users will get used to it.

// is a "hidden" and very useful productivity feature no one talks about. I use it a lot.

Maple 2026 most likely came with the latest version of the Physics package (including the latest update). Probably it is this one (which is the latest for Maple 2025)

However checking for the actual version is not possible when no update was installed.

This output is missleading. Normally something like this should be returned if no updates are on your system (here for Customer Support Updates)

The version you loaded is pretty old. It will have less functionality and bugs not fixed.

I do not expect frequent Phsyics updates as in the past since general updates are now handled by Maple Customer Support Updates

Maple has a typesetting facility to prettyprint symbols and math expressions in a textbook style fashion. In Maple this print is called 2-D Math. Whereas rendering is done by the user interface, calculations are performed by the kernel. The kernel does not use 2-D Math prints as variables (i.e. names/symbols) that you see on the screen, but different names coded in 1-D Math.

In your case two variables have been created by the user interface with two different variable names for the kernel but with the same typesetting instructions to 2-D prettyprint.  Maples user interface created one variable from the pasted content which probably contained hidden characters and code. From that Maple created a unique name using name quotes. Content ... inside name quotes `...` has two purposes: a.) it defines the name and b.) it can contain typesetting instructions for 2D prettyprinting.

Without more details it is difficult to tell what exactly happened. You can display variable names for the kernel by either using the lprint command or by converting an expression to 1-D Math (select -> right click -> Convert to -> 1-D Math). You can also have a look at the variable palette (only when variables have a value assigned to).
As an example below I have used three instances of xi that are different to the kernel but look the same on the user interface.

restart


Palette ξ + 1-D ξ

xi+xi

2*xi

(1)

Print the names used by the kernel

lprint(2*xi)

2*xi

 

3 different names (in 1-D math) that all print as xi

> 

xi+`&xi;`+`#mo("&xi;")`

xi+`&xi;`+`#mo("&xi;")`

(2)

They do not add up to 3 ξ

Assigning values

> 

xi:=1

1

(3)
> 

`&xi;`:=2

2

(4)
> 

`#mo("&xi;")`:=3

3

(5)

Re-evaluation of output (2)

xi+`&xi;`+`#mo("&xi;")`

6

(6)

Note: Some HTML codes are also accepted inside name quotes

> 

`&#958;`:=4

4

(7)
> 

 

Compare also with entries in the variable palette


Download printing_xi.mw

Interesting discussion. To address your initial questions about odetest and dsolve’s inability to provide a solution it is helpful to have a look at the phase space.

The problem posed in the textbook can only be answered for particular solutions that follow a special trace in the phase space of the ODE.  For the pendulum this trace is called separatix. It separates bounded motion and unbounded motion of the pendulum (highlighted in green; from https://mathematicalgarden.wordpress.com/2009/03/29/nonlinear-pendulum/).

From the phase portrait of the ODE we can deduce that all points on the separatrix are valid initial conditions for a swing of the pendulum towards the instable equilibrium point at x=pi and x_dot=0.
Furthermore, the red arrows at the equilibrium point underline that no continuous and smooth movements beyond this point at t=infinity are possible.

It is therefore justified to question whether this point (y(0)=pi and y_dot(0)=0) can represent a valid initial condition at all to answer the textbook problem. Only with a tiny initial impulse (i.e. y_dot(0) <> 0 starting at -pi) the pendulum can reach in a finite ammout of time the angle pi but will not stop to zero and continues to move unbounded.
Since y(0)=pi and y(0)=-pi (which is the same) at x_dot=0 are no proper initial conditions on the separatrix, y(t)=pi at any point in time (including infinity) is neither. From this perspective it does not make sense to ask if Maple’s solution is correct.

The separatrix can quite easily be derived from the law of conservation of energy to get initial conditions to solve the problem.

At x(0)=0 and g/l=1 (factor of the sine term of the ODE), the velocity calculates to x_dot(0)=2. These are the initial conditions Kitonum used in his solution which elegantly avoids elliptic integrals by only integrating once. Integrating twice complicates the solution considerably. Also here the limit is pi (Edit: in 1D plain text copied from the source; t equivalent to x):    

varphi(t) = 2*arcsin(JacobiSN(sin(varphi__0/2)*sqrt(C)*t, 1/sin(varphi__0/2)));
subs(varphi__0 = Pi, C = 1, %);
simplify(%);
limit(%, t = infinity)

The second integration step (integration for the independent variable) and mapping Jacobi elliptic functions to elliptic integrals of the dependent variable is something that Maple’s generic integration algorithms currently do not perform. However, you might have noticed that if you instead of y(infinity)=pi put y(0)=anyvalue odetest returns zero.

This way the symbolical result of solve is converted to a "numeric format":

evalf(solve({el1, el2, el3, el4, el5, el6, el7, el8, el9,
             el10, el11, el12, el13, el14, el15, el16},
             {a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7],
              a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]}));

solve_numerical_reply.mw

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