Plotting a series of Roots
- To: mathgroup at smc.vnet.net
- Subject: [mg128689] Plotting a series of Roots
- From: William Duhe <wjduhe at loyno.edu>
- Date: Sat, 17 Nov 2012 03:49:35 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
Bellow is a program that solves a diff eq, then finds a particular valued root for that eq. What I want to do is be able to plot how the root changes as a function of Lambda.
m = Manipulate[Module[
{ti, tf, s1},
imgSize = 375;
ti = 0;(*initial time*)
tf = 100;(*final plot time*)
s1 = NDSolve[{x'[t] == lambda, x[0] == 0}, x, {t, ti, tf}][[1]];
t1 = FindRoot[x[t] == .1 /. s1, {t, tf}];
delta[lambda] :=
Module[{times, v, s = s1[lambda]},
times = Quiet[
Chop[FindRoot[x[t] == .1 /. s, {t, #}] & /@ {tf - 1, ti + 1}]];
v = Flatten[x[t] /. s /. times];
Subtract @@ v];
Plot[delta[lambda], {lambda, 0, .007}, Frame -> True,
Axes -> False,
FrameLabel -> {"lambda", "Change in value of root"},
ImageSize -> imgSize,
Epilog -> {Text[ToString[pt, TraditionalForm], pt, {-1.25, 1}],
Red, AbsolutePointSize[4], Point[pt]}]
Column[{Plot[Evaluate[{Tooltip[x[t] /. s1, "x[t]"]}], {t, ti, tf},
PlotRange -> Automatic, AxesLabel -> {"Time", "functions"},
ImageSize -> 350, Exclusions -> Automatic],
Row[{"x[t] = 1 when ",
t1 =
Quiet[Chop[
FindRoot[x[t] == .1 /. s1, {t, #}] & /@ {tf, ti}]]}],
"\n\n"}]], {{lambda, .001}, 0.001, 0.007,
Appearance -> "Labeled"}]
- Follow-Ups:
- Re: Superscript on plus expression
- From: Bob Hanlon <hanlonr357@gmail.com>
- Re: Plotting a series of Roots
- From: Bob Hanlon <hanlonr357@gmail.com>
- Re: Subscript on plus expression
- From: Bob Hanlon <hanlonr357@gmail.com>
- Subscript on plus expression
- From: "Dave Snead" <dsnead6@charter.net>
- Re: Superscript on plus expression