Message Boards Message Boards

NDSolve error: Cannot solve to find an explicit formula for the derivatives

Posted 11 months ago

In the attached notebook it is able to solve the first set of coupled differential equation without any issues. If I remove the terms that have f i.e. f=0 the error NDSolve::ntdvdae: Cannot solve to find an explicit formula for the derivatives. NDSolve will try solving the system as differential-algebraic equations. pops up. Any solutions would be appreciated.

Attachments:
POSTED BY: Anand Mathew
6 Replies

At a glance one can see that the highest order derivatives for \[Mu]1 and P1 occur only in one equation, eqn6. Further, eqn5 involves only lower order derivatives (orders 1, 0, resp) of \[Mu]1, P1. So there are only two equations involving the three highest-order derivatives, eqn4 and eqn6. Consequently NDSolve "cannot solve to find an explicit formula for the [highest-order] derivatives." A simple fix is to differentiate eqn5. We also need to remove the initial value for P1'[0], since it is determined by the equations.

a1 = 1.38*10^10;
q1 = 1.6*10^-19;
\[Epsilon]1 = 8.85*10^-12;
\[Lambda]1 = 4*10^-9;
\[Mu]hat1 = 0.8*10^-20;
f1 = 0;
\[Beta]1 = 4.63*10^-44;
\[Alpha]1 = -80*10^-16;
M1 = 70*10^6;

eqn4 = (M1 - ((\[Alpha]1^2)/\[Beta]1)) u1''[
      y] + (\[Alpha]1/\[Beta]1)*\[Mu]1'[y] == 0;
eqn5 = D[a1*P1[y] - (1/q1)*\[Mu]1'[y] == 0, y];
eqn6 = \[Mu]1''[y] + (q1/\[Epsilon]1)*
     P1'[y] - (1/\[Lambda]1^2)*\[Mu]1[
      y] + (1/\[Lambda]1^2)*\[Mu]hat1 == 0;

sol = NDSolve[{eqn4, eqn5, 
   eqn6, \[Mu]1'[0] == 0, \[Mu]1[0] == -8*10^-21, P1[0] == 10,(*P1'[
   0]==0,*)u1[0] == 10^-9, u1'[0] == 0}, {\[Mu]1, P1, u1}, {y, 0, 
   10^-9}]

\[Mu]sol1[y_] := \[Mu]1[y] /. sol[[1]]
Psol1[y_] := P1[y] /. sol[[1]]
usol1[y_] := u1[y] /. sol[[1]]
POSTED BY: Michael Rogers
Posted 11 months ago

You have q in equations 5 and 6 that you probably meant to be q1.

I found those when I tried bumping the WorkingPrecision up to 128, which meant I had to adjust your machine precision constants, wondering if your wide variation in the sizes of your exponents might be behind the problem, and that gave

NDSolve The initialization of the method NDSolve`StateSpace failed.

That might be the hint that someone needs to let you know how to change methods.

Your wording is sort of implying that you are setting f=0 in your equations to get rid of terms. That might be fine when a term is multiplied by f, but you have two cases where a term is divided by f.The result of setting f to zero or taking the limit as f goes to zero for those is going to be very different. Do you actually mean that you are just removing terms and not considering what the value of f might be?

POSTED BY: Bill Nelson
Posted 11 months ago

I basically divided the equations by f thats why f is in the denominator. but the original equations have f in the numerator (I did that to make the coefficints of the derivatives as 1). So basically I wanted to see what changes in the plot as I input the value of f to be zero. This would gives the equation as in case 2. the equations in case 2 are derived setting f to be zero earlier. The values of q1 and q are same. Probably it is the method. Do you have any suggestions as to what method I can use?

POSTED BY: Anand Mathew
Posted 11 months ago

I understood that q and q1 had the same value. I was only looking for any and every tiny difference in the way the two sets of equations were written, hoping any tiny difference might uncover the problem.

Now to hopefully the more important part.

eqn4 == eqn1 as if f==0

eqn5 is eqn2 as if f==1 but not including the u''[x] term

eqn6 == eqn3

Is every bit of that correct? I really want to make certain everything is correct first.

Does the value of f really matter? Or are you just asking for solutions for two systems that might have some things in common, but whatever that might be makes no difference at all. Understanding that might help people look for what might be the source of the problem.

It isn't necessarily clear the steps that NDSolve might take transforming a system of equations on the way to a solution. Possibly leaving out some terms, by acting as if f==0 or by leaving out u''[x], might result in a system that lacks some key bits needed for that transformation to complete.

POSTED BY: Bill Nelson
Posted 11 months ago

Is it a simple typo? Should be Psol1[x] rather than Psol[x]?

Plot[{Psol1[x]}, {x, 0, 10^-9}, PlotLegends -> {"P(x)"}]
POSTED BY: Rohit Namjoshi
Posted 11 months ago

It still shows the same! I was trying something thats why the typo came in. Still getting the same error.

POSTED BY: Anand Mathew
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract