How to deal with two interdependent integrators? I have two functions, f(t,x) and g(t,u), where

Agohofidov6 2022-01-17 Answered
How to deal with two interdependent integrators?
I have two functions, f(t,x) and g(t,u), where ddtu=f(t,x) and ddtx=g(t,u).
I am trying to discretize the integral of this system in order to track x and u. I have succeeded using Euler integration, which is quite simple, since x(t) and u(t) are both known at t:
u(t+h)=u(t)+hf(t,x(t))
x(t+h)=x(t)+hg(t,u(t))
However, I am now trying to implement mid-point integration to get more accurate results. (Eventually Runge-Kutta but I am stuck here for now.)
You can still ask an expert for help

Want to know more about Laplace transform?

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question

Expert Answer

Virginia Palmer
Answered 2022-01-18 Author has 27 answers
chumants6g
Answered 2022-01-19 Author has 33 answers
Per Christian's suggestion I re-thought the question in terms of a state vector y=|u,x|, with a single derivative function [u˙,x˙]=y˙=z(t,x,u).
This allows to express the mid-point method as usual:
y(t+h)=y(t)+hz(t+h2,y(t)+h2z(t,y(t)))
where z(t,x,u)=[f(t,x),g(t,x)]
Not exactly what you’re looking for?
Ask My Question
alenahelenash
Answered 2022-01-24 Author has 368 answers

You can write the mid-point rule even with both equations separated as was your original post as
u(t+h)=u(t)+hf(t+h2,x(t)+h2g(t,u(t)))
and mutatis mutatndis for x(t+h).
P.S. I find your notation a bit verbose; personally I got used to using indices ,,+ for values at th,th2,t,t+h2,t+h; then the equation would read
u˙+=u+hu˙(x+h2x˙(u))

Not exactly what you’re looking for?
Ask My Question

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

New questions