how can i solve simultaneous equation using genetic algorithm ?
이전 댓글 표시
x = 10*cos(t1) + 5*cos(t1 + t2)
y = 10*sin(t1) + 5*sin(t1+t2)
i have these two equations and i have known outputs x=10 and y=5, how can i solve them keeping in mind that the outputs are unknown and i want to generate them using genetic algorithms.
댓글 수: 3
Walter Roberson
2016년 3월 18일
Note: there are multiple solutions for many (x,y) pairs.
ahmed mohamed
2016년 3월 19일
Walter Roberson
2016년 3월 20일
There are two solutions for that exact known input.
답변 (1개)
John BG
2016년 3월 20일
Hi Ahamed
cos(A)=.5*(exp(j*A)+exp(-j*A))
sin(B)=-j*.5*(exp(j*B)-exp(-j*B))
x = 5*(exp(j*t1)+exp(-j*t1)) + 2.5*(exp(j*(t1+t2))+exp(-j*(t1+t2)))
y = -j*5*(exp(j*t1)-exp(-j*t1)) - j*2.5*(exp(j*(t1+t2))-exp(-j*(t1+t2)))
x = 5*exp(j*t1)+5*exp(-j*t1) + 2.5*(exp(j*t1)*exp(j*t2)+exp(-j*t1)*exp(-j*t2))
y = -j*5*(exp(j*t1)-exp(-j*t1)) - j*2.5*(exp(j*t1)*exp(j*t2)-exp(-j*t1)*exp(-j*t2))
now substitution
u=exp(j*t1)
v=exp(j*t2)
x/5 = u+1/u + .5*(u*v+1/(u*v))
y/(-j*5) = u-1/u - .5*(u*v-1/(u*v))
since you claim to have x and y fixed to constant values
k1=x0/5
k2=y0/(-j*5)
can you solve the u v system?
i also had a look at
x = 5*cos(t1) + 5*cos(t1) + 5*cos(t1 + t2)
y = 5*sin(t1) + 5*sin(t1) + 5*sin(t1+t2)
using:
cos(A)+cos(B)=2*cos((A+B)/2)*cos((A-B)/2)
sin(A)+sin(B)=2*sin((A+B)/2)*cos((A-B)/2)
x/5=cos(t1)+2*cos(t1+t2/2)*cos(t2/2)
y/5=sin(t1)+2*sin(t1+t2/2)*cos(t2/2)
and
cos(A+B)=cos(A)*cos(B)-sin(A)*sin(B)
sin(A+B)=sin(A)*cos(B)+cos(A)*sin(B)
but the u v system seems a good start point, doesn't it?
If t1 and t2 ranges are narrow, perhaps you would like to try Taylor (MacLaurin) approximations for cos() and sin() from http://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf

If you find this answer of any help solving your question, please click on the thumbs-up vote link,
thanks in advance
John
카테고리
도움말 센터 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!