Please help me solve this four equations with methode newton-raphson urgent (i have MATLAB R2010a)

hi ,i need file fonction and the code matlab to solve those 4 equations [cos(3.θ1)+cos(3.θ2)+cos(3.θ3)+cos(3.θ4) ]=0 ; [cos(5.θ1)+cos(5.θ2)+cos(5.θ3)+cos(5.θ4) ]=0 ; [cos(7.θ1)+cos(7.θ2)+cos(7.θ3)+cos(7.θ4) ]=0 ; [cos(9.θ1)+cos(9.θ2)+cos(9.θ3)+cos(9.θ4) ]=0 ; with first condition θ1=0.314 ; θ2=0.628 ; θ3=0.945 ; θ4=1.225 ; in interval [0 pi/2] ; the angel's with radiane not degrees thnx

댓글 수: 4

If you need code, then you should write code. We are not a code writing service. You won't learn to use MATLAB until you bother to use it.
Start with the symbolic toolbox, so solve is the tool for this problem. If it fails to give you something useful, then use vpasolve.
You might also try the function fsolve, from the optimization toolbox.
Of course, there are many poorly written Newton-Raphson tools on the file exchange. You might try one of them on your problem. In those cases, free code is probably worth just what you paid for it.
By the way, you need to learn basic MATLAB syntax too. . is not a multiplication operator. * is what is used for multiplication. So again, you need to start learning to use MATLAB.
soorry iam not pro in matalb language but i need to solve that equations soon as i can so u will help me or not :/
@yahia mehda: Please read this thread: Answers: Why your question is not urgent . You will see, that trying to push the voluntary helpers reduce their motivation to post an answer.
The strange notation with "θ1" is simply confusing. Posting the values directly would be a much better idea when you want others to assist you.
The forum usually ignore people, how do not show any own effort. Together with the "urgent" and the annoying "plllz" the chances to get an answer are really small. So better edit the question and show whatyou have tried so far, even if it does not work.
thnx bro iam new here ill edit it thanx for the advice

댓글을 달려면 로그인하십시오.

답변 (1개)

Your problem requires the output to be in a certain range:
[0 2*pi]
I suggest using fmincon. However, the your equations can be put in a function as below:
function out = proby(theta)
out = zeros(4,1);
out(1) = cos(3*theta(1))+...);
out(2) = cos(5*theta(1))+...);
out(3) = cos(7*theta(1))+...);
out(4) = cos(9*theta(1))+...);
end
The fsolve command can be easily applied over such a function. Since you are new, try the following to learn about using fsolve.
help fsolve

댓글 수: 3

function out = proby(theta)
out = zeros(4,1);
out(1) = cos(3*theta(1))+cos(3*theta(2))+cos(3*theta(3))+cos(3*theta(4));
out(2) = cos(5*theta(1))+cos(5*theta(2))+cos(5*theta(3))+cos(5*theta(4));
out(3) = cos(7*theta(1))+cos(7*theta(2))+cos(7*theta(3))+cos(7*theta(4));
out(4) = cos(9*theta(1))+cos(9*theta(2))+cos(9*theta(3))+cos(9*theta(4));
end
i didn't understand fsolve how it work
the result i want it :
i find theta 1 and theta 2 and theta 3 and tetha 4 In order to be four equations equal to zero
fsolve(@theta proby(theta), [initial_theta(1);initial_theta(2),...])
Try this!

댓글을 달려면 로그인하십시오.

질문:

2016년 5월 7일

댓글:

2016년 5월 12일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by