Re: newbie help
- To: mathgroup at smc.vnet.net
- Subject: [mg107660] Re: [mg107641] newbie help
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 22 Feb 2010 03:08:44 -0500 (EST)
- Reply-to: hanlonr at cox.net
eqn1 = x'[t] == Sin[x[t]]; sol1 = DSolve[eqn1, x[t], t][[1]] /. C[1] -> c // Quiet // FullSimplify {x[t] -> 2*ArcTan[E^(c + t)]} Verifying that sol1 satisfies the equation eqn1 eqn1 /. Join[sol1, D[sol1, t]] // Simplify True p1[t_, c_] = x[t] /. sol1; eqn2 = x'[t] == x[t]^2; sol2 = DSolve[eqn2, x[t], t][[1]] /. C[1] -> c // Simplify {x[t] -> -(1/(c + t))} Verifying that sol2 satisfies the equation eqn2 eqn2 /. Join[sol2, D[sol2, t]] // Simplify True p2[t_, c_] = x[t] /. sol2; Manipulate[ Plot[{p1[t, c], p2[t, c]}, {t, -3, 3}, PlotStyle -> {Blue, {Red, Thick}}, PlotRange -> {-3, 3}, Exclusions -> -c, ExclusionsStyle -> Blue], {{c, 0}, -1, 1, 0.01, Appearance -> "Labeled"}] Bob Hanlon ---- lorrainetx <lorraine.ramos at gpisd.org> wrote: ============= I've never worked with this program before and I'm having trouble getting it to do what I want it to do. If there is a good resource to help translate the math to programing help it would be appreciated. This is what I'm working on:(I can upload my notebook if it is easier to help see what I did wrong) Solve the differential equation x' sin (x). sol = DSolve[x'[t] == Sin[x[t]], x[t], t] // FullSimplify // Quiet \[Phi][t_, c_] := x[t] /. sol[[1]] /. C[1] -> c \[Phi][t, c] sol = DSolve[x'[t] == x[t]^2, x[t], t] // FullSimplify // Quiet \[Phi][t_, c_] := x[t] /. sol[[1]] /. C[1] -> c \[Phi][t, c] Manipulate[ Plot[{\[Phi][t, c], 0}, {t, -3, 3}, PlotStyle -> {Blue, {Red, Thick}}, PlotRange -> {-3, 3}], {c, -1, 1}] plot = VectorPlot[{1, x}, {t, 0, 10}, {x, -10, 10}, VectorScale -> 0.04]; Show[plot, Frame -> True, AspectRatio -> Automatic] My graphs are not working right.