how can i solve simultaneous equation using genetic algorithm ?
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 18 de Mzo. de 2016
Note: there are multiple solutions for many (x,y) pairs.
ahmed mohamed
el 19 de Mzo. de 2016
Walter Roberson
el 20 de Mzo. de 2016
There are two solutions for that exact known input.
Respuestas (1)
John BG
el 20 de Mzo. de 2016
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
1 comentario
ahmed mohamed
el 20 de Mzo. de 2016
Categorías
Más información sobre Genetic Algorithm en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!