# Streamplot of an ODE [closed]

I'm trying to make a streamplot of

$\qquad \frac{dy}{dx}=|y(x)|$

together with a couple of streamlines. I got stuck in the syntax. Can anyone help me out of it?

This what I've done:

sp = StreamPlot[{1, Abs[y[x]]}, {x, 0, 4}, {y[x], -4, 4}];
sol = y /. ParametricNDSolve[{y'[x] == Abs[y[x]], y == a}, y, {x, 0, 4}, a];
Manipulate[
Show[
sp,
Plot[Evaluate[sol[a][x]], {x, 0, 4},
PlotStyle -> Red,
PlotRange -> Full],
Epilog -> {Black, PointSize[0.02], Point[{0, a}]}],
{a, 0, 4}]

• Where did you get stuck? Please post your code... – anderstood Mar 24 '18 at 12:04
• This was most welcome :) Apparantely I have a steep learning curve. One question. In the code below how can I make thick red lines?sol = DSolve[{Q'[t] == 2 - 2/3*Q[t], Q == q0}, Q[t], t] Show[Plot[ Evaluate[Table[Q[t] /. sol /. {q0 -> i}, {i, 0, 4, 1}]], {t, 0, 6}, PlotStyle -> {Red, Red, Red, Red}], StreamPlot[{1, 2 - 2/3*Q[t]}, {t, 0, 6}, {Q[t], 0, 6}, StreamMarkers -> "PinDart", StreamStyle -> Gray], AspectRatio -> 1, AxesLabel -> {"t", "Q(t)"}, PlotRange -> All] – runner Mar 24 '18 at 19:05

Use StreamPlot

sp = StreamPlot[{1, Abs[y]}, {x, 0, 2 Pi}, {y, 0, 2 Pi}] sol[y0_?NumericQ] :=
NDSolve[{D[y[x], x] == Abs[y[x]], y == y0}, y, {x, -5, 5}]

scp = Plot[Evaluate[{y[x]} /. sol[#] & /@ Range[0, 20, 0.3]], {x, -3, 3},
PlotRange -> All, MaxRecursion -> 8, AxesLabel -> {"x", "y"}, PlotStyle -> Red]

Show[sp,scp ] • Ok, but I would like to see a use of e.g NDSolve together with some boundary conditions – runner Mar 24 '18 at 11:40
• Then you should have mentioned that in your question, @user. – J. M. will be back soon Mar 24 '18 at 11:41
{"ft_lang_label":"__label__en","ft_lang_prob":0.6791556,"math_prob":0.96494687,"size":480,"snap":"2019-51-2020-05","text_gpt3_token_len":190,"char_repetition_ratio":0.11344538,"word_repetition_ratio":0.0,"special_character_ratio":0.4375,"punctuation_ratio":0.272,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.995457,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,2,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-09T13:04:22Z\",\"WARC-Record-ID\":\"<urn:uuid:f40d37b6-3ce9-4bdd-8b20-a0ba8ebbd946>\",\"Content-Length\":\"123722\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a5a33794-2fe7-4c51-9df3-bb811c47a7d7>\",\"WARC-Concurrent-To\":\"<urn:uuid:0178c083-f9a0-40ea-ac22-8d7455ef51e5>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://mathematica.stackexchange.com/questions/169673/streamplot-of-an-ode\",\"WARC-Payload-Digest\":\"sha1:PCT2O5QMQ2V2MHL3SCS34UTLGVQO4G2O\",\"WARC-Block-Digest\":\"sha1:7QF45FB6XX474H7SU6TJKGC2IXUGEGKJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540518882.71_warc_CC-MAIN-20191209121316-20191209145316-00238.warc.gz\"}"}