Preben Alsholm

13733 Reputation

22 Badges

20 years, 259 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Markiyan Hirnyk There are (at least) 2 solutions for Q. For N=22 fsolve(Q,0) gave the negative one.
With fsolve(Q,0.002) we get the positive one.
I added a remark to my answer above.

Runge-Kutta methods are used for solving initial value problems. You have a boundary value problem.
So please elaborate.

@Preben Alsholm I tried the continuation I mentioned above, but had only success with A1=4.5.
So just a slight improvement from A=0.43 obtained without continuation.
Then I tried using the result obtained for A=0.45 by continuation from A=0.2 as an aproximate solution for the problem with A=0.5. It didn't work. But I was unpleasantly surprised to find that the continuation solution didn't even work when A=0.45! That is: I'm handing dsolve the solution, but yet it cannot find the solution with that as a start!!

sys:=eval({Eq1, Eq2, Eq3, Eq4, Eq5, Eq6, bcs1},A=0.2*(1-c)+c*0.45);
res:=dsolve(sys, [f(eta), F(eta), G(eta), H(eta), theta(eta), theta1(eta)], numeric, output = listprocedure,continuation=c); #Works
plots:-odeplot(res,[[eta,diff(f(eta),eta)],[eta,F(eta)]],0..blt,linestyle=3);
#Now dsolve is given sys with A=0.45 the approximate solution (res) found above for A = 0.45 by continuation from A=0.2, yet we get the usual error:
res2:=dsolve(eval({Eq1, Eq2, Eq3, Eq4,Eq5,Eq6,bcs1}, A = 0.45),numeric, output = listprocedure,approxsoln=res); #Does not work!!

 


spline is deprecated, use Spline from the CurveFitting package.
Maybe you could use CurveFitting:-ArrayInterpolation?

@cloz54 Cutting and pasting your module definition into my version of Notepad and saving it as a textfile. Reading it into Maple 18 I got

                     "Est?n en perspectiva"
                      "Spain means Espa?"
Actually the question marks appeared as squares.

I also tried executing the moduledefinition in Maple, saving it using
save TestModule,"F:/MapleDiverse/MaplePrimes/testmod.mpl";

and then reading it into a fresh worksheet:

read("F:/MapleDiverse/MaplePrimes/testmod.mpl");

Then I got:
with(TestModule):
test();
                     "Están en perspectiva"
                      "Spain means España"
                               0


@Axel Vogt I tried the following. All had the same result on my computer:

print("Están en perspectiva");
p:=proc() print("Están en perspectiva") end proc;
p();
m:=module() export p; p:=proc() print("Están en perspectiva") end proc; end module;
m:-p();
Q:=proc() module() export p; p:=proc() print("Están en perspectiva") end proc; end module end proc;
m:=Q();
m:-p();

I tried various interpretations of what you are saying, but have not encountered any problem. Could you give us the full code necessary for exhibiting this behavior?

@love maths You could try this:

This illustrates that the elements affected by Average are the elements inside a square:
plots:-implicitplot(abs(x-N/2)+abs(y-N/2)-N/4=0,x=0..N,y=0..N,rangeasview,gridrefine=2);
#That square has vertices (N/4,N/2),(N/2,N/4),(N/2,3*N/4),(3*N/4,N/2), which is confirmed by F which returns 0 at those points:
F(N/4,N/2),F(N/2,N/4),F(N/2,3*N/4),F(3*N/4,N/2);
#A little experimentation:
A:=curry(Average,F);
seq((A@@i)(f0),i=0..5);
#Guess: The sequence converges to a matrix of ones.
#This guess is confirmed by (but certainly not proved by)
f:=f0: f1:=Matrix(N,fill=1):
for i from 1 to 500 while LinearAlgebra:-Norm(f-f1)>1e-12 do f:=A(f) end do:
i-1;
evalf[12](f);


@mablecat I repeated the commands and made sure that I used Maple 17. Still no problem:

interface(version);
Standard Worksheet Interface, Maple 17.02, Windows 7, September 5 2013 Build ID 872941


@Carl Love I was surprised that the square brackets you have after D in the intital conditions actually work.
However, I corrected that and used your system:

restart;
sys:={diff(a[1](t),t$2) = -a[1](t), diff(a[2](t),t$2) = -a[2](t),a[1](0)=1, a[2](0)=0, D(a[1])(0)=0, D(a[2])(0)=1};
#Analytical solution
dsolve(sys);
#Info on events:
?dsolve,events
#Example of using events. These two events will trigger when a[i](t) = 0 i=1..2. The discrete variables b1 and b2 will be taking the values for t at those times.
sysE:=sys union {b1(0)=0,b2(0)=0};
SolE:=dsolve(sysE,numeric,discrete_variables=[b1(t)::float,b2(t)::float],events=[[a[1](t),b1(t)=t],[a[2](t),b2(t)=t]]);
SolE(6);
plots:-odeplot(SolE,[[t,b1(t)],[t,b2(t)]],0..6,thickness=2);


I shall try to see if I can upload anything. So here is an extremely short mw-file.

Well, I cannot do it either. MaplePrimes has temporary problems.

@sharena2 Well, you do need one more condition. Not necessarily the one I used.
If you have tried the same problem earlier and it was OK then you ought to show us that "same" problem:
It couldn't be the same, could it?

@mehdi jafari This is clearly a bug in int. The infinite series found is incorrect. However, Maple correctly finds the sum of the incorrect series.

restart;
A:=Int(cosh(t)/(cosh((17/15)*t)+cosh(t)), t = 0 .. infinity);
evalf(A);
infolevel[int]:=5:
#The "successful" method is meijerg. int(...., method=NoMeijerg) returns unevaluated.
S:=value(A);
evalf(S);
value(S);
evalf(%);



@mehdi jafari You are actually doing numerical integration in both cases here. After having used simplify int returns unevaluated. After that evalf is applied to the unevaluated integral and Maple uses numerical integration.
Try removing evalf from evalf(int(f,t=0..infinity)) and you will see.

 

First 146 147 148 149 150 151 152 Last Page 148 of 230