sir, i am not able develop a matlab code to solve four transcendental equations using newton raphson method? i had tried till the creation of jacobian matrix but not able to substitute values in the jacobian matrix please help to solve this problem?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
omkari sai krishna
le 19 Avr 2020
Modifié(e) : Devineni Aslesha
le 4 Mai 2020
syms x1 x2 x3 x4 epsi;
g1=cos(x1)+cos(x2)+cos(x3)+cos(x4)-0.9424;
g2=cos(5*x1)+cos(5*x2)+cos(5*x3)+cos(5*x4);
g3=cos(7*x1)+cos(7*x2)+cos(7*x3)+cos(7*x4);
g4=cos(11*x1)+cos(11*x2)+cos(11*x3)+cos(11*x4);
g=[g1;g2;g3;g4];
x=[x1; x2; x3; x4];
epsi=10e-5;
j=jacobian(g,x);
for i=1:4
x(i,1)=input('enter the intial values\n')
end
disp(x)
f=subs(j);
j_inv=inv(f);
disp(-g);
k=subs(-g);
p=j_inv*k;
This is my code i am not able to substitute initial values in 'P' matrix. please help me to solve this.
0 commentaires
Réponse acceptée
Devineni Aslesha
le 24 Avr 2020
In the given code, the values are not substituted in the jacobian matrix because the initial values are assigned to the variable 'x' but the variables used in the equations are 'x1,x2,x3 and x4'. Please find the code below to substitute the initial values.
x1 = x(1,1);
x2 = x(2,1);
x3 = x(3,1);
x4 = x(4,1);
For more information, refer to this file exchange link
5 commentaires
Devineni Aslesha
le 4 Mai 2020
Modifié(e) : Devineni Aslesha
le 4 Mai 2020
In the above code, you are computing the answer 'xyzvans' even if there is no solution available. Use the return command after display('no solution'); to stop running this script when there is no solution. In this way, the answer will be computed only when the error value is less than epsilon.
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!