Preben Alsholm

13471 Reputation

22 Badges

20 years, 263 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@torabi From your previous questions it appears that you do know how to specify an approximate solution. See also the help page for dsolve,numeric,bvp where the optional argument approxsoln = ... is described.

I think that you mean which approximate solution would be an approiate one, i.e. will lead to convergence.So use any knowledge or expectation you have for the solution in setting up a guess (an approximate solution). I don't have any suggestion, but try yourself.
 

The immediate problems that you are facing as pointed out by Tom Leslie are the proper installation of Douglas Meade's Shoot library from MapleSoft Application Center.
Once that is done correctly and once you know exactly, where you installed it, you also need to replace ODE by ODE1, where
ODE1:=solve(ODE,indets(ODE,specfunc(diff)));
the point being that ODE1 has the derivatives all isolated on the left.
In ODE you have this equation (the last):
diff(fppp(eta), eta) = N1*(3.*fpp(eta)+(eta-2.*f(eta))*fppp(eta)-2.*N2*N2*m(eta)*(diff(mp(eta), eta)))

In that equation a differentiated function appears on the right.

I had success with this call:
shoot(ODE1,IC,BC,FNS,[beta1=.1,alpha1=.1,beta2=.1,beta3=1,alpha2=1]);

@John SREH If you take a look at eq, then you see three terms starting with fourier.

The last one fourier(y(t),t,w) we must consider the unknown function (agreed?), but the two other fourier terms are not directly related to Y(w)=fourier(y(t),t,w).
Do you have an ode in Y(w)? That is not at all obvious, even if it were true.
There is no way you are going to get dsolve to succeed with that equation.
####
You will have success with equ, though:

sol := dsolve({csi, equ}, numeric);
plots:-odeplot(sol,[t,y(t)],-1.4..2.0367);

 

It is a nice image, but what are we supposed to do with it? Give us code, not images.

@9009134 Sorry, I have no ideas. Maybe this problem simply doesn't have a nontrivial solution, here meant as a solution for which also F,K,Omega, besides theta, are nonzero in the interior of the interval.

You write " The objective is y2 at t =1." and yet you have z2:=sol1(0.5);
Shouldn't that be z2:=sol1(1);  or am I misunderstanding something?
This is surely irrelevant for the question you pose, but confuses me.
##
I think I got it: You are resetting the clock and starting anew, so the new time just has to run 0.5 for the total time to be 1.
I tried this piecewise version which, however, doesn't improve Hesse.
 

sysp:=diff(y1(t),t)=-piecewise(t<=0.5,u1+u1^2/2,u2+u2^2/2)*y1(t),
           diff(y2(t),t)=piecewise(t<=0.5,u1,u2)*y1(t);
res:=dsolve({sysp,y1(0)=1,y2(0)=0},numeric,parameters=[u1,u2],output=listprocedure);
Y2:=subs(res,y2(t));
obj4:=proc(u1,u2) 
   res(parameters=[u1,u2]);
   -Y2(1)
end proc;

 

@9009134 My doubts about the solution were expressed in my comment above:
http://www.mapleprimes.com/questions/218706-Error-in-Dsolvenumericbvp-Singularity#comment232672

entitled "Plot, approxsoln, and is it a solution?".

## It may be worth while mentioning that the result of this test:

odetest({F(eta)=0,K(eta)=0,theta(eta)=1-eta,Omega(eta)=0},SYS);

is  {0}, which means that the solution given, i.e. {F(eta)=0,K(eta)=0,theta(eta)=1-eta,Omega(eta)=0} is in fact a solution to SYS according to odetest. We should, however, remember the troublesome denominators K(eta) and Omega(eta).

@9009134 Since I'm not at all convinced about the "solution" found in the first case, I found it hard to summon interest for the second, I must admit. No reason to consider new parameters that also give problems, when you haven't successfully solved the first case.

@torabi I believe that there is no positive minimum.
Consider again the example I gave above.
I have modified it to fit your situation better:
 

restart;
ode:=diff(y(x),x,x)-omega2=0; #-1.2345 changed to 1 for convenience 

for b in [seq(10^(-n),n=0..10)] do
  res:=dsolve({ode,y(0)=0,y(1)=0,D(y)(1)=b},numeric);
  print(subs(res(0),omega2))
end do:
##Basically what goes on in the numerical solution with a parameter to be determined (here omega2) is this:
ode1:=subs(omega2=omega2(x),ode);
ode2:=diff(omega2(x),x)=0;
b:='b':
dsolve({ode1,ode2,y(0)=0,y(1)=0,D(y)(1)=b}); 

It is really just enough to look at the output from the exact version at the end:
{omega2(x) = 2*b, y(x) = b*x^2-b*x}
There is clearly no positive minimum for omega2. The nonnegative minimum exists and is 0, but it corresponds to y(x) = 0 for all x in 0..1.
I believe you have the same situation.

The syntax is
int(a(t)*b(t)+2*(diff(a(t), t))*(diff(b(t), t)), t);
But what did you expect to get out of it?

@9009134 I don't quite see the connection of the two equations in the paper to your problem. The equations in the paper are
 

ode1:=diff(f(eta),eta$3)+1/Pr*(3*f(eta)*diff(f(eta),eta,eta)-2*diff(f(eta),eta)^2)+1=0;
ode2:=diff(theta(eta),eta,eta)+3*f(eta)*diff(theta(eta),eta)=0;
bcs:=f(0)=0,D(f)(0)=0,(D@@2)(f)(etad)=0,theta(0)=1,theta(etad)=0;

Your system has F, K, Omega, and theta with orders 3, 2, 2, and 2, respectively.

Is there any relationship between f and theta above and F,K,Omega, and theta in your system? If so, what is it?

The system in the paper is easily solved numerically at least in this case (etad=1,Pr=7):

restart;
ode1:=diff(f(eta),eta$3)+1/Pr*(3*f(eta)*diff(f(eta),eta,eta)-2*diff(f(eta),eta)^2)+1=0;
ode2:=diff(theta(eta),eta,eta)+3*f(eta)*diff(theta(eta),eta)=0;
bcs:=f(0)=0,D(f)(0)=0,(D@@2)(f)(etad)=0,theta(0)=1,theta(etad)=0;
res:=dsolve(eval({ode1,ode2,bcs},{etad=1,Pr=7}),numeric);
plots:-odeplot(res,[[eta,diff(f(eta),eta)],[eta,theta(eta)]]);

 

@J4James Whether you are using one program or the other the dependence on f0 is quite apparent.
Here in Maple:
 

restart;
ode1:=diff(f(x), x,x)+(f(x)+g(x))*diff(f(x),x)=0;
ode2:=diff(g(x), x,x)+(f(x)+g(x))*diff(g(x),x)=0;
ics:=f(0)=f0,g(0)=1-f0,D(f)(0) =0,D(g)(0) =1;
res:=dsolve({ode1,ode2,ics},numeric,parameters=[f0]);
p:=proc(f0) res(parameters=[f0]);
   plots:-odeplot(res,[[x,f(x)],[x,g(x)]],0..5)
end proc; 
plots:-animate(p,[f0],f0=-1..1);

 

If you happen to be only interested in h(x)=f(x)+g(x), then it is a different matter, but then why all this complication? Because then you only have one ode:
 

simplify(eval(ode1+ode2,f(x)=h(x)-g(x)));

This ode is second order in h and you just need two initial conditions for h:

h(0)=1, D(h)(0)=1.
 

@J4James To answer your two questions:

1. You can (in principle, but there may be numerical problems) choose any value for f0 you like including of course negative values.
2. If you are only going to use one or very few different values of f0, then it won't make much of a difference, but if you are going to find the solution for many values of f0, then using the parameters option is much more efficient.

I wonder though, what kind of physical, chemical, or whatever, setup you have, where it doesn't matter which value f0 has. The system you gave us is a trivial example of a more complicated one, I understand. But I wonder why there is such an indifference in your baby example. Is that present in the complicated one as well?

@shakuntala nops(m,n,p) is never valid syntax in Maple since nops only takes one argument, and you are giving it 3.
You have an unfinished sentence:
"... if it is not then how can we represent "
What did you want to represent?

@jessica99 I did this in Maple 8.00:

V:=A*exp(-b*abs(r)^1.5)*abs(r)^a;
H:=R0+R1*abs(sin(c*theta/2))^d;
Vp:=1+r^2*A1*sin(p*theta);
params:=[a=0.5,b=0.15,A=2,c=5,d=0.5,R0=0.5,R1=0.5,p=15,A1=0.05];
plot3d(eval([H*r*cos(theta),H*r*sin(theta),V+Vp],params),theta=0..2*Pi,r=-1..1,style=patchnogrid);

First 67 68 69 70 71 72 73 Last Page 69 of 225