Using the Runge-Kutta integration method in a system

Published: 14/03/2018
Source: STACKOVERFLOW.COM

h=0.005; x = 0:h:40; y = zeros(1,length(x)); y(1) = 0; F_xy = ; for i=1:(length(x)-1) k_1 = F_xy(x(i),y(i)); k_2 = F_xy(x(i)+0.5*h,y(i)+0.5*h*k_1); k_3 = F_xy((x(i)+0.5*h),(y(i)+0.5*h*k_2)); k_4 = F_xy((x(i)+h),(y(i)+k_3*h)); y(i+1) = y(i) + (1/6)*(k_1+2*k_2+2*k_3+k_4)*h; end I have the following code, I think it's right. I know there's parts missing on the F_xy because this is my follow up ques

Related news
• Published: 14/03/2018
I have a time series signal (45 sensors connected to a gyroscope, ECG reader, Rotation axis and so on ...). I am looking for some noticeable features in one of these sensors. What I did, is first clea ... Read more
• Published: 14/03/2018
Consider a difference equation with its initial conditions. 5y(n) + y(n-1) - 3y(n-2) = (1/5^n) u(n), n>=0 y(n-1) = 2, y(n-2) = 0 How can I determine y(n) in Matlab? Read more
• Published: 14/03/2018
I am plotting a figure in Matlab with multiple subplots. Below is one of the plots handaxes1=axes('position', [0.06 0.7 0.14 0.20]); I=shadedErrorBar( time(301:901), GrandAvg_Q_S_all30.avg(5,[301:901] ... Read more
• Published: 13/03/2018
I want to simulate a "game": start from a deck of n distinct cards, say a vector (1 2 ... n). Separate this in two equally large semidecks, maintaining the initial order; if n is odd, separate it like ... Read more
• Published: 13/03/2018
In the article reading face recognition, I read this sentence: "The corrected 3D face is further resampled with a uniform resolution of 1mm on the xy plane". I found it on the Internet and only found ... Read more
• Published: 13/03/2018
I want to do a comparison of 2 audio files (each audio file is speaking "ba a ta") with the existing function in matlab called Dynamic Time Warping (DTW). Before doing a dynamic time warping, I get an ... Read more
• Published: 13/03/2018
I have the following piece of code: nruns=100 nloops=2 zz=zeros(nloops,nruns); for wLoop=1:nloops delete(gcp('nocreate')); parpool(npools); parfor wRun=1:nruns zz(wLoop,wRun)=rand end end disp('done') ... Read more
• Published: 13/03/2018
I am taking two images using single moving camera. I tried to take them from same epipolar line. Then I compute disparity in Matlab. I1 = imread('4.jpg'); %right image I2 = imread('3.jpg'); %left imag ... Read more
• Published: 13/03/2018
I was trying to implement a simple multilayer neural net to solve the XOR, its just to learn how multilayer nets and weight updates works. I came up with the matlab code and its working fine and gets ... Read more
• Published: 13/03/2018
i have the following problem. I am trying to solve 2 Algebraic Equations with the solve fkt. syms A B %solA ==> Xir... solB ==> Rir R=Opit(1:end,1); X=Opit(1:end,2); solA=zeros(length(Opit),1); ... Read more
• Published: 13/03/2018
I want to generate a C-code from the following Simulink model using the ERT. The Coder codes the content of the matlab.mat hard into the code: /* Start for FromFile: '<Root>/From File' */ { stat ... Read more
• Published: 13/03/2018
I need to open a serial COM port on Matlab, receive some data and then communicate on the same COM port in Simulink. However, it seems to be impossible to receive data in simulink since the COM port a ... Read more
• Published: 13/03/2018
I need to compare a value in a multidimentional array and according to this comparison, I need to assign a value of another matrix in the same index to a new matrix of the same size in the same index. ... Read more
• Published: 13/03/2018
MULTILEVEL INVERTER WITH PSEUDORANDOM PWM TECHNIQUE Read more
• Published: 13/03/2018
Pseudo random number generation Read more
• Published: 13/03/2018
could I use all the cores? is it limited by the lincese? Read more
• Published: 13/03/2018
I am working on a path planning project which requires me to find the boundary (in the form of coordinates) of object in any picture. please help me. Read more
• Published: 13/03/2018
How can I make mathlab to fetch image that's send to a server from Android application. The math lab is running in the same local server Read more
Comment