How can I do numerical simulation in Matlab?
显示 更早的评论
Hi, I'm trying to do numerical simulation in Matlab. I have a system of 5 non-linear equation and 5 unknowns. All the unknowns are time-dependent. I'd like to simulate the solution for the unknowns within a time range.
C1(t)=Cb-2i1(t)*sqrt(t/K)
i1(t)=K(C1(t))*exp(-E(t))
C2(t)=Cb-2i2(t)*sqrt(t/K)
i2(t)=K(C2(t))*exp(-E(t))
i1(t)+i2(t)=constant.
I'd like to simulate this system of equations for a time range. I have tried using fsolve and the for loop..but haven't gone anywhere. I'm not really that familiar with the language of Matlab. I know just enough. Any helpful suggestions/hints or any codes dealing with similar systems would be very helpful. Thanks!
采纳的回答
更多回答(1 个)
Babak
2012-8-7
0 个投票
I would do it in Simulink!
For example for the first two equations, you can create signals named C1(t), i1(t) and E(t) and try to use Simulink blocks (can include a MATLAB fcn block in Simulink too) to connect these signals to each other and make a model which does the calcs you want.
I believe the solution of the 3rd and 4th equations will be easy when you have the solution for the C1(t) and i1(t) using the 5th eqn.
类别
在 帮助中心 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!