D2ynum = solve(ode==0, D2y, 'maxdegree', 3);
Code generation failed due to unexpected object of type 'RootOf'.
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I am trying to run the code below, but Matlab keeps throwing this error message at me. Does anyone know whats the issue?
syms y Dy D2y x
k=5/8;
w=100;
q=1;
p=1;
r=0.06;
e=0.5;
a=1/3;
z=0.15;
t=0.9;
s1=2;
m1=0.5;
fstar=4.9259e-16;
b=0.9273;
t1=(1+(z*fstar)/(r+t*p*s1-m1))*(2200^((1-k)*(e/(1-e))))*(((1-a)/w*q*a)^(e/(1-e)))*(e/(1-e))*(1/(p*s1+r+(1-b)*fstar-m1))^((1-e*(1-a))/((1-a)*(1-e)));
ode = y-((1+(z*fstar)/(r+t*p*(Dy*x*s1/y)-((Dy*x*m1/y)+D2y*(x^2)*(s1^2)/(2*y))))*(x^((1-k)*(e/(1-e))))*(((1-a)/w*q*a)^(e/(1-e)))*(e/(1-e))*(1/(r+(1-b)*fstar+p*(Dy*x*s1/y)-((Dy*x*m1/y)+D2y*(x^2)*(s1^2)/(2*y))))^((1-e*(1-a))/((1-a)*(1-e))));
D2ynum = solve(ode==0,D2y);
D2ynum = D2ynum(3);
f = matlabFunction(D2ynum,"Vars",{x, [y Dy]});
0 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!