I'm basically trying to model the motion of a compound double pendulum, the lagrange equations produce this pair of coupled differential equations: Equations of motion for a compound pendulum.
I wish to apply ode45 to model the behavior over time. I understand that they need to be reduced into 4 first order equations, but I'm baffled over the syntax/rearrangement that may or may not be required due to the coupling.
Related
I'm using the MATLAB's function 'pdepe' to solve a problem with some partial differential equations, a parabolic one.
I need to know the kind of numerical method that function uses, 'cause I have to notify this in a report.
The description of the function in MathWorks is "Solve initial-boundary value problems for systems of parabolic and elliptic PDEs in one space variable and time". Is it a finite difference method?
Thanks for helping me.
Taken from the Matlab 2016b documentation for pdepe:
The time integration is done with ode15s. pdepe exploits the
capabilities of ode15s for solving the differential-algebraic
equations that arise when Equation 1-3 contains elliptic equations,
and for handling Jacobians with a specified sparsity pattern.
Also, from the ode15s documentation:
ode15s is a variable-step, variable-order (VSVO) solver based on the
numerical differentiation formulas (NDFs) of orders 1 to 5.
Optionally, it can use the backward differentiation formulas (BDFs,
also known as Gear's method) that are usually less efficient
As indicated by Alessandro Trigilio, ode15s is used to advance the solution forward in time. Exactly what the function is advancing in time is a semi-discrete, second-order Galerkin formulation for non-singular problems or a semi-discrete, second-order Petrov-Galerkin formulation for singular problems (polar or spherical meshes that include the origin). As such, the spatial discretization is finite element in nature.
I know that MATLAB can solve a system of 2 coupled PDEs using pdex4, however is there something similar that can solve a system of more coupled PDEs, say 6? The bigger system has the same structure (dependence on partial derivatives, boundary conditions, type of initial condition etc) as the system of 2 equations.
Thanks.
With the FEATool Matlab FEM toolbox you can set up and solve an arbitrary number of coupled PDEs.
The function pdefun (that you pass as an input to pdepe) defines your system of equations and has the general form,
[c,f,s] = pdefun(x,t,u,dudx)
c, f, and s are coefficients in the PDE (see Eq. 1-3 here). They can be column vectors to allow for any number of coupled equations. In the pdex4 example these vectors have 2 elements; in your case they would have 6.
MATLABs Partial Differential Equation Toolbox allows you to solve systems of multiple equations. For coupling of source terms, you can solve the initial PDE for the source, then use that as an input for a second PDE model which will give the final results. More info can be found here
Are there any codes in matlab to to calculate the gains of state-space matrix for nonlinear system? the system equations are written in differential equations and I used Runge-Kutta 4th Order Method to get the dynamic response of the states with time.
This is a space and time dependant partial differential equation. I have attached the image containing equation and initial and boundary conditions. I wish to get the code to solve this equation numerically using finite volume method.
Also if the first two terms are not there, than one can say parabolic or elliptic equation, here the additional two C_A terms including exponential dependence and the last boundary conditions which is both the functions of time and space makes it complicated.
Thanks
The two coupled equations are as follows: where i->sqrt(-1); 'u_t' refers to the first order derivative w.r.t. the time 't', 'u_z' is the first order derivative w.r.t. 'z', similarly, 'u_tt' means second order derivative w.r.t. time.
|u|^2 is u*conjugate(u).
i*u_z-a*u_tt+|u|^2*u+kv=i*b*(u+c*u_tt)
i*v_z-a*v_tt+|v|^2*v+ku=i*b*(v+c*v_tt)
I have solved such single equation, but how to solve such two-coupled equations in MATLAB?
From the link here
Partial differential equations with pdepe
MATLAB's pdepe solves a class of parabolic/elliptic PDE systems. The
time-dependent Schrodinger equation is an example of parabolic PDE
while the Poisson equation is an example of elliptic PDE. We will not
discuss the use of pdepe in the class but refer you to the MATLAB's
documentation for the details.
Looks like your best bet is to look at pdepe as an example of a parabolic PDE.