how to plot solution of differential second order equation ?

2 次查看(过去 30 天)
i would like to plot "sol3" but i still have this matlab error :
"Error using plot
Conversion to double from sym is not possible."
eq=diff(y,t)/R+C*diff(y,t,2)+y/L==diff(i,t)
Dy = diff(y,t);
cond = [y(0)==0, Dy(0)==0];
sol=dsolve(eq,cond)
sol2=simplify(sol)
sol3=vpa(sol2,2)
T=0:0.001:4;
plot(T, sol3);
  1 个评论
Walter Roberson
Walter Roberson 2017-9-17
You are trying to solve for two functions, y(t) and i(t), with only one equation, and without any boundary conditions for i(t) . The only way this could work is if i is a pre-defined equation that does not involve partial derivatives of i .
We would have an easier time reproducing your problem if you had given the syms calls and the values for R, C, and L.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2017-9-17
plot(T, subs(sol3, t, T));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by