Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 18, 2021 20:39:38 GMT
I have this:
A = Distance from the left end to the point charge W = Uniformly linear charge P = Point load L = Beam span (length between supports) V = Shear force B = Distance from the right end to the point load M = Bending moment M+ = Maximum bending moment at the span I = Inertia
|
|
|
Post by tsh73 on Feb 18, 2021 20:46:50 GMT
is it like distributed force?
So graph below is bending moment(x)?
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 18, 2021 22:04:14 GMT
Yes Yes...I think so, I'm 90% sure. Let me ask to the enginner.
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 18, 2021 23:56:20 GMT
Indeed, the graph reflects the bending moment.
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 19, 2021 1:22:10 GMT
One question, when I do this C = M When C is a multidimensional array, does it replace all elements in the array or does it become another type of variable? It is that when converting the following line of code to python: K1=C(I,I+1)-M C=M K2 = 0-C(I+1,I)-M I get error, because with: C=M The C value is replaced with a float variable, so it cannot be used as an array, how is it that in BASIC it does not throw this error? By the way, I'm doing fine with the Python translation all the code runs fine until the present problem. Thank you very much to everyone, I know we are not finished yet but I can't stop thanking those who helped me.
|
|
|
Post by tsh73 on Feb 19, 2021 8:20:51 GMT
Yes, for BASIC names C and C() is entirely different. In Python you will end up with new name for ordinary variable to distinguish it from list.
|
|
|
Post by tsh73 on Feb 19, 2021 8:30:52 GMT
YES!!!!! I fixed it! It is line 220 of source code - see it fixed One small typoo...
FOR I=1 TO N C(I,I+1)=(W(I) * L(I) ^ 2 / 12 + P(I) * A(I) * B(I) ^ 2 / L(I) ^ 2) * -1 'C(I+1,1)= W(I) * L(I) ^ 2 / 12 + P(I) * B(I) * A(I) ^ 2 / L(I) ^ 2 C(I+1,I)= W(I) * L(I) ^ 2 / 12 + P(I) * B(I) * A(I) ^ 2 / L(I) ^ 2 NEXT I results
M1>0=0 M1>2=0 M2>1=5.5 M2>3=-5.5 M3>2=0 M3>4=0
::::: TRAMO 1 ::::: V1>D: 3.62 V2>I: -6.37 M+: 3.15 X>1: 0 X>2: 1.73 X>M+: 1.44
::::: TRAMO 2 ::::: V2>D: 6.37 V3>I: -3.62 M+: 3.15 X>2: 0.98 X>3: 0.3
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 19, 2021 11:59:52 GMT
I must say that you have done a great job, you simply have to see that when you really know something, there are no barriers, thank you very much, I think that now I have to finish converting to Python as a job. I will be reporting how it goes. It's funny, I came to this forum out of necessity but I admit that I'm really liking BASIC, especially this forum, people are very nice and receptive
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 19, 2021 12:15:01 GMT
Well, this is the output I get from Python hahaha, but hey, I guess that's where to start, at least it runs without errors, but there are a LOT of details to be fixed
M1>00 -3 M1>00 -3 M2>15 -3 M2>1-5 -3 :::::TRAMO 1 ::::: V1>D: 0.0 V2>I: -0.0 M+: 0.0 X>1: 0.0 X>2: 0.0 X>M+: 0.0 :::::TRAMO 2 ::::: V2>D: 0.0 V3>I: -0.0 M+: 0.0 X>2: 0.0 X>3: -0.0 X>M+: 0.0 [Finished in 1.5s]
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 19, 2021 13:27:39 GMT
I have discovered several things, the round in Python does not work the same as in BASIC, when I use it, it takes everything to 0, but I removed it in certain parts and now it shows me the values that I have in the round.
M1>0: 0.0 M1>2: 5.245208740234375e-06 M2>1: 5.5 M2>3: -5.50000262260437 M3>2: 0.0 M3>4: 0.0
:::::TRAMO 1 ::::: V1>D: 0.0 V2>I: -0.0 M+: 0.0 X>1: -0.0 X>2: 0.0 X>M+: 0.0
:::::TRAMO 2 ::::: V2>D: 0.0 V3>I: -0.0 M+: 0.0 X>2: 0.0 X>3: 0.0 X>M+: 0.0 [Finished in 0.5s] But now I have a problem and that is that M1>2 has a value that it should not have. I was scanning and that number is stored in position 1,2 of the array C, I really have no idea how it is getting there.
|
|
|
Post by tsh73 on Feb 19, 2021 13:42:19 GMT
Consider it to be "machine 0" Actually JB program has " 0.52452087e-5 " it is because if ROUND it is shown as 0. (and then I increased loop by P from 10 to 20, it went down to 0.50022209e-11 )
Using ROUND is pretty straightforward in Python, see:
round(10000/3,2) 3333.33
well, it's this particular calculator ROUND. It has digital positions negated (*-1), it IS weird looking now, but the thing (calculator) sure was very cool at the time.
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 19, 2021 15:15:11 GMT
Ok, I got really messed up, I'm very very bad at mathematical terms
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 19, 2021 15:37:52 GMT
I eliminated the rounding in the result outputs and this is almost ready! So I think I will eliminate them for now. I just have to solve the M1>2 issue
M1>0: 0.0 M1>2: 5.245208740234375e-06 M2>1: 5.5 M2>3: -5.50000262260437 M3>2: 0.0 M3>4: 0.0
::::: TRAMO 1 ::::: V1>D: 3.624998688697815 V2>I: -6.375001311302185 M+: 0.0 X>1: -1.2507569322472989e-06 X>2: 1.7346299757758223 X>M+: 0.0
::::: TRAMO 2 ::::: V2>D: 6.3750006556510925 V3>I: -3.6249993443489075 M+: 0.0 X>2: 0.9876765559126965 X>3: 0.30250028848654953 X>M+: 0.0 [Finished in 0.4s]
|
|
Jalkhov
Member in Training
██████████████████▓░ 99%
Posts: 41
|
Post by Jalkhov on Feb 19, 2021 15:57:37 GMT
READY READY READY READY
This is Python Output: M1>0: 0.0 M1>2: 0.0 M2>1: 5.5 M2>3: -5.5 M3>2: 0.0 M3>4: 0.0
:::::TRAMO 1 ::::: V1>D: 3.62 V2>I: -6.38 M+: 3.15 X>1: -0.0 X>2: 1.73 X>M+: 1.45
:::::TRAMO 2 ::::: V2>D: 6.38 V3>I: -3.62 M+: 3.15 X>2: 0.99 X>3: 0.3 X>M+: 2.55 [Finished in 0.4s] I just used the round in this way round(value, 2) The only thing I see is that in X>1 the 0 is negative, does it matter?
|
|
|
Post by tsh73 on Feb 19, 2021 16:01:00 GMT
again
it is not an issue - it supposed to work like that it is way to write really small numbers for computer 5.245208740234375e-06 stands for 5.245208740234375/10^6, that is, 0.0000052452(...) This program works by repeatedly (loop by P) executing same computation During that some elements of C() gradually going to 0 Since it is already 0.0000052452, round to two digits shows 0.00
So "X>1" being XXe-6, actually pretty close to 0 too.
Glad you make it! :)
|
|