From 032dc034194100cb3428d073efd0a8ed05c3accd Mon Sep 17 00:00:00 2001 From: Chayan Bhawal Date: Thu, 27 Sep 2018 21:08:17 +0530 Subject: Updating Plot folder --- .../Scilab_code/Tutotial5_nonlinear_equation.sce | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Tutorial5_Nonlinear_equation/Scilab_code') diff --git a/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce b/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce index 6ab3a23..6d38c84 100644 --- a/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce +++ b/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce @@ -10,10 +10,22 @@ function y = nonlinear_func(x) endfunction -//Initial guess for the solution +//Initial guess for the solution x0 = 0; //Computation of solution using fsolve y_result = fsolve(x0,nonlinear_func); - +//Display the solution in command window disp(y_result,'Solution of the equation') + + +//Plot of cos(x)*sin(x) and tan(x)-1 to check validity of the solution of fsolve +//To create data-points for computation of the functions cos(x)*sin(x) and tan(x)-1 +t = linspace(-201,-200); +z1 = cos(t).*sin(t); +z2 = tan(t)-1*ones(length(t)); + +//To plot t versus cos(t)*sin(t) and tan(t)-1 +plot2d(t,[z1' z2']) + + -- cgit