Skip to main content
13-Aquamarine
January 26, 2025
Solved

Analysis of assemblies dynamic thermal performance behaviour under ISO 13786-2023

  • January 26, 2025
  • 1 reply
  • 2912 views
Hi there!

Thanks to the community members for being patient with my questions.

Although a lot of guys in the PTC community gave me  valuable tips,

I still want to improve my code slightly (perfectionism).

 

So, I'll try to list  of what do I want to get from my  code:

  1. Define all the calculus dependencies in the first step.
  2. Define the variables' range (each layer generally has its range). The idea is to account for all possible permutations.
  3. The k1 and f functions should be figured out for each set of thicknesses (variable) iteration of my multilayered assembly (I have no idea how to assign a specific range of thickness to a particular layer; this is my weak point; I’m not confident in this area).
  4. To sort out what of the total k1 and f values fit the restriction condition and arrange the result in a matrix with headers (for convenience, with aggregated values’ Names) (the particular matrix components should be plottable afterwards).
  5. The number of layers varies, so I need to script the sequence of each iteration by indexing (I'm a bit frustrated in this regard right now).
  6. The desired code has to be as compact and optimised ( in terms of machine time consumerance) as possible (the maxima goal).

Firstly, I tried to make it more generalised (with indexing), but the understanding of the leakage of base coding skills became evident very quickly.

 

I also understand that poor code is better than its absence.

 

For clarification, I attached my code in MathCAD Prime 10.0.0 and asked for assistance (advice, somehow) on how to deal with it.

I would appreciate any help.

 

I've attached my modified code and working sample for two layers.

 

PS. I also cannot understand why Chat GPT always creates JS-based code for my appropriate MathCAD prompt.

 

Best regards and thanks in advance.

Best answer by Werner_E

But thats nearly exactly what I provided with my generic "doIt" program if you make the two changes indicated in my reply above so that the numbering starts by 1 and not by 0. ????

Whats new and was never mentioned by you so far are the different step widths k (this variable needs to be of unit length!).

Furthermore the values in the vector you call "a" in your last sheet seem to have a different meaning now as they now are one less the number of times the value of d is taken or better its the number of times the new increment/step k is added to the base thicknesses in d, starting with 0!

So to get the 1000 entries for your three element vector d you have to chose "a" to be all 9's and not 10's!

Attached the modified program to accommodate the new changes and I also changed it so that d1 is modified first and the other values stay constant rather than doing it the other way round as in the original "doIt" program.

 

I also added a simple version using nested for-loops. You may change the values in the three vectors but the program will only work for two elements.

Werner_E_0-1738371535423.png

If you want to work it for three-element vectors, you would have to add another for-loop around the already existing ones.

Werner_E_1-1738371891626.png

 

 

1 reply

21-Topaz II
January 26, 2025

In kJ definition set label as Unit

Main loop is i = 1..n In the three times through the loop you set delta ’s three elements
in the first time through the loop you use delta 2 and delta 3 but they are not yet initialized as you have not gone second and third time through the loop yet

Ivan_Pat13-AquamarineAuthor
13-Aquamarine
January 26, 2025

@terryhendicott 

Thank you, Terry, here it works

Ivan_Pat_0-1737887863468.png

And here also (as I got from your tip)

Ivan_Pat_1-1737887958357.png

 

 

21-Topaz II
January 26, 2025

Main loop is i = 1..n In the three times through the loop you set delta ’s three elements
in the first time through the loop you use delta 2 and delta 3 but they are not yet initialised as you have not gone second and third time through the loop yet

 

Capture.JPG