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!