odeToVectorField: Unable to convert the initial value problem to an equivalent dynamical system.
3 次查看(过去 30 天)
显示 更早的评论
Could anyone help me with following Matlab codes. Why do they generate error and how to fix them?
syms t v1(t) v2(t) v3(t)
equ=[v1(t) == 10e-03*sin(2*pi*1e08*t);...
1e-00*(v2(t)-v1(t))+1e-03*(v2(t)-v3(t))+1e-09*diff(v2(t)-v3(t),t) == 0;...
1e-03*(v3(t)-v2(t))+1e-09*diff(v3(t)-v2(t),t)+1e-03*v3(t) == 0];
Vect=odeToVectorField(equ);
2 个评论
madhan ravi
2019-1-10
编辑:madhan ravi
2019-1-10
https://www.mathworks.com/help/symbolic/odetovectorfield.html#bvlqf2q-6 , could you upload the latex form of the equations ?
采纳的回答
Stephan
2019-1-10
Hi,
i deleted my first answer - cause your comment brought me to a new thought - DAE:
syms t v1(t) v2(t) v3(t)
eq1 = v1(t) == 10e-03*sin(2*pi*1e08*t);
eq2 = 1e-00*(v2(t)-v1(t))+1e-03*(v2(t)-v3(t))+1e-09*diff(v2(t)-v3(t),t) == 0;
eq3 = 1e-03*(v3(t)-v2(t))+1e-09*diff(v3(t)-v2(t),t)+1e-03*v3(t) == 0;
eqs = [eq1 eq2 eq3];
vars = [v1 v2 v3];
f = daeFunction(eqs,vars)
This works and gives you a function handle which can be used with ode15i:
f =
function_handle with value:
@(t,in2,in3)[in2(1,:)-sin(t.*6.283185307179586e8)./1.0e2;in3(2,:)./1.0e9-in3(3,:)./1.0e9-in2(1,:)+in2(2,:).*1.001-in2(3,:)./1.0e3;in3(2,:).*(-1.0e-9)+in3(3,:)./1.0e9-in2(2,:)./1.0e3+in2(3,:)./5.0e2]
I'm sorry that I notice so late!
Best regards
Stephan
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!