How can I do numerical simulation in Matlab?
Mostra commenti meno recenti
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!
Risposta accettata
Più risposte (1)
Babak
il 7 Ago 2012
0 voti
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.
Categorie
Scopri di più su Systems of Nonlinear Equations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!