Computer Science, asked by puneet9899186251, 4 months ago

THIS IS SCILAB CODE FOR ORDINARY DIFFRENTIAL EQUATION
IT IS SHWOING ERROR THAT INDEX IS INVALID

function [y1,y2]=calculate12(x,t);
y1=5(x)*t;
y2=3*t+(x*sin(x));
endfunction
x0=0;
t0=0;
x=0:2*%pi;
t=-1:5;
z=ode(x0,t0,t,calculate12);
plot(t,z);

Answers

Answered by maralsarthak1834
0

Answer:

clc

clear

function f=F(x)

f(1)=x(1)-(0.4458*x(2)^(-2))

f(2)=x(3)-(0.26936*x(2)*(-1))

f(3)=(2.616*x(2))-(x(4)*x(1)^2)

f(4)=(0.316/(x(3)^(1/4)))

endfunction

function j=jacob(x)

j(1,1)=1;j(1,2)=0.8916*x(2)^(-3);j(1,3)=0;j(1,4)=0

j(2,1)=0;j(2,2)=0.26936*x(2)^(-2);j(2,3)=1;j(2,4)=0;

j(3,1)=-2*x(1)*x(4);j(3,2)=2.616;j(3,3)=0;j(3,4)=-1*x(1)^2;

j(4,1)=0;j(4,2)=0;j(4,3)=-2/x(3)/log(10);j(4,4)=(-0.5*x(4)^(-1.5))-(1/x(4)/log(10));

endfunction

x0=[1 1 2000 1];

[x,v,info]=fsolve(x0,F,jacob);

disp(x);

Similar questions