I have a set of equations pdes and some initial/boundary conditions bcs. These conditions depend on some parameters, which I can group as n sets,bcsi labeled by i where i=1,...,n.

When solving the equations (for one single set of conditions) I write


If I want to plot the solution, lets say y1[x], I write


Now, if I want to solve the equations for each set of conditions, and then to plot, for example, y1[x] again, I would do the following


and make plots in the same way, etc, and do the following


to get the solutions for y1[x] depending on each set of conditions. Is there a way to construct this plot not solving for each set separately but as a List or Table, in such a way that just doing


where solutions is the set of solutions for each condition, allows to see how y1 changes when I change the conditions?

  • 1
    $\begingroup$ I would first put the boundary conditions in a table and then use sol=Table[NDSolveValue[{pdes,bcs[[i]]}],{i,1,n}] to get the solutions in one table. $\endgroup$ Commented Nov 7, 2017 at 21:12
  • 2
    $\begingroup$ If you're going to be varying the boundary conditions a lot, you might want to use ParametricNDSolveValue[] instead. $\endgroup$ Commented Nov 7, 2017 at 21:46

1 Answer 1


First put the conditions in a table


As suggested above, to solve the equations together


to plot the curves for y1[x] for each condition, we write


Since we have n plots, one can give colors to each curve by setting n color inside PlotStyle


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.