matlab求解含参数线性方程组。

23 次查看(过去 30 天)
hawcerv
hawcerv 2023-5-18
回答: saeuper 2023-5-18
s,d都是参数
[code]syms d s IL1 IL2 VC1 VC2 VC0eq1=s*IL1*0.01==-0.25*VC0+48*d;
eq2=s*IL2*0.01==-0.0375*IL2+0.25*VC1+0.25*VC2+48*d;
eq3=s*0.0001*VC1==-0.25*IL2+1.7*VC1+1.7*VC0;
eq4=s*0.0001*VC2==-0.25*IL2+0.007*VC2+0.007*VC0+3.8*d;
eq5=s*0.0001*VC0==-0.25*IL1+0.007*VC2+1.7*VC1-1.67*VC0-3.8*d;
[IL1,IL2,VC1,VC2,VC0]=solve(eq1,eq2,eq3,eq4,eq5.IL1,IL2,VC1,VC2,VC0);[/code]。
[IL1,IL2,VC1,VC2,VC0]=solve(eq1,eq2,eq3,eq4,eq5.IL1,IL2,VC1,VC2,VC0);
这句存在问题,报错:
此类型的变量不支持使用点进行索引。
出错 sym/subsref (第 902 行)
R_tilde = builtin('subsref',L_tilde,Idx);
出错 cdhs (第 14 行)
[IL1,IL2,VC1,VC2,VC0]=fsolve(eq1,eq2,eq3,eq4,eq5.IL1,IL2,VC1,VC2,VC0);

采纳的回答

saeuper
saeuper 2023-5-18
仅供参考
syms  d  s  IL1 IL2 VC1 VC2 VC0
eq1=s*IL1*0.01==-0.25*VC0+48*d;
eq2=s*IL2*0.01==-0.0375*IL2+0.25*VC1+0.25*VC2+48*d;
eq3=s*0.0001*VC1==-0.25*IL2+1.7*VC1+1.7*VC0;
eq4=s*0.0001*VC2==-0.25*IL2+0.007*VC2+0.007*VC0+3.8*d;
eq5=s*0.0001*VC0==-0.25*IL1+0.007*VC2+1.7*VC1-1.67*VC0-3.8*d;
[IL1,IL2,VC1,VC2,VC0]=solve([eq1,eq2,eq3,eq4,eq5],[IL1,IL2,VC1,VC2,VC0]);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 编程 的更多信息

Community Treasure Hunt

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

Start Hunting!