suppose the equation is dx/dt = y-z ; dy/dt = xz ; dz/dt = y/z; and if boundary condition for x is x(boundary) = yz.. how this type of equations are solved in matlab?
This is not a boundary value problem. This is an initial value problem with three unknowns. x=yz is not a boundary condition. It should be treated a constraint.
You can use Lagrange multiplier to impose the constraint.
As suggested by the others, you have to use an ODE solver. However, I suspect if you can use MATLAB's ODE solvers directly. They don't have any features supporting constraints.
You may have to write your own code using some time integration technique.
well, you can write the boundary conditions as the M-file bc.m, which records boudary residues.
function res=bc(y0,y1)
%BC: Evaluates the residue of the boundary condition
res=[y0(1);y1(1)-10]; % if, for example you have y(0)=1 and y(1)=10 with a given DEq.
By residue, I mean the left-hand side of the boundary condition once it has been set to 0. the second boundary condition is y(1) = 10, so its residue is y(1) − 10 (depends on the given DEq), which is recorded in the second component of the vector that bc.m returns.
If you do not describe your problem correctly, you will not get any useful answers to solve it.
Please post full details of your system of equations. Verify again about the equation "x=yz". It can not be a boundary condition for this system of equations. It must a be a constraint which the solution at every time instant has to satisfy (for example, conservation law). Calling it as a boundary condition makes no sense.
The index of your system of DAEs is greater than 1. You may not solve it using a directly available ODE solver in Matlab. You have to follow the technique explained here.
I have used the simple example of the motion of the rigid pendulum in 2D. It includes Matlab code as well.
This is an initial value problem in 3 unknowns, x, y an z that you want to obtain as function of t. You have one: initial condition x(t_0)=y(t_0)z(t_0), but you need two more, so you can come up with x(t_0)=x_0, y(t_0)=y_0 z(t_0=z_0, with x_0, y_0 and z_0 values you have calculated from your BC's. After that it will be plain sailing and you can use standard MATLAB ODE solvers. If you lack those other two initial conditions MATLAB isn't going to help you.