フィルターのクリア

Code generation failed due to unexpected object of type 'RootOf'.

7 ビュー (過去 30 日間)
Della
Della 2023 年 6 月 7 日
回答済み: Walter Roberson 2023 年 6 月 8 日
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]});

採用された回答

Walter Roberson
Walter Roberson 2023 年 6 月 8 日
D2ynum = solve(ode==0, D2y, 'maxdegree', 3);

その他の回答 (1 件)

Ronit
Ronit 2023 年 6 月 8 日
If they are on your license, you can install additional toolboxes using the Add-Ons Explorer.
You can install Symbolic Math Toolbox.

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by