Preben Alsholm

13728 Reputation

22 Badges

20 years, 251 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@farzane What I start by doing is to show that the equation eq is satisfied by both y=y1=yc*f/(2*E) and by y=y2=yc*x^2. Thus if eq has a unique solution for each given x and ya, then there is no solution (ya(x),yc(x)) to the system of integral equations {eq1, eq2}.
Finally, I give graphical evidence that the equation eq has a unique solution for ya and x given.

@Al86 I'm not sufficiently motivated to use more effort on this topic at least for now. Partly because I shall move to my winter quarters in a few days just like the birds.

@MDD Here is a simple example:

restart;
for k from 1 to 10 do is(b<>0) assuming b^k<>0 end do;

You notice that you receive 'true' for k=1,2,4  but FAIL otherwise.

You might ask, how can 'is' be in doubt whether b=0 or not, if e.g.  b^3<>0  ?
Allowing for the fact that in the short session above b could stand for anything, I cannot conceive of a situation where the third power of whatever could be different from zero if the 'whatever' itself is zero (in the proper meaning of zero in the 'whatever' context).

restart;
assume(b^3<>0);
is(b<>0);
    FAIL

## I think that inequalities (i.e. < ,>, not <> ) are handled much better by the system:
restart;
assume(b^3>0);
is(b<>0); #Answer: true
is(b>0); #Answer: FAIL, which is fine in view of e.g. this example:

b:=exp(2*Pi/3*I);
expand(b^3); # =1 and thus > 0.




@Carl Love The color of the the curly bracket is grey in %piecewise and blue in the other two.

@Carl Love Agree. Indeed the printing could be done by a direct use of `print/piecewise` :

`print/piecewise`(``, x+y-2*z = 1, ``, 2*x+y-3*z = 5, ``, -x+y+z = 1);

or by using unevaluation quotes around piecewise:

'piecewise'(``, x+y-2*z = 1, ``, 2*x+y-3*z = 5, ``, -x+y+z = 1);


@Kitonum The simpler

add(add(a[i,j]*f[i,j], j=1..2), i=1..2);

works too.

This must be a solve problem. dsolve has to use solve.
Using the option implicit=true (or just 'implicit') produces the correct implicit result.
restart;
res:=dsolve({ diff(y(t),t) = y(t)^2 - y(t)^3, y(0) = 1/10 },implicit);
eval(res,{t=0,y(t)=1/10});
odetest(res,{ diff(y(t),t) = y(t)^2 - y(t)^3, y(0) = 1/10 });
plots:-implicitplot(eval(res,y(t)=y),t=-10..20,y=0..1,gridrefine=1);
##Trying to solve for y:
res2:=solve(res,y(t));
evalf(eval(res2,t=0));#Wrong
dsolve({ diff(y(t),t) = y(t)^2 - y(t)^3, y(0) = 1/10 });
evalf(eval(%,t=0)); #Same thing

#I didn't experiment enough to ever get the correct result you mention. I only got the RootOf-expression

####Continuing with the implicit result to get the correct one:
combine(res) assuming y(t)<1,y(t)>0;
evalc(%) assuming y(t)<1,y(t)>0;
res3:=solve(%,y(t));
plot(res3,t=-10..20);



@Adri van der Meer He is referring to the loop beginning with for b in extra_bc.

That loop doesn't provide a successful index, i.e. a successful extra boundary condition as it is. As you say, he already has a success before the loop.

The loop will catch that success too, if b=1 is replaces with b=10^(-7) and initmesh is set to 256.

Note. If the scaling of f2 by 10^(-7) is removed and initmesh is set to 512 then he gets 7 successes. The corresponding scaled omega2 values are 6.05330544938177 for 5 of them and 3.16869987517702 for the remaining 2.
 

@Axel Vogt Thanks for providing Maple code for Brent's method. An alternative to fsolve is needed occasionally.

@tomleslie
Just a comment.
When I try your nice worksheet with method=branchandbound in NLPSolve I get the A value
199.961306129991433460308124778
with a minimum of approximately 8e-30. It takes longer though.

When can we expect to see something done about the spam?

Is it actually being worked on by somebody?

From looking at the image I don't see any syntax errors. But I'm surprised that pdsolve returns unevaluated as if in that session of yours pdsolve was not known to the system.
(The error messages later are due to the fact that pdsolve returned unevaluated).
The spatial range given doesn't agree with the implied range r=0.00035..0.00040, and that should in fact result in an error.
Take this example from the help page:
?pdsolve,numeric
PDE := diff(u(x,t),t)=1/10*diff(u(x,t),x,x);
IBC := {u(x,0)=1, u(0,t)=0, D[1](u)(1,t)=0};
pds := pdsolve(PDE,IBC,numeric,range=-1..1); #I added a larger range than the implied 0..1

Error, (in pdsolve/numeric/par_hyp) values in range argument must match input boundary conditions

It is much easier to spot problems in an actual worksheet rather than in an image.

@Carl Love Maybe I misunderstand you, but I think it is the other way around. To find out I did the following (very unwise).

Note: The library archive BVPtools was created by me.

unprotect(solve);
solve:=proc() print("The answer is: "); 89 end proc;
savelibname:="E:/BVPtools/BVPtools.mla";
savelib(solve);

##### In a fresh worksheet I did:
libname:="E:/BVPtools",libname;

solve(x^2=1,x);
                       "The answer is: "
                               89
## I shall remove that definition of solve right away, although it returns rather consistent results.


@Carl Love Why not prepend? 
Actually, I have always used this version:

libname:= "C:/Maple_packages", libname;

So what could go wrong?

@roya2001 I apologize for overlooking the code. Anyway, remove everything after that. You see 2 successful indices.

First 102 103 104 105 106 107 108 Last Page 104 of 230