The GeneratedParameters OptionAs previously discussed, the general solution to a differential equation contains undetermined coefficients that are labeled C[1], C[2], and so on. This example has one undetermined parameter, C[1]. In[494]:=  |
Out[494]=
|
To change the name of the undetermined parameter, use the GeneratedParameters option. This changes the name of the undetermined coefficient to K[1]. In[495]:=  |
Out[495]=
|
The parameter C should be thought of as a pure function that acts on a set of indices to generate different constants C[i]. This shows the behavior of C. In[496]:=  |
In[497]:=  |
In[498]:=  |
Out[498]=
|
In[499]:=  |
Out[499]=
|
Internally, the use of a pure function allows DSolve to increment the argument i in C[i] correctly for higher-order ODEs and systems of ODEs. GeneratedParameters can be specified using a pure function. In[500]:=  |
Out[500]=
|
Using a pure function is particularly useful if you want to begin indexing the parameters at any value other than the default (1). This uses a pure function to label the parameters in the previous example const[2] and const[3]. In[501]:=  |
Out[501]=
|
Finally, with Module variables, you can get names for the parameters that are unique across different invocations of DSolve. Here the same DSolve call generates different parameter names. In[502]:=  |
Out[502]=
|
In[503]:=  |
Out[503]=
|
|