## 13653 Reputation

19 years, 296 days

## plo3d...

@janhardo If diff(f(x,y),x) = 0 for all x and y then f(x,y) = h(y) for some function h.
To illustrate just plot in 3D any function of y you like.

```h:=(x,y)->sin(y^2); # Example
plot3d(h(x,y),x=-3..3,y=-3..3);
```

## Reason...

@janhardo
Let (y0,z0) be a point for which the function f given by f(y) = g(y,z0) is defined in a y-interval for which y0 is an interior point.

If that function f (of the one variable y) is differentiable at y0 then by definition g is said to have a partial derivative w.r.t. y at (y0,z0) and f'(y0) is called the partial derivative of g at (y0,z0). In Maple denoted by D[1](g)(y0,z0).

If f as given above is differentiable at y0 with f'(y0) = 0 then clearly also the function p given by p(y) = f(y) + C (C any constant ) is differentiable at y0 and p'(y0) = 0. Expressed in terms of g:
If  D[1](g)(y0,z0) = 0 then the function q given by q(y,z) = g(y,z) + h(z)  (any h of one variable) has a partial derivative at (y0,z0) and D[1](q)(y0,z0) = 0.
That part is very simple.
For a converse statement: Assume that g(y,z0) has a partial derivative for all y in an open interval I containing y0 and that D[1](g)(y,z0) = 0 for all y in I. Expressed in terms of f this means that f is differentiable in I and f'(y) = 0 in I.
Then we know that f must be constant in I. Thus g(y,z0) is a constant for y in I. That constant could depend on z0. Thus we may write  g(y, z0) = h(z0) where by h(z0) is simply meant a constant that may depend on which z0 we are talking about. Depending on g that function h could be nasty, e.g. discontinuous at any point z0.

## formal_series...

Here we get formal power series:

```Ssol:=dsolve(cde,y(x),formal_series);
```

Under the assumption that p is an integer we get:

```Ssol2:=dsolve(cde,y(x),formal_series) assuming p::integer;
```

which, however, is no better than the previous since we just get the trivial zero solution.

```limit~([Ssol2],p=7);
limit~([Ssol],p=7);
```

Compare with:

```eval(cde,p=7);
sol7:=dsolve(%);
series(rhs(sol7),x,6) assuming x>-1,x<1;
```

## Dialogue box gone...

@Rouben Rostamian  In 2D in versions before Maple 2016 a dialogue box comes up when you do

f(x):=x^2

In that box it says that parts of the expression are ambiguous and asks the user to choose between function definition and remember table or rtable assignment. Function definition is first and preselected, so just hitting Enter would choose that.

This box disappeared in Maple 2016 where a function definition is the result, but there is no option function_assign.
Same in Maple 2017. Putting in option function_assign happened in Maple 2018.
Removing the dialogue box may have been done (?) because it annoyed users of 2D, but could be brought back I suppose.

The current situation isn't all that bad, I think. If you start by using the arrow definition as in f:= x -> x^2 then it is now possible to make a remember table assignment to f as in f(Pi):=1. If x is just a name (and not a constant like Pi), however, assigning f(t):=t^4  to the remember table for f doesn't make much sense to me, so here a dialogue box could (should) pop up asking the user to choose.

With all that said I never use 2D math input myself, so don't have any of those problems.

## Option function_assign...

By doing

`f:=subsop(3=(operator,arrow, function_assign),eval(f));`

after having done f:=x->sqrt(x), the 2D assignment f(x):=x^2*sin(x) works as desired.
This is revealed in the help page for Typesetting, Settings, where it states:

When a function is created for the first time using this syntax, the generated procedure will contain the option function_assign. This results in any subsequent assignments involving  "f(args)"  to be interpreted as function assignments. If f has already been defined as a procedure but does not have option function_assign, then any assignment with "f(args)"  on the left-hand side is interpreted as a remember-table assignment regardless of the functionassign setting.[my emphasis].

I guess that that means: If you start by using the "arrow" definition for a given function f, stick to it if you decide to change the definition of f. You can't have it both ways. If you define a new function g by using g(x):=whatever(x), then that will result in a procedure (by default).

## Useful...

@acer I like your version. It easily allows extension to include c__ (double underscore) instead of c[]:

```replace_all_C:=proc(expr::anything,c::name,{useindex::truefalse:=false})
if useindex then
subsindets(expr, ':-suffixed(_C, posint)',
u->c[parse(convert(u,string)[3..])])
else
subsindets(expr, ':-suffixed(_C, posint)',
u->cat(c,"__",parse(convert(u,string)[3..])))
end if
end proc:
```

Examples:

```sol:=dsolve(diff(x(t),t\$3) = x(t));
replace_all_C(sol,a)
replace_all_C(sol,c,useindex);
```

While this allows for different symbols for different outputs from dsolve it doesn't change the numbering. This could easily be added:

```replace_all_C:=proc(expr::anything,c::name,{useindex::truefalse:=false,add::posint:=0})
if useindex then
subsindets(expr, ':-suffixed(_C, posint)',
else
subsindets(expr, ':-suffixed(_C, posint)',
end if
end proc:
```

Examples:

```replace_all_C(sol,a,add=3);
```

## Curve in 3D...

@tomleslie I don't know anything about skin friction or Nusselt number, but certainly you can plot the solution in phase space:

`plots:-odeplot(sol,[theta(eta),g(eta),f(eta)],0..10);`

Whether that is anywhere near what he is thinking about is another question.

## Still doesn't work...

@ecterrab I tried getting Physics Updates 783 from the cloud from within Maple 2020.1.1.

It stopped in the middle of the process as Tom Leslie described. I didn't wait for a crash.

Then I created the folder structure as you described. I went to
https://www.maplesoft.com/products/maple/features/physicsresearch.aspx
I put that file in the lib folder and the version.txt into the Physics Updates folder.
I didn't get or see the other 2 files and was actually sure something was wrong because of that long number on the .maple file.
OK then I copied the override_maple.txt file from Maple 2019.

Now it appears to work.
The uninstall_manifest.mtxt file from Maple 2019 I didn't copy, so I don't have that in 2020 at this time.

## Handling constants (parameters)...

@Kitonum Your procedure P cannot handle constants of type name.
Here is a revised version.

```restart;
interface(typesetting=extended);
###
P:=proc(ode)
local idiff,t;
idiff:=convert(indets(ode,specfunc(diff)),D);
t:=op~(idiff);
if numelems(t)<>1 then error "Only one independent variable allowed. Got %1", t end if;
t:=op(t);
Typesetting:-Settings(usedot=false,prime=t,typesetprime=true);
ode
end proc:
###
ode1:=diff(y(t),t\$2)+a*diff(y(t),t)+y(t)= b*diff(z(t),t);
P(ode1);
ode2:=diff(y(t),t\$2)+a*diff(y(s),s)+y(t)= b*diff(z(t),t)
P(ode2); # error by design
```

## floatPi...

With floatPi = false (my setting) I don't get any problems, but JacobiTheta3 is not evaluated.
With floatPi = true I get a loss of kernel connection for your worksheet and for edgar's as well.

## Working for me...

@janhardo As dharr said I changed all the cases of the double quotes (") into % and corrected the obvious error in defining sys (twice), where x and y should be x(t) and y(t) (and always should). The worksheet worked in my Maple 2020.
If you are in fact using a release beginning with Maple V you should not replace " by %, but the t's on x and y have to be put into sys.

## Fascinating...

Thank you for this fascinating mechanism. Theo's last name is Jansen, not Jensen, according to Wikipedia. He is Dutch, not Danish as I had hoped.

## N = 6...

@Arif Ullah khan In similar problems N has been a substitute for infinity. I suppose that is not the case here?

## Discrepancy...

@Arif Ullah khan You give some partial results for gamma = 1 and rho = nu:
para:={nu=3, gamma=10} and rho = 2.

## It doesn't appear so to me...

@vv Your example doesn't really suggest that does it? The values at t = 0 for U and X are certainly different:

 > restart;
 > Digits:=30:
 > ode := X(t)*diff(X(t), t, t) - diff(X(t), t)/(1 + diff(X(t), t)^2) - (100000000000000*t^14 + 7000000000000*t^12 + 110000000000*t^10 - 500000000*t^8 - 43000000*t^6 - 170000*t^4 - 1700*t^2 - 1)/(2*(100*t^2 + 1)^4*(50000000*t^8 + 2000000*t^6 + 35000*t^4 + 100*t^2 + 1));

 > U := t -> t/((t*10)^2+1):
 > simplify(eval(ode, X=U)), [U(0), D(U)(0)];

 > SOL:=dsolve([ode, X(1/2)=0.0211219739941351352807211288991, D(X)(1/2)=0.0540921883052830726848992435887], numeric,abserr=1e-15,relerr=1e-13);

 > SOL(0);

 > plots:-odeplot(SOL, [t,X(t)-U(t)],0..0.2);

 > plots:-odeplot(SOL, [t,log10(abs(X(t)-U(t)))],0..0.5);

 >