Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

In the proces of downloading your file Maple 2019.2.1 came up with a window with the title:
"Recover Corrupt File and Save As".

It suggested a name having the number 1 attached to your file's name.

That froze Maple. I had to use Ctrl+Alt+Del to shut down Maple.

I did this once again and the same thing happened.

Trying to load the "recovered" file had the same effect.

PS. It is safe to open your original file as well as the "recovered" file in a text editor like NotePad.

Your file takes up 13023 KB; the "recovered" takes up 5574 KB.

It would be an oddity if two keyword arguments both had effect as is implied in your display example.

In the help page "Argument Processing" under "Keyword Matching" we find the statement:

"Whenever a matching keyword parameter is encountered, the right-hand side of the equation becomes the value for that parameter, and the equation is removed from further consideration as an argument. If more than one keyword argument matches a keyword parameter, only the last one takes effect."

This is taken from Maple 2019.

I tried the following 3 different display versions:
 

with(plots):
setoptions3d(style=patchnogrid,projection=.9):
a:=plot3d(-x^2-y^2-x*y,x=-1..1,y=-1..1,color=[.5,.9,.9],grid=[15,15]):
b:=n->display(a,orientation=[n,60]):
####
display([seq(b(10*n),n=0..35)],light=[90,-80,1,.2,.1],light=[90,40,1,.5,.8],insequence=true);
display([seq(b(10*n),n=0..35)],light=[90,40,1,.5,.8],insequence=true);
display([seq(b(10*n),n=0..35)],light=[90,-80,1,.2,.1],insequence=true);

In Maple 2019 the first two outputs were identical so follows the rule as explained in the passage I quoted above.

In Maple 8, however, all three outputs were clearly different.

@ecterrab I observed the following behavior when trying to install Physics Updates 426 and  428 from the cloud.

Downloading finished, but installing didn't seem to ever finish. In both cases I ended up closing Maple.

After opening again it appeared in both cases that the update was installed.
It would be more comforting if the window would report "Finished" or equivalent.

@dharr In Maple 12 I tried your code. The only problem came from writedata since cat(currentdir(),"/testfile.txt" )

came up with "C:\Program Files\Maple 12/testfile.txt".

@vv Yes, your last comment is worth mentioning:
 

to N do
  c:=r(): b:=c*r(): a:=b*r(); n:=rn():
  if (fn) then OK:=OK+1 else ex:=[a,b,c,n]; break fi
od:
'OK'=OK,'N'=N, 'counterexample'=ex;
fn; #seeing the false inequality

Since the counter example is found for n=1 it is worth looking at the inequality for n = 1.
There for b > a it is equivalent to a+b > c, which is obviously not a consequence of the assumptions a<b<c.

@torabi Supposing that your initial conditions are really meant to contain the function itself and its first and second time derivative, then the syntax would be:
 

ics := T(x, 0) = 300, D[2](T)(x, 0) = 0, D[2, 2](T)(x, 0) = 0;

and a numeric approach could start with:
 

restart;
pde :=  10*diff(T(x, t), x, x) +9.000000000*10^(-10)*diff(T(x, t), x, x, t) = 1200.0*diff(T(x, t), t) + 1.020000000*10^(-8)*diff(T(x, t), t, t) + 4.335000000*10^(-20)*diff(T(x, t), t, t, t);
bcs := T(0, t) = 300, T(10, t) = 300;
ics := T(x, 0) = 300, D[2](T)(x, 0) = 0, D[2, 2](T)(x, 0) = 0; 
pdsolve(pde,{bcs,ics},numeric);

This produces a rather puzzling error though, probably having to do with an internal rewriting as a first order system in time.
Now trying that ourselves (and using part of the code above):

pde1:=diff(T(x,t),t)=T1(x,t);
pde2:=diff(T1(x,t),t)=T2(x,t);
pde3:=subs(pde1,pde2,pde);
ics_sys := T(x, 0) = 300, T1(x, 0) = 0, T2(x, 0) = 0;
pdsolve({pde1,pde2,pde3},{bcs,ics_sys},numeric);

This produces, however, the error:

Error, (in pdsolve/numeric/par_hyp) input system is too far from a 'standard' form (see ?pdsolve,numeric for more detail)

So you are out of luck, it seems.

 

 

@sarniberliana You can actually find an explicit formula for what Carl called F.

It involves LambertW. With that explicit representation you can test the results found by implicitdiff.
Here is a not very elegant way of doing that:
 

restart;

Sys:= {
   F = 
      c*(r-1)*exp(x*beta)/((1+varphi*exp(x*beta))
      *(-varphi*exp(x*beta)*r+varphi*exp(x*beta)+1)),
   c = exp(exp(x*beta)*(r-1)/(1+varphi*exp(x*beta))),
   ln(r) = varphi*exp(x*beta)*(r-1)/(1+varphi*exp(x*beta))-1
};
Vars:= {F, c, r}(beta, varphi, x);
## The derivative of F w.r.t. beta in terms of c, r, beta, varphi, and x:
Fbeta_imp:=rhs(op( implicitdiff(Sys, Vars, {F}, beta) ));
## Now solve the system:
sol:=solve(Sys,{c,F,r});
F2:=subs(sol,F);
## An explicit formula for the derivative w.r.t. beta:
Fbeta:=diff(F2,beta): # Large
## Another explicit formula for the derivative w.r.t. beta is obtained from the implicit version:
Fbeta_imp2:=eval(Fbeta_imp,sol): # Large
resB:=simplify(Fbeta_imp2-Fbeta,size); ## Hopefully this is actually zero, but ...
##
indets(resB,name);
evalf[20](eval(resB,{x=1.234,beta=2.9,varphi=3.7})); # A spot check

@itsme Yes, the space(s) to the left of the escape character \ is(are) ignored by the translator so you get function application:
 

convert("a \[lambda]",FromMma);

The output is a(lambda), thus in case a = 2 you get 2.

@Mariusz Iwaniuk 
Actually your computations work if you just assume a>0 and n>1/2.
Also Maple returns a result right away with those assumptions:
 

A:=Int(ln(a^2+x^2)/(a^2+x^2)^n, x = 0 .. infinity);
res:=value(A) assuming a>0,n>1/2;

The result returned appears to be only valid for 1/2 < n < 1 though.
If you add that assumption, i.e. do
 

value(A) assuming a>0,n>1/2,n<1;

then the result looks shorter. If you try n >1 instead then the integral is returned unevaluated.

Your worksheet only contains this input:
 

w := 1/2*(beta*eta^2*y + 2*eta^2*y + 2*A*beta + 2*A)/kx + C1*exp(k*y) + C2*exp(-k*y) + C3*exp(-I*k*y) + C4*exp(k*y*I);

I don't see any ode or BCs.

@mmcdara In order to avoid the existence of several local variants of a variable place all assumptions at the beginning, at least before making assignments involving the variables in the assumptions.
As in

assume(r > 0,R>0,R>=r,x__Q>0,d>-R-2*r,d<R);

But I much prefer using assuming rather than assume. Then you don't have that kind of problem.
The assume facility is not perfect either, of course.
Using assuming in your second attempt:
 

restart:
interface(rtablesize=10):
with(geometry):
_EnvHorizontalName := x: _EnvVerticalName := y:
point(P,0,0);
circle(A,[P, R]) assuming R>0;

 

@Zeineb If the result of the solve command is called res (say), then res will be a sequence having (as it turns out) 4 elements.
To see that just do:  nops( [res] );
res[1] and res[2] are the trivial solutions:
The next two both involve RootOf. (see ?RootOf).
You could say they are just reformulations of the two equations in your input.
You probably won't be able to simplify those in any significant way.
I'm afraid that your equations can only be solved numerically or in special cases where some of the parameters are known.
For a numerical solution you need to know all the parameters.
For the numerical solution you can use fsolve, but can also use the RootOf results as illustrated here:

params:=indets({firstequation,secondequation},name) minus {rho1,rho2,N}; # N treated separately
## Example: All parameters except N are 1 and N=2:
eval(res[3],(params=~1) union {N=2});
evalf(%); # result: {rho1 = .6288883452, rho2 = .6288883452}
eval(res[4],(params=~1) union {N=2});
evalf[20](%); # {rho1 = -.42264973081037423549+1.5788764000904431175*10^(-20)*I, rho2 = 1.}



 

@acer I couldn't find the option 'real' documented. Is it?

@ Sorry, I overlooked that.
Now I see that you have a boundary value problem on the interval 0 .. H-He.
The parameters option in dsolve is only available for initial value problems so the way you are handling the problem seems fine to me. The whole thing runs if you make the change to SYS as discussed above:
 

## All your code above the next line assumed here !
unassign(sv,sh,L,Jir,u):

sys_ode:=
 diff(sv(x),x)=rho0*g/L(x),
 diff(sh(x),x)=Fhp1*diff(L(x),x)/L(x)+Fhp2*diff(Jir(x),x),
 Fvp1*diff(L(x),x)+Fvp2*L(x)*diff(Jir(x),x)=rho0*g,
 diff(Jir(x),x)/Jir(x)=-Gp1*diff(L(x),x)/L(x)-Gp2*diff(Jir(x),x),
 diff(u(x),x)=-Mp*g/(Fvp1+Fvp2*L(x)*diff(Jir(x),x)/diff(L(x),x)):
##
dvars:=indets({sys_ode},specfunc(anything,diff));
SYS:=solve({sys_ode},dvars):
##
dt:=(Ts-Te)/nnp:
t:=Te:
H:=He:
lx0a:=Le:
Jirx0a:=Jire:
##
for i from 1 to nnp+1 by 1 do
   lprint(i,H-He); # Just to see H-He
   ics:=sv(H-He)=sve,sh(H-He)=she,L(H-He)=Le,Jir(H-He)=Jire,u(0)=0:
   sol:=dsolve(SYS union {ics},numeric,output=listprocedure):
   SV,SH,LA,JIR,U:=op(subs(sol,[sv(x),sh(x),L(x),Jir(x),u(x)])):
   tmy:=t/(10^6*365*24*60*60):
   lx0:=LA(0):
   Jirx0:=JIR(0):
   phix0:=1-(1-phi0)/Jirx0:
   shx0:=SH(0)/10^6:
   svx0:=SV(0)/10^6:
   pcx0:=(pc0*(ln(phix0)/ln(phi0))^m)/10^6:
   pvx0:=(pv0*(ln(phix0)/ln(phi0))^n)/10^6:

   up:=U(H-He):
   uh:=ue+up:
   fvpx0:=evalf(A*shx0+B*svx0-pvx0):

   if fvpx0>=0 then
     break
   else
     dH:=dt*(Mp/rho0+uh):
     H:=H+dH:
     t:=t+dt:
   end if:
end do:

 

This is obviously a bug. Not many, if any,  would have any use for that print.

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