## 20 Reputation

1 years, 355 days

## @Carl Love Thank you - this is a ve...

@Carl Love Thank you - this is a very nice solution!

## @Carl Love thanks for the clear exp...

@Carl Love thanks for the clear explanation

## @Kitonum That's what I wanted t...

@Kitonum That's what I wanted to know. Thank you very much!

## LinearAlgebra...

After rewriting all problems were solved.

## LinearAlgebra...

Thanks for the response. I am going to rewrite the code according to 'LinearAlgebra'.

## matrix row by row...

@acer

I'm sorry to hear you sigh. With your recommendations
`zip(assign,L,R[nr,..]);`
combined with
`L:=Vector[row]([''RA'',''MA'', etc.`
I was able to simplify the code. And I am grateful for that. But unfortunately I did not managed to rid of 'linalg' due to lack of knowledge. But I really want to get better with it.

For your information. I build this code to check an Excel spreadsheet. For this I need all intermediate formulas and not just the end result. To build a matrix row by row (number of rows are variable) seemed the most suitable for me.

## Solved 'recursive assignment' with conv...

I solved the 'recursive assignment' with a single addition:
`R: = convert (R, Matrix);`
See enclosed code pauldaas_05.mw

## Procedure within another procedure...

@acer, thank you again for your response/ hints. I understand that more information about the purpose of the code is needed. The formulas used for RA, MA etc. were a random, I am sorry for the confusion. Attached pauldaas_03.mw shows an extract of the new code but with real formulas.

In short: The aim is to write an algebraic method for superimposing loads (forces) on a beam according to Roark's Formulas Table 8.1. In the case of superposition resulting from n loads, there is a broken polynomial that falls into n+1 parts [0,a[1]], [a[1],a[2]], [a[2],a[3]], .., [a [n]].

Before I can show a bit more, I would like to get another hint for calling a procedure within another procedure.

In the second attachment pauldaas_04.mw, I call the 'aFdeflection' procedure within the aF0011 procedure. That would make things easier. But it gives an error 'recursive assignment'. It should give the same results as the first. Thank you in advance.

## Convert matrix...

Dear acer. The code below does what it is meant to do: First build the restrain matrix R and then use this matrix R to build the coefficients matrix C.

Unfortunately still using 'linalg'. And for some reason the matrix R and C needs to be converted to show its contents which I don't understand. Advice would be very welcome. I would like this piece of code to be solid and good before I continue to build with it. Thank you in advance.

```restart: with(linalg):```

```aF0011:=proc(nr,a,l,F,EI) local B,RA,MA,thetaA,yA; global R,C; R:=extend(R,1,0,0); B[RA]:=1*F*a*l/EI; B[MA]:=2*F*a*l/EI; B[tA]:=3*F*a*l/EI; B[yA]:=4*F*a*l/EI; B:=Matrix( [seq(B[i],i in [RA,MA,tA,yA])]); copyinto(B,R,nr,1); end proc:```

```aM0011:=proc(nr,a,l,M,EI) local B,RA,MA,thetaA,yA; global R; R:=extend(R,1,0,0); B[RA]:=1*M*a*l/EI; B[MA]:=2*M*a*l/EI; B[tA]:=3*M*a*l/EI; B[yA]:=4*M*a*l/EI; B:=Matrix( [seq(B[i],i in [RA,MA,tA,yA])]); copyinto(B,R,nr,1); end proc:```

```aFshear:=proc(nr,R,L) local c; global C; C:=extend(C,1,0,0); zip(assign,L,R[nr,..]);            NULL: c[1]:=RA/RA; c[2]:=MA/RA; c[3]:=tA/RA; c[4]:=yA/RA; c[5]:=RA/RA/EI; c[6]:=MA/RA/EI; c[7]:=tA/RA/EI; c[8]:=yA/RA/EI; c:=Matrix([seq(c[i],i in [1,2,3,4,5,6,7,8])]); copyinto(c,C,nr,1); end proc:```

`R:=Matrix(0,4,0);`

```R:=aF0011(1,a__1,l,F__1,EI): R:=aM0011(2,a__2,l,M__2,EI);```

`whattype(R);`

`R:=convert(R,Matrix);`

`C:=Matrix(0,8,0);`

`L:=Vector[row]([''RA'',''MA'',''tA'',''yA'']):`

```for nr from 1 to rowdim(R) do C:=aFshear(nr,R,L) end do:```

```C; whattype(C); C:=convert(C,Matrix);```

## This is the solution that I was looking ...

 Page 1 of 1
﻿