[ empty sym ] & "unable to find explicit solution" error when using dsolve for second order differential equation
2 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to solve a second order differential equation with 4 variations of one of the initital conditions, but no matter if I try to do all of them at once (the commented d = line) or just one at a time (the d=1) matlab says "Warning: unable to find an explicit solution" and spits out "ySol1 = [ empty sym ]". I don't think there's no solution, as there are a couple follow up questions in the homework problem this is from. What am I doing wrong? Does this equation need ode45 over dsolve, and if so how would I format it?
syms y(t) d;
Dy = diff(y);
% d = [1 1.5 2 2.5];
d = 1;
cond1 = y(0) == d;
cond2 = Dy(0) == 0;
conds = [cond1 cond2];
ySol1 = dsolve(diff(y,t,2)+0.15*Dy-y+y^3 == 0, conds)
0 件のコメント
回答 (1 件)
Jyotsna Talluri
2020 年 4 月 24 日
syms y(t)
[v] = odeToVectorField(diff(y,t,2)+0.15*diff(y,t)+y-y^3 == 0);
M = matlabFunction(v,'vars', {'t','Y'});
t= [0 20];
cond = [1 0];
sol = ode45(M, t, cond);
Refer to the documentation link below for more information
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Equation Solving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!