0
$\begingroup$

I have a simple DEQ:

$$y'(t) = y + C$$

for a constant $C$. It turns out that the equilibrium point of this DEQ is $-C$.

I can use the StreamPlot command to plot the direction field for 'any' value of $C$, for example, for $C = 2$:

 StreamPlot[{1, y + 2}, {t, -4, 4}, {y, -8,  4}]

The StreamPlot is:

enter image description here

This StreamPlot would look exactly like this for any value of $C$.

is there some way to show the y-axis as a $C$ instead of $-2$ and to show the other values as $C \pm <\rm{offset}>$. That is, the point $-4$ is shown as $C-2$, the point $-2$ is shown as $C$, the point 0 is shown as $C+2$, etc. In other words, the y-axis values are shown as a function of the general equilibrium point?

$\endgroup$
1
$\begingroup$

You can achieve the desired result using the CustomTicks package, which is part of the LevelScheme package that is available at http://scidraw.nd.edu/levelscheme/

The CustomTicks package lets you specify the desired TickLabelFunction for each axis:

Needs["CustomTicks`"]

StreamPlot[{1, y + 2}, {t, -4, 4}, {y, -8, 4}, 
  FrameTicks -> {
    {LinTicks[-8, 4, TickLabelFunction -> ("C " <> 
       Which[
         # == 0, "",
         # < 0,  "- " <> ToString@Abs@#, 
         # > 0,  "+ " <> ToString@#
       ]&@Round[# + 2] &)
    ], Automatic},
    {Automatic, Automatic}
    }
]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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