I don't know what you are talking about, I don't know math But I way I use to do it is: First I slingshot of the Mun to get me into a sun orbit. Then I just get an encounter with Duna, an other way is that you place a manuver node in a orbit of Kerbin, and try to get an encounter, if you don't get an encounter, but is very close to do it. Just do the manuver, once out of Kerbins SOI, you try to get an encounter using the yellow markers on the manuever node or/and the blue circles. You can place it anywhere on you want on your sun orbit to duna, but I usually set it in the middle. Hopefully you understand me, my english is not that good, but I hope you understand and that this helps. And other way is, if you actually get an encounter with duna in orbit of Kerbin, and do the manuever, and still have an encounter, time warp untill you are out of kerbins SOI then change the manuver. Because it would have changed. And if you want to change periapis/apoapis of the encounter, I dont know how they are spelled, you change the manuver just a bit before you are about to get into duna SOI.