1
R=5;
g=9.8;
sol = NDsolve[{theta''[t]==-g/m*sin[theta[t]],theta[0]==20,theta'[0]==0},theta,{t,0,100}]
Plot[theta[t]/.sol,{t,0,100}]

The code above gives me error and it doesn't plot anything. enter image description here

Alphonse
  • 11
  • 1
  • 3
    Use NDSolve rather than NDsolve. Use Sin rather than sin. You need to assign a value to m. – Bob Hanlon Sep 19 '16 at 05:37
  • 2
    Also, don't type a lot of code without testing, evaluate all of it and wonder why it didn't work. Take each piece separately. – Szabolcs Sep 19 '16 at 07:15

1 Answers1

0

See also this Q&A for some very important advice about Built-in symbols and so on.

g = 9.8;
m = 10^3;
sol = NDSolve[{theta''[t] == -g/m*Sin[theta[t]], theta[0] == 20, 
theta'[0] == 0}, theta, {t, 0, 100}]

enter image description here

Plot[theta[t] /. sol, {t, 0, 100}]

enter image description here

Since the variable R is not used anywhere, I have leftout this piece of Code.