y'''-y''+y'-y+2 = 0where y(x) is unknown function. We are going to solve this equation numerically using Scilab 5.5.2 and its toolbox Xcos. We assume the following initial conditions: y(0) = 1, y'(0) = -1 and y''(0) = 1.
In general you should solve the equation algebraically with respect to its highest derivative
y''' = y'' - y' + y - 2and build the Scicos diagram, where you construct the input to a set of integrators based on their outputs. Since we deal with a third-order differential equation, we use the series of three integrators. The possible solution looks as follows
Above we have used the following blocks form the Palettes: INTEGRAL_m, EXPRESSION, CSCOPE and CLOCK_c.
In the block EXPRESSION we set the following parameters:
Now we set initial conditions in the integral blocks. The initial condition parameter of a given integrator stands for initial value of its output signal. Thus in the first block from the left we set initial value of the second derivative y''(0) = 1:
Then we do the same with the remaining integration blocks, i.e. in the second one we set the initial value of the first derivative y'(0) = -1, while in the last one we put as initial condition y(0) = 1.
We also use blocks CSCOPE and CLOCK_c in order to show results. In the last one we set the following parameters
We save the model and then we start simulation obtaining the following plot
Let us change the constant term of the equation slightly, i.e. let us add 10^10 to 2. We obtain the following result:
i.e. the system is unstable. Similar result we get in the case of subtraction of 10^10 from 2:
No comments:
Post a Comment