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...
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...
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...
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...
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...
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...
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...
Hello everyone, :)I hope you consider this the right place for this question.
I have been working way to long on making a model of a double pendulum using the RK4 method with excel.
I have these four equations that I should be able plug into RK4
I know that the first two equations for...
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!
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...
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...
I using the pseudo-spectral method with RK4 integration to solve the nonlinear KdV equation.
My code works for both the linear KdV and the NLS equation; however, it nots working right for \(u_t + u_{xxx} + 6uu_x = u_t + u_{xxx} + 3(u^2)_x = 0\). I want to view from \(0\leq t\leq 10\) and...
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
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...
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...
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...
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...
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...
Homework Statement
Consider the initial value problem y' = -2y + x, y(0) = 1
The analytical solution is y(x) = (1/2)x2-(1/4) + (5/4)e-2x
a. Approximate y(0.1) using one step and the RK4 method.
b. Find a bound for the local truncation error in y1.
c. Compare the error in y1 with the...
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...
Homework Statement
Implementing the 4th order Runge-Kutta method for an n-body problem
Homework Equations
The RK4 method for the IVP y' = f(t,y), y(t0) = y0, is given by
y_(n+1) = y_n + (1/6)(k1 + 2 k2 +2 k3 + k4)
t_(n+1) = t_n + h
where
k1 = h f(t_n,y_n)
k2 = h f(t_n+ h/2, y_n + k1/2)
k3...
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"...
[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...
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...