Preben Alsholm

13728 Reputation

22 Badges

20 years, 251 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Lulu I had success with the following (in Maple2015):

pf:=factor(g);
q:=op(-1,pf);
fsolve(q,p,complex);

Maybe the fact that p=0 is a root of order 5 gives some problems.

This works too:

q1:=pf/p;
fsolve(q1,p,complex);

and (less interesting):
fsolve(g+1,p,complex);





@torabi In approxsoln a comma is missing between the expressions for f4 and f5.

If you correct that you get quite a lot of successes:

indx;
    ((D@@2)(f3))(1), ((D@@3)(f3))(1), (D(f1))(1), ((D@@2)(f2))(0), ((D@@2)(f5))(0), (D(f6))(1), ((D@@2)(f2))(1), ((D@@3)(f3))(0), (D(f6))(0), ((D@@2)(f3))(0), ((D@@2)(f5))(1)

@Just_Some_Guy You are still not giving us f.

You ought to give us the whole code. What is f,  z_min ?

Could you explain in some other way what it is you want to do? I don't have a clue.

@torabi So what is the question?

@Markiyan Hirnyk Yes, making assumptions may help, but this version

value(I5) assuming x0>0;

produces the result I mentioned.

Your version most likely just evaluates the signum factor:
res:=evalc(value(I5)) assuming x0>0;
indets(res,name);
         {x0, infinity}
evalf(eval(res,x0=1));
         Float(infinity)+Float(infinity)*I
  

@torabi I see that you completely ignored my advice given above.

@torabi You have the following lines, but you don't look at the output. You should!

indets(sys,specfunc(diff)); #Semicolon
## and later
indets(newsys,specfunc(diff));

Notice that the order of the highest derivative of f6 in sys is 2, whereas it is 3 for newsys.
You should avoid differentiating any equation that will increase any of the highest orders of f1,f2, ..., f6.




Right click on the link you have to Steen Markvorsen's file. Choose save as. Open it from within Maple. That worked fine for me.

Let me add that you can solve numerically:

ode := diff(Y(x), x$4) = a^4*Y(x);
ics := Y(0) = 0, D(Y)(0) = 0, Y(l) = 0, (D@@2)(Y)(l) = 0;
ode4:=subs(a^4=a4,ode);
resnum:=dsolve(eval({ode4,ics,(D@@2)(Y)(0)=1},l=2),numeric);
resnum(0);
subs(resnum(0),a4);
%^(1/4); #Same as a2 in the symbolic version
plots:-odeplot(resnum,[x,Y(x)],0..2);
#You can get get the next one by giving an approximate solution:
resnum2:=dsolve(eval({ode4,ics,(D@@2)(Y)(0)=1},l=2),numeric,approxsoln=[a4=4^4,Y(x)=sin(Pi*x)]);
resnum2(0);
subs(resnum2(0),a4);
%^(1/4); #Same as a22
plots:-odeplot(resnum2,[x,Y(x)],0..2);

@patient Since your system is somewhat difficult to examine analytically it may be worthwhile to consider the following example, which can be analyzed analytically and which exhibits similar nonuniqueness features.

restart;
ode1:=diff(v(x),x)=-2*u(x)*sqrt(v(x));
ode2:=v(x)*diff(u(x),x)=0;
dsolve({ode1,ode2,v(0)=1,u(0)=1});
simplify([%]) assuming x<1;
odetest({v(x)=0,u(x)=u(x)},[ode1,ode2]);
#Now picking as an example u(x) as a polynomial or order three and making sure it meets u(x)=1 and u(x)=-1 differentiably at x=1 and 2, respectively:
f:=x->a*x^3+b*x^2+c*x+d;
solve({f(1)=1,D(f)(1)=0,f(2)=-1,D(f)(2)=0},{a,b,c,d});
U12:=eval(f(x),%);
##Piecing a solution together:
U:=piecewise(x<1,1,x<2,U12,-1);
V:=piecewise(x<1,(x-1)^2,x<2,0,(x-2)^2);
plot([V,U],x=0..3,thickness=3,legend=[v(x),u(x)]);

odetest({u(x)=U,v(x)=V},[ode1,ode2]);
#########
## The numerical solution must stop just before 1:
res:=dsolve({ode1,ode2,v(0)=1,u(0)=1},numeric);
plots:-odeplot(res,[[x,v(x)],[x,u(x)]],0..3);


@patient 

1. Using events=[[v(x)=0,halt]] will not have any effect because dsolve/numeric sees the singularity before v(x) = 0 is discovered by 'events'.


It doesn't really make sense to continue the solution after the singularity at x0 as v(x)=0 and u(x)=0 because u(x0) > 0 (and not at all negligible). Thus u will not even be continuous at x0.
What does make sense is to continue the solution for v as v(x) = 0 and then u(x) as anything you like as long as it is differentiable at x0. As we can see from SYS, if v(x)=0 on an interval then it doesn't matter what u(x) is.
Then you will have a solution (v(x), u(x)) that is differentiable. v may not be twice differentiable at x0 though.

2. If you accept that v may not be twice differentiable at x0 then clearly you have nonuniqueness of solutions to the initial value problem on the interval, say -2..2.

Finally, the argument so far relies on the numerical evidence that v(x) and diff(v(x),x) both are zero at x0. That should be examined further.

@patient If you continue v(x) after the singularity (where v(x)=0 and diff(v(x),x) = 0) as v(x) = 0, then u(x) is allowed to be anything.
At x=-.32359993 we have
p(-.32359993);
 u(-.32359993) = 2.73502343609418, v(-.32359993) = 1.32767909590572*10^(-17), D(v)(-.32359993) = -3.07963458440924*10^(-8)

and if v(x)=0 after that then

eval(SYS,v(x)=0);
     {0=0}

thus u(x) can be anything! Just continue it as you please, preferably as a differentiable function.


I don't see how you can avoid the singularity that is actually there. Do you just want to continue from the singularity at x=-.32434965 with u(x) = 0, v(x)=0 ?

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