Reputation: 33
restart;
l:
A:=242.5:
E:=55000:
alpha:=2.3*10^(-5):
G:=6.57:
upsilon[0]:=25:
H[0]:=5000:
upsilon[x]:
equ := H[x]^2*(H[x]-H[0]+E*A*G^2*l^2/(24*H[0]^2)+E*A*alpha*(upsilon[x]-upsilon[0])) = (1/24)*G^2*l^2*E*A;
for l from 20 by 5 to 60 do
for upsilon[x] from -30 by 10 to 80 do solve(equ)
end do;
end do;
This is a simple calculation for wire tension that has to be made for l(wire span in 'm') from 20 meters to 60 meters and for each span for all temperatures upsilon[x] from -30 degrees Celsius to 80 degrees, increment 10 degrees.
If I remove the inner loop everything works (given that I set a value for upsilon[x]). I would be very glad if you could also tell me how to put the results in a table such as the attached one.
Upvotes: 3
Views: 363
Reputation: 7246
You can programmatically embed such a Table in the Maple 2016.2 Standard GUI, as follows below.
(I mean the Graphical User Interface, and not just a tty terminal and the Command Line Interface, and not the old Classic GUI.)
restart;
l:
A:=242.5:
E:=55000:
alpha:=2.3*10^(-5):
G:=6.57:
upsilon[0]:=25:
H[0]:=5000:
upsilon[x]:
equ := H[x]^2*(H[x]-H[0]+E*A*G^2*l^2/(24*H[0]^2)
+E*A*alpha*(upsilon[x]-upsilon[0])) = (1/24)*G^2*l^2*E*A:
Mres:=Matrix(12,9):
for l from 20 by 5 to 60 do
for upsilon[x] from -30 by 10 to 80 do
Mres[trunc(upsilon[x]/10+4),l/5-3]:=[fsolve(equ,H[x])][1];
end do;
end do;
Mall:=<Vector[column](13,[`Temp °C\\Span m`,
seq(-30.0+(i-1)*10,i=1..12)]) |
<Vector[row](9,[seq(evalf[3](20.0+(j-1)*5),j=1..9)]),
evalf[5](Mres)>>:
The above creates a Matrix, Mall
. One choice is for you simply to print that Matrix.
interface(rtablesize=50):
Mall;
Another choice is to programatically embed a GUI Table, that renders Mall
in its cells.
oldts:=interface(typesetting):
interface(typesetting=extended):
DocumentTools:-Tabulate(Mall, weights=[20,seq(11,j=1..9)],
widthmode=pixels, width=700):
interface(typesetting=oldts):
That last clump of commands should go in its own paragraph (Document Block) if you're in a Document, or in its own Execution-Group if you're in a Worksheet.
If you are already working with the setting interface(typesetting=extended)
, which means "extended" 2D Math typesetting level, then you can ignore all those interface
calls. The only reason they are there is so that the "degree" symbol in "Temp deg C" gets rendered without extra quotes.
If you really, really want the top row of the table to be a single cell which spans the whole Table horizontally then the Table would have to be made more manually using the DocumentTools:-Layout:-Table command. Let me know... although I'll be absent for some days.
Upvotes: 1