![]() Also here is the error message:Īttempted to access Y(3) index out of bounds because numel(Y)=2.į0 = feval(ode,t0,y0,args to yp0. I am fairly new to Matlab so please forgive any silly mistake haha'.ĮDIT: I Have slightly changed the first function and the "RateDE" was not intentional. ![]() With N = 2, I should get two set of matrices of but I have no clue of how should I correct the code. U0 = u0 +r %value changes on each iteration %Create random numbers to change the value of u0 Yinitial = 0 Yminitial = 0 %intial conditions %%Define parameters and initial conditions ![]() Here are my codes so far but I get some errors: %Script for differential derivatives specifcationĭy(1) = (u0*exp(-g*T)) - (k*Y(1)*exp(Y(2))) Īnd finally here is the main function: %% Initialize the environment However, I now have to solve a system of three differential equations:ĭ(tethai)/dt = alphai*f(tethai) - (tethai - tethaex)ĭ(tethaex)/dt = sigma*(Sum(1.N)(tethai - tethaex)) - phi*tethaex I have here a little program that I do not know how to tackle, I have previously written a code that would solve for me a system of two differential equations which works fine.
0 Comments
Leave a Reply. |