Question: c__1 and _C1 do not seem to work the same way.

The change from _C1 to c__1 is causing me so many problems as I still do not fully understand it.

I have nothing in my Maple ini file. 

I was solving from a solution to an ode for the constant of integration, which I know is c__1 inside a proc.

But this was failing to solve for it. When I copy same code to global (worksheet), it works. So it is clearly issue of name space related to c__1 vs. _C1. 

So even though the solution now has the subscripted version and not the traditional one (since that is the default now), it does not solve for it when inside a proc.

If instead I solve for _C1, then it works. Even though the solution has c__1. This is bizzar to me. 

I also tried adding   global c__1; inside the proc, but this did not help. (did not show this version in the worksheet).

Why is solving for c__1 fail inside a proc but works outside? Clearly the c__1 in the solution of the ode is not the same c__1 I typed in to solve for, even though on the screen they look the same. 

So c__1 is not really the same as _C1 in all aspects. Right?

Here is worksheet. Example 1 below shows how it fails inside proc

Maple 2024.1. Does this happen for others on Linux or the Mac?
 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1767 and is the same as the version installed in this computer, created 2024, June 28, 12:19 hours Pacific Time.`

Example (1) solving for constant of integration fails inside proc but works outside

 

restart;

foo:=proc(ode::`=`)
local sol,the_constant;
   sol:=dsolve(ode);
   print("sol is ",sol);
   the_constant:=solve(sol,c__1);
   print("the constant is ",the_constant);
end proc;

proc (ode::`=`) local sol, the_constant; sol := dsolve(ode); print("sol is ", sol); the_constant := solve(sol, c__1); print("the constant is ", the_constant) end proc

#this does not work
ode:=diff(y(x),x) = 3/4*y(x)/x;
foo(ode)

diff(y(x), x) = (3/4)*y(x)/x

"sol is ", y(x) = c__1*x^(3/4)

"the constant is "

restart;

#this works
ode:=diff(y(x),x) = 3/4*y(x)/x;
sol:=dsolve(ode);
print("sol is ",sol);
the_constant:=solve(sol,c__1);

diff(y(x), x) = (3/4)*y(x)/x

y(x) = c__1*x^(3/4)

"sol is ", y(x) = c__1*x^(3/4)

y(x)/x^(3/4)

 

Example (2). Solving for _C1 works, even though the ode has c__1  , why??

 

restart;

foo:=proc(ode::`=`)
local sol,the_constant;
   sol:=dsolve(ode);
   print("sol is ",sol);
   the_constant:=solve(sol,_C1);  #notice solving for _C1 now
   print("the constant is ",the_constant);
end proc;

proc (ode::`=`) local sol, the_constant; sol := dsolve(ode); print("sol is ", sol); the_constant := solve(sol, _C1); print("the constant is ", the_constant) end proc

ode:=diff(y(x),x) = 3/4*y(x)/x;
foo(ode)

diff(y(x), x) = (3/4)*y(x)/x

"sol is ", y(x) = c__1*x^(3/4)

"the constant is ", y(x)/x^(3/4)

restart;

ode:=diff(y(x),x) = 3/4*y(x)/x;
sol:=dsolve(ode);
print("sol is ",sol);
the_constant:=solve(sol,c__1); #these both work OK in global
the_constant:=solve(sol,_C1);  #these both work OK in global

diff(y(x), x) = (3/4)*y(x)/x

y(x) = c__1*x^(3/4)

"sol is ", y(x) = c__1*x^(3/4)

y(x)/x^(3/4)

y(x)/x^(3/4)

 

 

Example (3). Forcing arbitraryconstants = subscripted it still does not work inside proc. Why??

 

restart;

foo:=proc(ode::`=`)
local sol,the_constant;
   sol:=dsolve(ode,arbitraryconstants = subscripted);   
   print("sol is ",sol);
   the_constant:=solve(sol,c__1);
   print("the constant is ",the_constant);
end proc;

proc (ode::`=`) local sol, the_constant; sol := dsolve(ode, arbitraryconstants = subscripted); print("sol is ", sol); the_constant := solve(sol, c__1); print("the constant is ", the_constant) end proc

ode:=diff(y(x),x) = 3/4*y(x)/x;
foo(ode)

diff(y(x), x) = (3/4)*y(x)/x

"sol is ", y(x) = c__1*x^(3/4)

"the constant is "

 


 

Download constant_of_integration_solving_july_9_2024_maple_2024.mw

 

Please Wait...