Modelling a system of differential equations with recurrences in matlab
Mostrar comentarios más antiguos
Trying to model a system in the form
a*u_n(t)'' + b*u_n(t) = k( v_n+1(t) + v_n-1(t) - 2u_n(t) )
c*v_n(t)'' + d*v_n(t) = k( u_n+1(t) + u_n-1(t) - 2v_n(t) )
a,b,c,d,k are all constants
Pretty sure this can only be done numerically
5 comentarios
This system can only be solved for a finite start and end value for n.
So you need "boundary conditions" that prescribe u_0 and v_0 ("start functions") as well as u_N and v_N ("end functions").
Further initial conditions at t = 0 are required for u_1,...,u_N-1 and v_1,...,v_N-1 as well as u_1',...,u_N-1' and v_1',...,v_N-1'.
Could you supply both boundary and initial conditions ?
David Goodmanson
el 12 de Oct. de 2025
Hi Austin, does the last term on the first line equal -2u_n(t) (certainly possible) or should it be -2v_n(t) ? Similarly for the last term on the second line.
Since the boundary conditions are defined by second-order differential equations for u_0, v_0, u_n and v_n, we need u_i(0), u_i'(0), v_i(0), v_i'(0) for i = 0,...,n.
You said we may assume u_i(0) = v_i(0) = 0 for i=1,...,n-1. So u_0(0),v_0(0),u_n(0),v_n(0) and all derivatives u_i'(0) and v_i'(0) at t = 0 ( (i = 0,...,n) are to be added to the problem description to make the system solvable.
Austin
el 12 de Oct. de 2025
Respuesta aceptada
Más respuestas (1)
John D'Errico
el 12 de Oct. de 2025
Editada: John D'Errico
el 12 de Oct. de 2025
This is known as a delay differential equation. You will find any solvers for them starting with the letters dde.
help dde23
You will convert the second order DDEs each into a pair of first order DDEs using the standard trick, so you will have a system of 4 DDEs. Standard trick:
If you have a second order equation of the form:
y''(x) = stuff
you convert it into a pair of first order equations by creating a new unknown function, I'll call it z, where z is just the currently unknown first derivative of y.
y'(x) = z(x)
z'(x) = stuff
The same will apply in your case, even with a DDE.
1 comentario
Austin
el 12 de Oct. de 2025
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!