C_R

2545 Reputation

19 Badges

4 years, 359 days

MaplePrimes Activity


These are questions asked by C_R

I try to understand why Maple throws 2 times an error but on a third attempt (with the same input) output is returned. Is that a new mechanism of suppression of error or warning messages and returning output up to a point where evaluation cannot further be performed.

With -sin instead of cos Maple returns output immediately. Does this mean that there is no information to the user available (yet) for this particular case?

three_times_entering_the_same.mw

Eval(`ϕ`(t), t = 0) = `ϕ__0`, Eval(diff(`ϕ`(t), t), t = 0) = 0

Eval(varphi(t), t = 0) = varphi__0, Eval(diff(varphi(t), t), t = 0) = 0

(1)

`~`[value](convert({Eval(diff(varphi(t), t), t = 0) = 0, Eval(varphi(t), t = 0) = varphi__0}, D))

{eval((D(varphi))(t), t = 0) = 0, varphi(0) = varphi__0}

(2)

map(value, convert({Eval(diff(varphi(t), t), t = 0) = 0, Eval(varphi(t), t = 0) = varphi__0}, D))

{eval((D(varphi))(t), t = 0) = 0, varphi(0) = varphi__0}

(3)

convert({Eval(diff(varphi(t), t), t = 0) = 0, Eval(varphi(t), t = 0) = varphi__0}, D); `~`[value](%)

{varphi(0) = varphi__0, (D(varphi))(0) = 0}

(4)

NULL

I have expected elementwise and map to be effective. Why aren't they for this example?

(Evaluation at a point (see help(D)): In output (3) it is the first time that I see a composition of the D operator with the Eval function (vertical bar). Is that an undocumented feature or part of an answer that I could not figure out myself?)

Download Convert_inert_IC_to_D_notation.mw

The example below is an attempt to solve a boundary value problem (BVP) without manually replacing terms in expressions and some questions where there might be room for improvement. (Only the first integration step is shown to keep it short)

My objective is to have clean Maple input with minimal manual interventions or low-level manipulations (such as using op and similar commands).

NULL

ode := diff(phi(s), s, s)+K*cos(phi(s)) = 0

diff(diff(phi(s), s), s)+K*cos(phi(s)) = 0

(1)

NULL

map(int, ode, s)

int(diff(diff(phi(s), s), s)+K*cos(phi(s)), s) = 0

(2)

Student[ODEs]:-Integrate(ode, phi(s))

Error, (in assuming) when calling 'Student:-ODEs:-Integrate'. Received: 'The given ODE, diff(diff(phi(s),s),s)+K*cos(phi(s)) = 0, is not exact'

 

...not a clue for me


Since I know the result: Multiplying by diff(phi(x), x) to make integration work.  Q1: Are there other ways to integrate a single step without a priori knowledge?

(diff(phi(s), s))*ode

(diff(phi(s), s))*(diff(diff(phi(s), s), s)+K*cos(phi(s))) = 0

(3)

NULL

int(lhs((diff(phi(s), s))*(diff(diff(phi(s), s), s)+K*cos(phi(s))) = 0), s)+c__1 = 0

(1/2)*(diff(phi(s), s))^2+K*sin(phi(s))+c__1 = 0

(4)

Boundary condition for s = L 

Eval(diff(phi(s), s), s = L) = `φ'`[0]

Eval(diff(phi(s), s), s = L) = `φ'`[0]

(5)

(4) evaluated at the boundary

expand(map(Eval, (1/2)*(diff(phi(s), s))^2+K*sin(phi(s))+c__1 = 0, s = L))

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

(6)

Q2: How to simplify expression (6) with (5) using Maple commands to get this expression for the integration constant

``

c__1 = -(1/2)*`φ'`[0]^2-K*sin(Eval(phi(s), s = L))

c__1 = -(1/2)*`φ'`[0]^2-K*sin(Eval(phi(s), s = L))

(7)

Some attempts

algsubs(Eval(diff(phi(s), s), s = L) = `φ'`[0], Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)); applyrule(Eval(diff(phi(s), s), s = L) = `φ'`[0], Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)); simplify(Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L), {Eval(diff(phi(s), s), s = L) = `φ'`[0]}); Physics:-Substitute(Eval(diff(phi(s), s), s = L) = `φ'`[0], Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L))

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

 

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

 

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

 

Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)

(8)

``

map(`^`, Eval(diff(phi(s), s), s = L) = `φ'`[0], 2)

(Eval(diff(phi(s), s), s = L))^2 = `φ'`[0]^2

(9)

Doing it manually

isolate(subs({Eval(0, s = L) = 0, Eval((1/2)*(diff(phi(s), s))^2, {s = L}) = (1/2)*`φ'`[0]^2}, Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L)), c__1)

c__1 = -(1/2)*`φ'`[0]^2-(Eval(K*sin(phi(s)), {s = L}))

(10)

or

isolate(algsubs(value(Eval(diff(phi(s), s), s = L) = `φ'`[0]), value(Eval((1/2)*(diff(phi(s), s))^2, {s = L})+Eval(K*sin(phi(s)), {s = L})+c__1 = Eval(0, s = L))), c__1)

c__1 = -(1/2)*`φ'`[0]^2-K*sin(phi(L))

(11)

subs(phi(L) = Eval(phi(s), s = L), c__1 = -(1/2)*`φ'`[0]^2-(Eval(K*sin(phi(s)), {s = L})))

c__1 = -(1/2)*`φ'`[0]^2-(Eval(K*sin(phi(s)), {s = L}))

(12)

Q3: Are there ways to prevent commands evaluating Eval(phi(s), s = L)to phi(L)which might suggest incorrectly a new independent variable?

Q4: In (6), why is s = L sometimes in brackets {} ?

``

Download BVP_with_questions.mw

I am updating older files.

Executing with the attached code snippet from a worksheet created with Maple 16 outputs for an inert integral

instead of

Why is that and how can I fix my old worksheets to make them work with Maple 2023?

Maybe related: Execution with (or return) does not evaluate the document blocks. When all document blocks are expanded with "right click show command" the cursor does not advance to the next execution group. I can't remenber if this behaviour was allways like this or has changed.

A suggestion for Maplesoft: I have stopped using document blocks with hidden code since hiding and showing commands requires too much time (to many clicks and mouse movements). A simple double click on the marker of the document block could facilitate hiding and showing code allot.

Output_of_Int_not_in_2d.mw

alias(b = JacobiCN(sqrt(2)*sqrt(x), sqrt(2)*_Z/2)^2);
                          lessthan, b

I could not find an explanation on the help page.

I would have expected simply b as the return value.

Update:
A worksheet that generates the output


 

RootOf(JacobiCN(sqrt(2)*sqrt(x), (1/2)*sqrt(2)*_Z)^2*_Z^2+_Z^2-2)

RootOf(JacobiCN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2+_Z^2-2)

(1)

plot(RootOf(JacobiCN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2+_Z^2-2), x = 0 .. 5)

 

convert(JacobiCN(sqrt(2)*sqrt(x), (1/2)*sqrt(2)*_Z)^2, Elliptic_related)

1-JacobiSN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2

(2)

convert(RootOf(JacobiCN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2+_Z^2-2), Elliptic_related)

RootOf(JacobiSN(2^(1/2)*x^(1/2), (1/2)*2^(1/2)*_Z)^2*_Z^2-2*_Z^2+2)

(3)

alias(b = JacobiSN(sqrt(2)*sqrt(x), (1/2)*sqrt(2)*_Z))

lessthan, b

(4)

``

Download alias_with_lessthan_output.mw

First 15 16 17 18 19 20 21 Last Page 17 of 32