C_R

3412 Reputation

21 Badges

5 years, 316 days

MaplePrimes Activity


These are questions asked by C_R

Sometimes this information is not needed. Example

(Int = int)(1/x, x = a .. 2, 'AllSolutions')

I had a look at help(interface).

I need tutoring on some calculus basics.

y(x)

y(x)

(1)

diff(y(x), x)

diff(y(x), x)

(2)

(Int = int)(diff(y(x), x), x)

Int(diff(y(x), x), x) = y(x)

(3)

(Int = int)(diff(y(x), x), x = a .. b)

Int(diff(y(x), x), x = a .. b) = int(diff(y(x), x), x = a .. b)

(4)

The right-hand side below is the desired evaluation.

(`@`(value, rhs))(Int(diff(y(x), x), x = a .. b) = int(diff(y(x), x), x = a .. b)) = eval(int(diff(y(x), x), x), x = b)-(eval(int(diff(y(x), x), x), x = a))

int(diff(y(x), x), x = a .. b) = y(b)-y(a)

(5)

Download Eval_definite_integral.mw

Maple does integrate the indefinite integral but not a definite version of it.

I assume that this is not possible without additional assumptions on y(x).

I tried to assume the properties continuous and differentiable.

Anything else that can be done/assumed to force evaluation the way I want?

Here is an example of how such integrals can come about

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
First 26 27 28 29 30 31 32 Last Page 28 of 44