# System of differential equations with many initial conditions [closed]

I am newbie to Mathematica and I want to solve such system using NDSolve:

I tried this: NDSolve[eqls, {y, z, w}, {x, -30, 30}], where eqls is all my equitations, but I get such exception:

NDSolve::ndnco: The number of constraints (6) (initial conditions) is not equal to the total differential order of the system plus the number of discrete variables (4).

Here my equations (all constants are initialized before):

eps = 0;
eqn1 = D[y[x], {x, 2}] - y[x]  + F w[x] == eps;
eqn2 = d D[z[x], x] - z[x] + (1 - F) w[x] == eps;
eqn3 = c D[w[x], x] + r0 (1 - w[x]) (y[x] + z[x]) == eps;
eqn4 = y[-30] == F;
eqn5 = z[-30] == 1 - F;
eqn6 = w[-30] == 1;
eqn7 = {y[30], z[30], w[30]} == {0, 0, 0};
eqls = {eqn1, eqn2, eqn3, eqn4, eqn5, eqn6, eqn7}


How can I resolve this problem?

## closed as off-topic by Alexey Popkov, MarcoB, LLlAMnYP, bbgodfrey, EdmundNov 7 '17 at 2:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Alexey Popkov, MarcoB, LLlAMnYP, bbgodfrey, Edmund
If this question can be reworded to fit the rules in the help center, please edit the question.

• In NDSolve there should not be any unknown constants. Give numerical values to F, d, c and r0 – m. bubu Oct 20 '17 at 17:06

I believe you have a typo in eqn2 because your code disagrees with your Latex and ,x should probably be ,{x,2}.

Changing that, this

F = 1/3; d = 1/4; c = 1/5; r0 = 1/6; eps = 0; b = 3;
eqn1 = D[y[x], {x, 2}] - y[x] + F w[x] == eps;
eqn2 = d D[z[x], {x, 2}] - z[x] + (1 - F) w[x] == eps;
eqn3 = c D[w[x], x] + r0 (1 - w[x]) (y[x] + z[x]) == eps;
eqn4 = y[-b] == F;
eqn5 = z[-b] == 1 - F;
eqn6 = w[-b] == 1;
eqn7 = {y[b], z[b]} == {0, 0};
eqls = {eqn1, eqn2, eqn3, eqn4, eqn5, eqn6, eqn7};
sol = {y[x], z[x], w[x]} /. NDSolve[eqls, {y[x], z[x], w[x]}, {x, -b, b}];
g1 = Plot[sol, {x, -b, b}]


displays this

after a minute.

If I add the second initial condition on w[b], bringing the total number of initial conditions to six, then it appears this is one too many initial conditions and NDSolve promptly fails with an error message indicating this.

If you increase the range b then this seems to take much longer and may blow up. To try to overcome that you can try increasing the WorkingPrecision which may take dramatically longer to finish.

• It seems to work, but, what should I do with w[-b] == 0? I just don't understand this restriction – Maksim Oct 20 '17 at 18:52
• If you have a 2nd order DE you get to have 2 initial conditions. If you have two 2nd order DE you get to have 4 initial conditions. But your final w[x] is only 1st order and you only get 1 initial condition for a 1st order DE, not two. Is there any chance that you have misunderstood your problem and w[x] is supposed to be 2nd order? That would let you have two initial conditions for it. – Bill Oct 20 '17 at 18:55