Maths and Java Script any one tried it?

Joined
27 Jan 2008
Messages
23,679
Reaction score
2,668
Location
Llanfair Caereinion, Nr Welshpool
Country
United Kingdom
I have used Excel many times for those calculations which come up again and again but thought I would try Java Script here is my attempt.
To work out volt drop and cable lengths as to if there are any errors not sure but instead of using Lookup as I would have done with Excel I used the for, and else but used standard figures for 1, 1.5, 2.5, 4, 6, 10 and 16 so any entries between will jump to standard sizes.

Seems to work OK it all started when I was told you can used 106 meters in a ring and be within the volt drop limits.

Entering 1.3 for Zs and 16A for Design current for circuit Ib does give some interesting results only 43 meters rather than 53 (half that used with ring) which does point to the problem when splitting a ring into two radials. It is of course the fact that the ring has a design current of 26 not 32 amp.

But also to get the 106 meters gives a ELI of 1.50 not 1.44 but the real pain was adding the correction for mA/V/m however the figures do seem to be tying in with what is said so think they are correct until some one points out my errors.
 
Sponsored Links
... it all started when I was told you can used 106 meters in a ring and be within the volt drop limits.
Yes, I believe that’s true if one calculates the VD at 30°C (and uses a design current of 26A), but I’m not sure how ‘reasonable’ that is. Should one not consider the ‘worst case’ of cable being at maximum operating temperature (usually 70°C), in which case the maximum length of a 2.5mm² ring would (for a 26A design current) be about 98 metres.
Entering 1.3 for Zs and 16A for Design current for circuit Ib does give some interesting results only 43 meters rather than 53 (half that used with ring) which does point to the problem when splitting a ring into two radials. It is of course the fact that the ring has a design current of 26 not 32 amp.
Well, yes, if you wanted to get the ‘equivalent’ maximum cable length for a radial (i.e. 53m) you would have to work with a design current of 13A (half of 26A), not 16A. However, I doubt whether there is much of a ‘problem’ - in most domestic situations, even 43m is a lot of cable!

Kind Regards, John
 
I have used Excel many times for those calculations which come up again and again but thought I would try Java Script here is my attempt. ... the figures do seem to be tying in with what is said so think they are correct until some one points out my errors.
A very few quick checks seem to indicate that it is calculating correctly, although it would obviously take a lot more exhaustive 'testing' to make sure that it always got things right!

However, I think it would probably be much more useful if there were more versatility about what it could calculate, and from what. As things stand, as far as I can make out, it can only work out VD and cable length on the basis of input values of Ze and Zs (plus info relate to cable etc.) - which is not very useful for design purposes. I would have thought it would be more useful (for design) if one could, for example, input cable length and Ze (plus cable details, temp etc.) and calculate VD and estimated Zs from that.

Kind Regards, John
 
OK I will have to design another one. I found it hard to get my head around Java Script so mark one is doing the same as the excel spread sheet did. Mark two I will try different variables.

I am really not sure it's a good idea to design right on the limits and having the ELI over 1.44 seems to go against the grain. Yes I know line to neutral is 1.24 so the magnetic part of the trip would work with a short circuit line - neutral and with line - earth the RCD covers but most meters I have used are set up line - earth I have thought about a second lead to do line - neutral rather than use the probes.
 
Sponsored Links
Good work, Eric!

I don't get the maths / formulae necessarily, but I can definitely help with the javascript side of it. If you'd like any help, hints or suggestions, please PM me.

Cheers
Scott
 
Thanks it has not been as easy as expected needing parseInt was the first hurdle and really would have been better if I could use a select box for selecting the cable size.

Ring main Yes or No caused me a problem in the end I made yes = 2 and no = 1 then I used this as a multiplier when ring selected.

But a pull down menu with 1, 1.5, 2.5, 4, 6, 10, and 16mm² would be far better than what I have. I used a if and else if chain so if less than 1.5 I assume = 1 mm and if less than 2.5 a assume 1.5 mm and so on.

Also had a few silly faults like cap instead of lower case or reverse think Math.pow has to start with cap.

Tried Java Script before to show pictures but this is first step into calculations. Problem is I find how to do something then can't remember how I did it when I return to the page.
 
On new version I got it to show volt drop due to cable length and was about to get it to work out Zs but then thought as a designer Zs is not that important as the RCD will trip with a high Zs it is the impedance between line and neutral which is more important think called Zm as ohms but normally expressed as amps?

With TN-C-S Ze will be same as line - neutral but this is not the case with TT I will need the line - neutral impedance think it will be expressed as PSC.

Thoughts please.
 
On new version I got it to show volt drop due to cable length and was about to get it to work out Zs but then thought as a designer Zs is not that important as the RCD will trip with a high Zs it is the impedance between line and neutral which is more important think called Zm as ohms but normally expressed as amps?
I don't really understand all this. In a TN installation, the primary interest (requirement) is nothing to do with 'additional' (RCD) protection but is, rather, to ensure that Zs is low enough for the circuit's OPD to operate in response to a L-CPC fault. It therefore is Zs which matters, and the impedance of the neutral conductor has nothing to do with it.
With TN-C-S Ze will be same as line - neutral but this is not the case with TT I will need the line - neutral impedance think it will be expressed as PSC.
With TN, there is, in practice, clearly no possibility that PEFC will be greater than PSCC in an 'intact' installation, since CPCs are never larger than the corresponding L/N conductors. Hence, if the Zs requirements are met in relation to L-CPC faults, so inevitably will be disconnection in relation to L-N faults. However, with TT, when there is usually no hope of Zs being low enough for L-CPC faults to operate an OPD (reliance for this being on a RCD), as you say, one does have to check that the L-N loop impedance is low enough (or PSCC high enough) for satisfactory OPD response to L-N faults.

Kind Regards, John
Edit: 'PEFC' and 'PSCC' changed so as to be right way round!
 
With TN, there is, in practice, clearly no possibility that PSCC will be greater than PEFC in an 'intact' installation,
Typo ?
Yes, sorry - a typo :oops:. Please swap 'PSCC' and 'PEFC' in above (I will edit the original). I meant everything else I wrote, once those two abbreviations are round the right way.

Kind Regards, Joh
 
It is of course the fact that the ring has a design current of 26 not 32 amp.
I should probably have commented on this, lest any readers get confused - particular because in my response I probably partially perpetuated the potential confusion ....

The 'design current' (Ib) of a 32A ring final circuit is, of course, 32A. However, specifically for the purpose of calculating VD, the convention (I'm not totally sure where from) seems to be to assume that, at maximum (32A) loading, 20A of that load is at the centre of the ring and the remaining 12A spread equally along the lengths of the two 'arms' of the ring. For VD calculation purposes (only) that latter is equivalent to a 6A load at the centre of the ring. VD calculations for a 32A ring are therefore undertaken on the basis of a 26A load (20A + 6A) at the centre of the ring.

Although I don't really see any conceptual reason why not, I have not seen any similar 'conventions' proposed for radial circuits. People usually calculate the VD of a radial on the assumption that it is loaded with the full design current at its far end. If there were a convention similar to that used for rings, one might expect VD to be calculated on the basis of about 60% of the design current being drawn at the far end, and the remaining ~40% spread along the length of the radial. However, things would get complicated if there were branches in the circuit, so maybe that's why we don't do it!

Kind Regards, John
 
Sorry my point is a ring with 106 meters of cable will have a Zs of 1.50 Ω which is greater the the 1.44 Ω allowed for a B type 32A MCB but still is within the 11.5 volt drop permitted.

However since the neutral wire is thicker than the earth wire if you did the loop impedance on line - neutral it would be around 1.24 Ω well within the 1.44 Ω allowed for a B32 MCB.

Some meters and I must stress only some will measure loop impedance line - earth but short circuit current line - neutral for the latter we should measure both line - earth and line - neutral and take the highest figure to ensure the MCB is within the limits often either 4.7 kA or 10 kA.

However since the better meters measure line - neutral this would be more useful to ensure a B32 will trip on the magnet part of the trip it really does not matter if we look at 1.44 Ω or 160 A with a 230 volt supply.

Hence why with this version I went for the prospective short circuit current rather than the loop impedance.

Clearly with a TT supply the earth loop impedance will only be good enough to trip a RCD. With a TN-C-S with Ze at 0.35 Ω clearly we can aim for a ELI low enough to trip the magnetic part of the MCB. As to TN-S at 0.8 this has always been something which I have questioned. With a RCD then same as with a TT but without it would be near impossible to install a shower and before 2008 and RCD protection rings would need to be rather short.

Until we can agree on how circuits should be protected my attempts at a calculator seem rather pointless. I will watch replies with interest to see if I should remove Mk 2 calculator or to add more functions.
 
Sorry my point is a ring with 106 meters of cable will have a Zs of 1.50 Ω which is greater the the 1.44 Ω allowed for a B type 32A MCB but still is within the 11.5 volt drop permitted.
It obviously depends upon Ze. With the Ze of 0.35Ω you used, although a 106m long ring would comply with the guidance regarding VD, it would be non-compliant in respect to fault protection with a B32. If Ze were less than about 0.29Ω, it would be compliant.
However since the neutral wire is thicker than the earth wire if you did the loop impedance on line - neutral it would be around 1.24 Ω well within the 1.44 Ω allowed for a B32 MCB.
Sure, but a 'compliant' L-N loop impedance does not really help if the Zs (EFLI, L-E loop impedance) is too high to be compliant.
Some meters and I must stress only some will measure loop impedance line - earth but short circuit current line - neutral for the latter we should measure both line - earth and line - neutral and take the highest figure to ensure the MCB is within the limits often either 4.7 kA or 10 kA.
Well, yes, as I said (initially back to front :) ), PSCC will inevitably be greater than PEFC - so if it's the breaking capacity of the MCBs you're worried about, then you need to measure L-N loop impedance. However, as I often say, although my experience is very limited, I've never seen an installation with a PSCC much over 1 kA, let alone 6kA or 10 kA (but I admit I've never looked in London) - have you seen these very high PSCCs in domestic installations? On the other hand, in a TN installation there's really no need to measure L-N loop impedance from the point of view of protection against L-N faults, since if disconnection times are satisfied by the Zs (L-E loop impedance), they inevitably also will be satisfied for L-N faults.
Clearly with a TT supply the earth loop impedance will only be good enough to trip a RCD. With a TN-C-S with Ze at 0.35 Ω clearly we can aim for a ELI low enough to trip the magnetic part of the MCB.
You have to more than 'aim' - this is obviously a requirement!

... and don't forget that the loop impedance requirements are going to get a bit more demanding next year!

Kind Regards, John
 
Sorry my point is a ring with 106 meters of cable will have a Zs of 1.50 Ω
Doesn't 106m of 2.5/1.5 have an r1+r2 of 19.51x106/1000 = 2.068 / 4 = R1+R2 of 0.52Ω x 1.2Ct = 0.62Ω.

Even with a Ze of 0.8 (unlikely) that only results in a Zs of 1.42Ω.
 
Sorry my point is a ring with 106 meters of cable will have a Zs of 1.50 Ω
Doesn't 106m of 2.5/1.5 have an r1+r2 of 19.51x106/1000 = 2.068 / 4 = R1+R2 of 0.52Ω x 1.2Ct = 0.62Ω. Even with a Ze of 0.8 (unlikely) that only results in a Zs of 1.42Ω.
Your calculation appears correct - maybe I was too quick to believe eric's calculator (and, IIRC, he used a Ze of 0.35Ω)!

IT looks as if the calculator probably got double the correct R1+R2 (i.e. about 1.24) and then added on the 0.35Ω (or whatever) Re. I must 'revisit' the calculator and investigate!

Kind Regards, John
 

DIYnot Local

Staff member

If you need to find a tradesperson to get your job done, please try our local search below, or if you are doing it yourself you can find suppliers local to you.

Select the supplier or trade you require, enter your location to begin your search.


Are you a trade or supplier? You can create your listing free at DIYnot Local

 
Sponsored Links
Back
Top