how to write the code for the following condition

I want to find the value of theta0 and theta1,which when substituted in the equation i have to get beta=0.5
the eqn is 2*(sin(theta0)+sin(theta1))=1;
i have initial value for
theta0 = (1-beta)/2;
theta1 = (1-beta)/2;
i have to iterate the values of theta0 and theta1 to get beta as from the above eqn.

답변 (1개)

Roger Stafford
Roger Stafford 2014년 2월 14일

0 개 추천

If I understand you correctly, you have only one equation to satisfy and two variables that can be adjusted. If so, that means there will be an infinite continuum of possible solutions in general. You need to have another equation which the thetas also satisfy to be able to obtain a unique solution.

댓글 수: 3

%% Case1: beta=0.5
%Input
syms beta theta0 theta1
M=1; %Varying parameter
theta0 = M*(1-beta)/2;
theta1 = M*(1-beta)/2; %Initial Slope at ends of SSB
while beta >= 0.5 do
solve((2*(sin(theta0)+sin(theta1)/M)),beta);
% beta will be solved,if it is not equal to 0.5,
% then it has to do iteration by changing the theta1 and theta0
theta0_new = theta0+0.001;
theta1_new = theta1+0.001;
end
disp(theta0_new)
disp(theta1_new)
can you correct ths.i hope you understand
U r rite, i have another eqn too which is as follows
2*(cos(theta1)-cos(theta0))/M =0;

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

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2014년 2월 14일

댓글:

2014년 2월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by