I need to implement my own integration routine that will take state space function $f$, free variable $t$, and initial state $x(0)$ as input and produce the solution $x(t)$ as output. I thought that using Runge-Kutta method will be great. But I cannot understand how to apply it to the state-space function matrix. $$\dot{x}=f(t,x)$$ $$\dot{x}=A\cdot{x}$$ I have only $A$ matrix. How can I apply Runge-Kutta method? For example, could you provide step-by-step solution for: $$ \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ -10 & -5 & -2 \\ \end{bmatrix} \quad $$ Thanks in advance!
2026-03-26 22:51:37.1774565497
Solving state-space function with using of Runge-Kutta method
1.9k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in CONTROL-THEORY
- MIT rule VS Lyapunov design - Adaptive Control
- Question on designing a state observer for discrete time system
- Do I really need quadratic programming to do a Model Predictive Controller?
- Understanding Definition of Switching Sequence
- understanding set of controllable state for switched system
- understanding solution of state equation
- Derive Anti Resonance Frequency from Transfer Function
- Laplace Transforms, show the relationship between the 2 expressions
- Laplace transform of a one-sided full-wave rectified...
- Controlled Markov process - proper notation and set up
Related Questions in RUNGE-KUTTA-METHODS
- Sensitivity (gradient) of function solved using RK4
- Solve fourth order ODE using fourth order Runge-Kutta method
- Prove that Runge Kutta Method (RK4) is of Order 4
- Applying second-order differential operator vs applying first-order differential operator twice?
- Adaptive step size Runge Kutta: getting a specific value
- PYTHON RK2 (Midpoint Method)
- Runge-Kutta Order Question
- fourth-order Runge-Kutta method producing values for $f(x)=\int_0^x e^{-t^2}$ (confusing answer key)
- Adaptive Step Size in RK45 for Second-Order ODE
- Runge kutta method for order 4 for ODE x'=f(t)
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
You have a system $\dot{x} = f(x)$ with
$$ f(x) = A x = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ -10 & -5 & -2 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} = \begin{pmatrix} x_2 \\ x_3 \\ -10 x_1 - 5 x_2 - 2 x_3 \end{pmatrix} $$
The formula for Runge Kutta with step size $h$ is:
$$ \begin{align} k_1 &= f(x(t)) \\ k_2 &= f(x(t) + \frac{h}{2}k_1) \\ k_3 &= f(x(t) + \frac{h}{2}k_2) \\ k_4 &= f(x(t) + h k_3) \\ x(t + h) &= x(t) + \frac{h}{6}(k_1 + 2 k_2 + 2 k_3 + k_4) \end{align} $$
So all you need to do is choose a step size $h$ and initial condition $x(0) = x_0$.
For example use $h = 0.01$ and
$$ x_0 = \begin{pmatrix} 5 \\ -2 \\ 3 \end{pmatrix} $$
Insert this:
$$ \begin{align} k_1 &= f(x_0) = \begin{pmatrix} -2 \\ 3 \\ -46 \end{pmatrix} \\ k_2 &= f(x_0 + \frac{h}{2}k_1) = \begin{pmatrix} -1.985 \\ 2.77 \\ -45.515 \end{pmatrix} \\ k_3 &= f(x_0 + \frac{h}{2}k_2) = \begin{pmatrix} -1.98615 \\ 2.772425 \\ -45.51485 \end{pmatrix} \\ k_4 &= f(x_0 + h k_3) = \begin{pmatrix} -1.97227575 \\ 2.5448515 \\ -45.02970925 \end{pmatrix} \\ \end{align} $$
And so:
$$ x(0.01) = x(0) + \frac{0.01}{6}(k_1 + 2 k_2 + 2 k_3 + k_4) = \begin{pmatrix} 4.98014237375 \\ -1.972283830833333 \\ 2.544850984583333 \end{pmatrix} $$
If you repeat this 500 times you get:
If you simulate even longer you can see this is an undamped oscillation which makes sense because the three eigenvalues of $A$ are $-2, \sqrt{5}i, -\sqrt{5}i$.