summaryrefslogtreecommitdiff
path: root/Tutorial4_ODE
diff options
context:
space:
mode:
Diffstat (limited to 'Tutorial4_ODE')
-rw-r--r--Tutorial4_ODE/Data/README.md1
-rw-r--r--Tutorial4_ODE/Problems/Tut4.pdfbin0 -> 50507 bytes
-rw-r--r--Tutorial4_ODE/Scilab_code/Tutorial4_ode_matrix.sce2
-rw-r--r--Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple.sce4
-rw-r--r--Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple_plot.sce13
5 files changed, 15 insertions, 5 deletions
diff --git a/Tutorial4_ODE/Data/README.md b/Tutorial4_ODE/Data/README.md
deleted file mode 100644
index b212332..0000000
--- a/Tutorial4_ODE/Data/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# Data for ODE
diff --git a/Tutorial4_ODE/Problems/Tut4.pdf b/Tutorial4_ODE/Problems/Tut4.pdf
new file mode 100644
index 0000000..2ad3662
--- /dev/null
+++ b/Tutorial4_ODE/Problems/Tut4.pdf
Binary files differ
diff --git a/Tutorial4_ODE/Scilab_code/Tutorial4_ode_matrix.sce b/Tutorial4_ODE/Scilab_code/Tutorial4_ode_matrix.sce
index fff34eb..33e5e33 100644
--- a/Tutorial4_ODE/Scilab_code/Tutorial4_ode_matrix.sce
+++ b/Tutorial4_ODE/Scilab_code/Tutorial4_ode_matrix.sce
@@ -1,4 +1,6 @@
//This script demonstrates the use of ODE solver when matrix is involved
+clear
+clc
//Definition of the function
function ydot = func(t,y)
diff --git a/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple.sce b/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple.sce
index ad42d4d..66431a4 100644
--- a/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple.sce
+++ b/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple.sce
@@ -1,9 +1,11 @@
//This script demonstrates the use of ODE solver
+clear
+clc
//Definition the function.
//The function is dy/dt = cos(t)*sin(t) - tan(t) + 1
function ydot = func(t,y)
- ydot = cos(t)*sin(t) - tan(t) + 1
+ ydot = t^2*exp(-2*t) + y
endfunction
//Initial condition of the problem, a scalar or vector
diff --git a/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple_plot.sce b/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple_plot.sce
index 4ecf87e..f2df913 100644
--- a/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple_plot.sce
+++ b/Tutorial4_ODE/Scilab_code/Tutorial4_ode_simple_plot.sce
@@ -1,6 +1,8 @@
//This script demonstrates the use of ODE solver and computing the
//solution at different times. The output is in the form of a plot
//of time versus computed solution
+clear
+clc
//Definition the function.
function ydot = func(t,y)
@@ -11,9 +13,14 @@ endfunction
y0 = -1;
//Start time
t0= 0;
+
//The array of time where the solution is computed
-t = 4:0.01:10;
+tf = 4:0.01:10;
+
//Calling the ODE solver
-sol=ode(y0,t0,t,func);
+sol=ode(y0,t0,tf,func);
+
+
//Plotting the result
-plot(t,sol)
+plot(tf,sol,'Linewidth',3)
+xtitle('Dynamics of y','Time','y(t)')