Unable to calculate the second derivative of a function
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I want to calculate the second derivative of a function. Below are the steps I am following-
syms a b;
th = sym('th(t)'); %th is a time dependent variable
y = diff(a^2*cos(th)+(b/12)*sin(th));
thd = diff(th); %derivative of th wrt time
ybythd = diff(y,thd); %derivative of y wrt thd
p = diff(ybythd); %derivative of ybythd wrt time
It calculates the following value of p
p = diff(diff((b*cos(th(t))*diff(th(t), t))/12 - a^2*sin(th(t))*diff(th(t), t), t), diff(th(t), t))
I do not see any term of d2th/dt2 in the above result. What is missing?
1 Commento
Andriy Kavetsky
il 6 Ott 2016
y = diff(a^2*cos(th)+(b/12)*sin(th),th,2) %second derrivative ////////////////////////////////////////// y = diff(a^2*cos(a)+(b/12)*sin(a),a,2) %second derrivative from a and its result
y =
2*cos(a) - 4*a*sin(a) - (b*sin(a))/12 - a^2*cos(a)
Risposte (1)
Marc Jakobi
il 6 Ott 2016
change
th = sym('th(t)'); %th is a time dependent variable
to
th = sym('th'); %th is a time dependent variable
0 Commenti
Vedere anche
Categorie
Scopri di più su Calculus in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!