findroot problem
- To: mathgroup at smc.vnet.net
- Subject: [mg56362] findroot problem
- From: bharrison at walla.com (bruce)
- Date: Fri, 22 Apr 2005 06:25:04 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I'm new to mathematica and have been using it to solve differential
equations. Today i did a simple equation and managed to plot it (plot
looked correct) but when i tried (and tried and tried...) to use
Findroot to find the root i keep getting error messages. This is my
work (without the plot):
mc = 1;
mp = 0.01;
l1 = 0.1;
l2 = 0.4;
g = 9.81;
d = (mc l1 - mp l2)*g/(mc l1^2 + mp l2^2)
81.1862
simpletreb = NDSolve[{ϕ''[
t] == -d Sin[ϕ[t]], ϕ[0] == (3π/4), ϕ'[0] == 0},
ϕ[t], {t, 0, 1}]
{{ϕ[t] -> InterpolatingFunction[{{0., 1.}}, <>][t]}}
{{ϕ[t] -> InterpolatingFunction[{{0.`, 1.`}}, "<>"][t]}}
Plot[ϕ[t] /. simpletreb, {t, 0, 0.5}];
*PLOT GOES HERE*
FindRoot[ϕ[t] == 0, {t,0.2}]
Findroot::nlnum :
The function value (ϕ[0.2]} is not a list of numbers with
dimensions {1} at {t} = {0.2}
*************
I tried many things all of which came up with various errors. From the
plot i know the root is between 0.25 and 0.3. If anyone can point me
in right direction id greatly appreciate it!