There's not 2 without 3 (in spanish sounds better)

This time I'm not only asking, but also offering some equations and scripts that I've designed to solve a problem that I've faced during the design of the power distribution on my Dromo project.

The problem is to find the voltage drops along a dc power line, in which a number of devices are connected in series at different points in the line. All those devices are equipped with switching regulators, they can be feed at a quite range of voltages, and will consume different currents depending on the voltage at its input. Although it's not completely precise, I've modeled those devices as constant power devices, thus the current consumption will be a quotient between wats and volts. I've also considered a constant distance between devices, and the same power need for all of them. The line will be copper wire with a constant diameter all along.

The simplified equation to find the voltage at the input of a device would be something like this:

being X the device index, n the number of devices, Rl the resistance of the segment of line between this device and the previous one, and Id(j) the current consumption of the device indexed 'j'. As I told before, I've modelled the current consumption as a quotient of the constant wats the device consumes, and the voltage it sees at its input.

After simplifying the equations I find that I'm not that good at maths. For n=1 I got two solutions (quite interesting and curiously valid). For n=2 I got 4 solutions,

two of them are imaginary numbers (Even more interesting!) and so forth. I got tired of Dave's CAS, and tried an open CAS software: Maxima. I got solutions for systems of 15 equations in the blink of an eye (amazing stuff, really), but that was a complete mess. Then I found I could use the newton's method to iteratively solve the system given an initial solution, and here I give you what I came up with!:

`kill(all)$`

load(mnewton)$

h(n):=[makelist(V[i]=V[i-1]-(17*(sum(1/V[j],j,i,n))*l*W)/(500*%pi*(dia/2)^2),i,1,n),makelist(V[i],i,1,n),makelist(V[0],n)]$

consts:[n=8, l=10, dia=1, W=1.196, V[0]=24]$

params:subst(consts,h(ev(n,consts)))$

volts:mnewton(params[1],params[2],params[3])[1];

relvolts:makelist('dV[i-1] = rhs(volts[i-1])-rhs(volts[i]),i,2,length(volts))$

watsseg:map(lambda([x], lhs(x)=float(ev(rhs(x),consts))),makelist('W[i-1]=(rhs(volts[i-1])-rhs(volts[i]))²/(l*0.068/(%pi*dia^2)),i,2,length(volts)))$

waste:lsum(rhs(x),x,watsseg)$

used:ev(W*n,consts)$

print("total potential loss: ", dV:ev(V[0]-rhs(volts[n]),consts), "v, ", ev(dV*100/V[0],consts), "%")$

print("total wasted wats:",waste)$

print("used wats:",used)$

print("efficiency:",used*100/(waste+used),"%")$

To run it, copy that into Maxima, change the values of n, l, dia, W, V[0] to your harts contempt, and press shift+return, et voila! (if it fails to come with a solution, it's because it's impossible to solve

)

If you have any fun reading this, or find that I'm a complete math disabled, please tell me

Also, if you have a better solution (or in case this is just b*****t, a working one) please share!