diff options
author | P Sunthar | 2018-10-02 00:09:14 +0530 |
---|---|---|
committer | P Sunthar | 2018-10-02 00:09:14 +0530 |
commit | 6d39446c434cfcca02ae7a4551e2d66edf9def7f (patch) | |
tree | f0e84e8fadd28600bfdeadf1471d59be5eaee54a /Tutorial5_Solution_of_equations/Scilab_code | |
parent | 4d0d95e5748137abe4636dc734b03b4e7ccfd6f5 (diff) | |
download | scilab-tutorials-6d39446c434cfcca02ae7a4551e2d66edf9def7f.tar.gz scilab-tutorials-6d39446c434cfcca02ae7a4551e2d66edf9def7f.tar.bz2 scilab-tutorials-6d39446c434cfcca02ae7a4551e2d66edf9def7f.zip |
Renamed dirs
Diffstat (limited to 'Tutorial5_Solution_of_equations/Scilab_code')
6 files changed, 0 insertions, 71 deletions
diff --git a/Tutorial5_Solution_of_equations/Scilab_code/README.md b/Tutorial5_Solution_of_equations/Scilab_code/README.md deleted file mode 100644 index 297d7b8..0000000 --- a/Tutorial5_Solution_of_equations/Scilab_code/README.md +++ /dev/null @@ -1 +0,0 @@ -# Scilab code for non-linear equations diff --git a/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_linear_equation.sce b/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_linear_equation.sce deleted file mode 100644 index dcd5510..0000000 --- a/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_linear_equation.sce +++ /dev/null @@ -1,22 +0,0 @@ -//This scilab script is to compute the solution of a linear equation -clear -clc - -//Example of Ax + b = 0 where unique solution exists -A = [1 2 3;3 2 1;2 4 5]; -b = [7;7;12]; -[x,kerA] = linsolve(A,b); -disp(x,'Solution of Ax + b',kerA,'kernel of A'); - -//Example of Py+q = 0 where solution does not exist -P = [1 2 3;3 2 1;4 4 4] -q = [1;2;1] -[y,kerP] = linsolve(P,q); -disp(y,'Solution of Py + q',kerP,'kernel of P'); - -//Example of Lz+m = 0 where infinite solutions exist -L = [1 2 3;3 2 1;4 4 4] -m = [1;1;2] -[z,kerL] = linsolve(L,m); -disp(z,'Solution of Lz + m',kerL,'kernel of L'); - diff --git a/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_nonlinear_equation.sce b/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_nonlinear_equation.sce deleted file mode 100644 index 7f2a9ce..0000000 --- a/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_nonlinear_equation.sce +++ /dev/null @@ -1,21 +0,0 @@ -//This scilab script is to compute the solution of a nonlinear function with initial -//guess x_0 -clear -clc - - -//The nonlinear equation for which solutions are sought -exec func.sci; - - -//Initial guess for the solution -t0 = 0; - -//Computation of solution using fsolve -y_result = fsolve(t0,func); -//Display the solution in command window -disp(y_result,'Solution of the equation') - - - - diff --git a/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_nonlinear_equation_twovar.sce b/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_nonlinear_equation_twovar.sce deleted file mode 100644 index 2b5dce1..0000000 --- a/Tutorial5_Solution_of_equations/Scilab_code/Tutotial5_nonlinear_equation_twovar.sce +++ /dev/null @@ -1,17 +0,0 @@ -//This scilab script is to compute the solution of a nonlinear function with initial -//guess x_0 -clear -clc - - -//The nonlinear equation for which solutions are sought -exec functwovar.sci; - - -//Initial guess for the solution -t0 = [0;0]; - -//Computation of solution using fsolve -y_result = fsolve(t0,functwovar); -//Display the solution in command window -disp(y_result,'Solution of the equation') diff --git a/Tutorial5_Solution_of_equations/Scilab_code/func.sci b/Tutorial5_Solution_of_equations/Scilab_code/func.sci deleted file mode 100644 index 013277d..0000000 --- a/Tutorial5_Solution_of_equations/Scilab_code/func.sci +++ /dev/null @@ -1,4 +0,0 @@ -//This is script to define a fuction -function y = func(t) - y = cos(t)*sin(t) - tan(t) + 1 -endfunction diff --git a/Tutorial5_Solution_of_equations/Scilab_code/functwovar.sci b/Tutorial5_Solution_of_equations/Scilab_code/functwovar.sci deleted file mode 100644 index 6506ce4..0000000 --- a/Tutorial5_Solution_of_equations/Scilab_code/functwovar.sci +++ /dev/null @@ -1,6 +0,0 @@ -//This is script to define a fuction -function y = functwovar(t) - x = t(1); - z = t(2); - y = [x^2+z^2-1;x^2*exp(-2*x) + z] -endfunction |