フィルターのクリア

how can i fix this error

2 ビュー (過去 30 日間)
Fahad Ramzan
Fahad Ramzan 2021 年 4 月 12 日
回答済み: Star Strider 2021 年 4 月 12 日
clc;
clear all
dsolve('Dy = (10/3)*((x)*(y.^(2/5)))', 'y(0)=1')
Error using symengine
Invalid input. Expected 'expression'.
Error in mupadengine/evalin (line 132)
res = mupadmex(statement,output_type{:});
Error in dsolve>mupadDsolve (line 336)
sys = [sys_sym reshape(evalin(symengine, sys_str), 1, [])];
Error in dsolve (line 194)
sol = mupadDsolve(args, options);
Error in Untitled (line 5)
dsolve('Dy = (10/3)*((x)*(y.^(2/5)))', 'y(0)=1')

回答 (1 件)

Star Strider
Star Strider 2021 年 4 月 12 日
I have no idea if ‘x’ is a variable or a function, so I am assuming that it is a variable here.
The correct expression would be:
syms x y(t) t Y
Dy = diff(y);
dsolve(Dy == (10/3)*((x)*(y.^(2/5))), y(0)==1)
however there is no analytic expression for ‘y’, so dsolve (with the corrected version of that expression) returns:
ans =
((3*int((10*x(x))/3, x, 0, t, 'IgnoreSpecialCases', true, 'IgnoreAnalyticConstraints', true))/5 + 1)^(5/3)
A numeric integration will require the function to be in a form that the ODE solvers can use:
[VF,Subs] = odeToVectorField(Dy == (10/3)*((x)*(y.^(2/5))));
yodefcn = matlabFunction(VF, 'Vars',{t,Y,x})
that would then be passed (for example to ode45) as:
tspan = [ ];
x = ...;
[t,y] = ode45(@(t,y)yodefcn(t,y,x), tspan, 1);
Or something similar.

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by