Analytical or numerical Solution for a coupled differential equation.
Show older comments
I need a help in analytical/numerical solution to a coupled differential equation as attached in the image. Where m=n=3
22 Comments
Torsten
on 11 Jun 2022
What is t ? A second independent variable ?
PS
on 11 Jun 2022
Torsten
on 11 Jun 2022
Should be easy to solve with ODE45. The solver can handle complex-valued ordinary differential equations.
Give it a try.
PS
on 11 Jun 2022
Torsten
on 12 Jun 2022
The only thing you could try is MATLAB's "dsolve" or MATHEMATICA for an analytical solution.
PS
on 2 Jul 2022
Torsten
on 2 Jul 2022
Then - as said - use a numerical ode solver, e.g. ode45.
David Goodmanson
on 3 Jul 2022
Hi PS,
For the two mode case was there a specific form of Cmn(z) that allowed an analytic solution? That won't be the case in general.
PS
on 3 Jul 2022
Walter Roberson
on 3 Jul 2022
dsolve can handle complex-valued equations. However, it is not all that good with complicated equations.
A trick with dsolve is that if it cannot handle the equations with initial conditions, then sometimes it can handle them without initial conditions, and then you might be able to guide it through to solve for the generated constants. That said, there are a lot of cases that dsolve cannot handle even without initial conditions.
PS
on 27 Sep 2022
Torsten
on 27 Sep 2022
ODE45 calculates its own step size - you can't prescribe it.
You can only choose a maximum and a minimum stepsize.
You can define all quantities in the options structure independently from each other.
PS
on 28 Sep 2022
As you mentioned ODE45 calculates its own step size, is there a way to know that ?
You can get an impression of the stepsize from ODE45 by choosing
tspan = [tstart tend]
as a two-element vector.
Then the output T and Y will be given for the (successful) integration steps of ODE45:
[T, Y] = ode45(...)
As i will be giving the same step size in my analytical method to have a fair comparison between the 2 techniques.
An analytical method does not need a stepsize.
Walter Roberson
on 28 Sep 2022
The ode* functions are all adaptive step size. Each time a step succeeds they increase the step size, and each time a step fails they decrease it. If you set the option Refine to 1 and your tspan is exactly two elements then an output will be recorded for each step that succeeds, so you could diff(t) to see the instantaneous time step.
Walter Roberson
on 28 Sep 2022
And of course you can take the t values output by ode45 and subs() them into the dsolve solution to get the analytic solution at the same times, suitable for plotting together with a dashed or dotted line for the second line (to be able to see underneath it in places of overlap)
Torsten
on 8 Oct 2022
the doubt is that the step size used during different coupling coefficients value is significantly different, is this expected or am doing anything wrong here ?
You mean that ode45 takes different step sizes for different values of "Coupling_Coefficient_12" ? This might be the case. At least the errors in both components show that the ode45 solution approximates the analytical solutions quite well, doesn't it ?
PS
on 9 Oct 2022
Analytical solution and solution from ODE45 are almost identical. So it seems ODE45 needs these smaller time steps to get the correct solution within the prescribed error tolerance.
The coupling coefficient is directly related to the frequency of the sin and cos terms in the analytical solution. And if you plot sin(x) and sin(20*x), you will see that it will be much more difficult to resolve the cycles of the trigonometric functions for bigger coupling coefficients.
Plotting the solutions A1 and A2 might help in understanding why solutions for bigger coupling coefficients are more complicated to get (see above).
David Goodmanson
on 10 Oct 2022
Edited: David Goodmanson
on 10 Oct 2022
Hi PS,
If the elements of Cmn are differing functions of z, then an analytic solution will be rare. If all the Cmn are constants, the following is a solution where C is a square matrix of arbitrary size, within reason.
Let B be the diagonal matrix whose k,k element is beta_0k. Then for the matrix exponential
expB(z) = expm(i*B*z) % diagonal matrix
exp(i*beta_0k*z) % its k,k th element
In matrix notation the original equation is
dA/dt = -i*expB(z)*C*expB(-z)*A,
where A is a column vector with n components.
For the solution, let
[V lambda] = eig(B+C)
Lambda is the diagonal matrix of eigenvalues, and denoting its matrix exponential in a similar way as before,
expL(-z) = expm(-i*lambda*z). % diagonal matrix
exp(-i*lambda_k*z) % its k,k the element
The solution is
A = expB(z)*V*expL(-z)*g
where g is a column vector of constant amplitudes that are determined by initial conditions. If the initial conditions are set as A = A0 at z = 0 for some column vector A0, then
g = V\A0.
Answers (0)
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





