Rk4 Definition and 21 Threads

  1. harryharns

    C/C++ Perform RK4 between 2 Clusters in Magnetic Field

    I have a simulated data of charged particles in a magnetic field. I have selected clusters, each cluster contains a set of points(x,z) and I want to perform RK4 between the first and second clusters and fill the positions in a histogram. I have selected the clusters with the initial...
  2. D

    I RK4 with adaptative step versus fourth order leapfrog integrator

    Summary: I am trying to solve the trajectory of particle in a time independent field and I'm looking for the most efficient way, ie smallest error on the energy for a given calculation's time. I thought 4th order leapfrog integrator was better than RK4 but quick try does not seems to agree...
  3. M

    A Efficient Computation of k2 in RK4 for Numerical RHS | PF Discussion

    Hi PF! I am trying to compute ##d_t y = d_x u^2##. Following standard RK4 procedure outlined by wikipedia as https://en.wikipedia.org/wiki/Runge–Kutta_methods I am forced to compute ##k_2##. If the RHS is analytic, the fractional stepping is direct. However, the RHS gradient is finite...
  4. chastiell

    About chua circuit numerical solutions

    hi all ! i'm trying to solve numerically the chua circuit set of differential equations , I am using the equations showed in this pdf: http://nonlinear.eecs.berkeley.edu/chaos/RobustOpAmpRealizationOfChuaCircuit.pdf i have the real circuit mounted and I'm using its parameters for the numerical...
  5. B

    Solving Spring System with RK4: Step-by-Step Guide

    I'm not sure if this is the appropriate place, but I've just been searching, with no luck, on how to solve a spring system with RK4 (hence the math section, since it's a Runge Kutta question). How would you set it up to change position based on spring properties? I haven't really found any...
  6. T

    System of ODEs with RK4 & step doubling in Fortran : damping

    Hello, I'm recently trying to code a solver for a system of differential equations u'(t) = F(t,u), using a Runge Kutta 4 method with an adaptative stepsize. For this, I'm using the 'step doubling' method, which is the following : suppose that we now the solution u(i) at time t(i). Then, the...
  7. mlouky

    Fortran I to solve ODE with rk4 y" + 2y =0 in fortran

    How can i solve y" + 2y =0 with RK4 and their program fortran please I néed your helpe
  8. MrOmar

    Need help solving a differential equation numerically

    Hello all, I am currently trying to solve a differential equation numerically. The equation is as follows: dv/dt = (u*q)/(m0-q*t) - g - (cd*ρ*A*0.5)*v2 If you haven't already guessed, it's the rocket equation with added gravity and drag. Now, I'm not even sure if that's what it's supposed to...
  9. DivergentSpectrum

    How do I apply rk4 to a second order pde?

    Im writing a program that calculates the trajectory of a particle in an arbitrary force field. the force field is a vector function of position (x, y, z) AND velocity (x', y', z'). Rk4= runge kutta forth order method Please help. Thanks!
  10. R

    Solving Non-Linear ODEs with RK4 Method: Time Step Considerations

    Hi, I am having a problem implementing 4th Order Runge Kutta (RK4) to solve a non linear ODE. dy/dt = B(t) - A(t)*y(t)^2 where the coefficients A(t) and B(t) are specific to the problem I am working on. For the test case I am running I specify a sinusoidal signal and from this signal...
  11. L

    How can I overcome errors in RK4 due to linearly interpolated data?

    I am simulating an ODE where the differential function is a function of sampled data points and are having trouble obtaining data in between sampled points (for the step computations of RK4). The first thing that I tried was to linearly interpolate the data, but that introduced large...
  12. A

    Practical Examples of RK4 Method for Second Order Differential Equations

    Hello, I need some examples of practical second order differential equation that can be solved by Runge kutta method. I tried searching on net but couldn't find a satisfying answer. Please help.. Thanks in advance
  13. H

    Runge-Kutta 4th order method (RK4) for second order Diff Eq

    Homework Statement Hello, maybe this is due to my lack of understand of RK4, but I have an equation: x'' + b^2*x=0 (derivatives with respect to variable t) and I need to use RK4 to find the solution on an interval. I can readily find solutions analytically, but my understanding of RK4...
  14. A

    RK4 for a system of 2 second order DEs

    1. For this problem, we are asked to design a MatLab/Octave code that will calculate and plot the orbit of a sattelite 2. We are given the following 2nd order equations x''= \frac{-x}{( \sqrt{x^{2}+y^{2}})^{3}} y''= \frac{-y}{( \sqrt{x^{2}+y^{2}})^{3}} We can convert this into the...
  15. A

    C/C++ Two Body problem with RK4 in C++

    I want to output an excel file with the results of the trajectories of a two body problem, with initial position and velocity. But my program is not compiling. Any suggestions/problems that you can see? #include <iostream> #include <vector> #include <fstream> using namespace std...
  16. J

    Python Two Body problem in python using RK4

    So I am writing a program in python to do RK4 for the two body problem. I want it to display a sphere moving around another. It currently displays one sphere for a split second and then it goes blank. Any suggestions? from __future__ import division from visual import * from visual.graph import...
  17. S

    MATLAB Solving RK4 Integration with Matlab for Paths

    Hi, I am trying to apply the fourth order Runge-Kutta integration method to a problem but I'm not sure exactly how to do it. I have a matrix which represents a coordinate system (x, y) with varying degrees of height at each point. Using Matlab, I made a matrix with a gradient (u and v...
  18. I

    RK4 Solver Issue: Shoot the Moon with C Program

    Hey Folks, So I've been making an 4th order Runge-Kutta program for finding a way to shoot the moon with a spacecraft . However for some reason the RK4 part of the program does not work and I cannot figure it out. I've written it in C and attached the file. If someone who is more well...
  19. G

    Python Help with Python RK4: Solving Error Plotting 1st Order ODE

    i have been attempting to plot a first order ODE with pyhton's rk4 i can't display the graph and i have been having this error: Traceback (most recent call last): File "C:\Documents and Settings\AP155user38\Desktop\gladys python codes\differential equations and runge-kutta\1ODE.py"...
  20. L

    RK4 in solar system simulation (n-body problem)

    [SOLVED] RK4 in solar system simulation (n-body problem) Hi, I'm making a simulation of the solar system and have so far been using euler's method to integrate my equations of motion - and i'd like to upgrade to a 4th order runge-kutta method. I'm having a lot of trouble understanding the...
  21. S

    How Can Momentum Improve RK4 Integration in Vehicle Physics?

    I'm writing a vehicle physics engine and am using an RK4 integrator which I wrote. But I am having huge problems with angular motion. Long story short I thing it might be to do with the fact that I'm integrating from accelerations. So I'm re-writing the integrator using momentum. However I'm...
Back
Top