```python
import numpy as np
from sympy import symbols, solve
import matplotlib.pyplot as plt
from astropy.table import Table
plt.style.use('seaborn-darkgrid')
```


```python
Pillar_Load = lambda C,H,W,Wc : C*H*(W+Wc)/W
PillarSt_Mark = lambda wh : 6.205*(0.64+(0.54*wh))
PillarSt_CSIRO = lambda wh : 6*(0.64+0.36*(0.69+0.44*wh)*wh)

```


```python
def Pillar_Strength(wh, formula =[], name =[]):
    S=[]
    i=0
    while (i<len(formula)):
        s= formula[i](wh)
        S.append(s)
        print ("Pillar Strength for", name[i],":",s)
        i=i+1
    return S;

def FoS(P,wh,formula=[],name=[]):
    S = Pillar_Strength(wh, formula, name)
    FoS=[]
    i=0
    while (i<len(formula)):
        f = S[i]/P
        FoS.append(f)
        print ("FoS for", name[i],":",f)
        i=i+1
    return FoS,S,name;

def wh(P,FoS,formula=[],name=[]):
    S= P*FoS
    w =symbols('w')
    wh=[]
    i=0
    while (i<len(formula)):
        sn=solve (formula[i](w)-S,w)
        def largest(a,n):
            max=a[0]
            for i in range(1,n):
                if a[i]>max:
                    max = a[i]
            return max;
        n=len(sn)
        sol = largest(sn,n)
        wh.append(sol)
        print ("w/h ratio for", name[i],":",sol)
        i=i+1
    return FoS,S,name;
```


```python

def FoS_Range(P,FoS_max, FoS_min, interval,formula,name):
    n = (FoS_max-FoS_min)/interval
    a =FoS_min
    F=[FoS_min]
    i=0
    while(i<n):
        a= a+interval
        F.append(a)
        i=i+1
    S=[]
    i=0
    while(i<n+1):
        b=P*F[i]
        S.append(b)
        i=i+1
    wh =[]
    w =symbols('w')
    i=0
    while(i<(n+1)):
        sni=solve (formula[0](w)-S[i],w)
        def largest(a,ni):
            max=a[0]
            for y in range(0,ni):
                if a[y]>max:
                    max = a[y]
            return max;
        ni=len(sni)
        sol = largest(sni,ni)
        wh.append(sol)
        i=i+1
    wh=np.asarray(wh)
    F=np.asarray(F)
    wh.astype(int)
    F.astype(int)
    plt.style.use('seaborn-darkgrid')
    #plt.figure(figsize=())
    plt.plot(F,wh,'r^')
    plt.xlabel("FoS")
    plt.ylabel(name)
    t = Table([F,wh],names=('FoS',name))
    print(t)
    return t,F,wh;

```


```python
def FoS_wh_Range(P,FoS_max, FoS_min, interval,wh_max,wh_min,formula,name):
    n = (FoS_max-FoS_min)/interval
    a =FoS_min
    F=[FoS_min]
    i=0
    while(i<n):
        a= a+interval
        F.append(a)
        i=i+1
    S=[]
    i=0
    while(i<n+1):
        b=P*F[i]
        S.append(b)
        i=i+1
    wh =[]
    w =symbols('w')
    i=0
    while(i<(n+1)):
        sni=solve (formula[0](w)-S[i],w)
        def largest(a,ni):
            max=a[0]
            for y in range(0,ni):
                if a[y]>max:
                    max = a[y]
            return max;
        ni=len(sni)
        sol = largest(sni,ni)
        wh.append(sol)
        i=i+1
    wh=np.asarray(wh)
    F=np.asarray(F)
    wh.astype(int)
    F.astype(int)
    w=np.delete(wh,np.argwhere(wh>=wh_max))
    F1=np.delete(F,np.argwhere(wh>=wh_max))
    w=np.delete(w,np.argwhere(wh<=wh_min))
    F=np.delete(F1,np.argwhere(wh<=wh_min))
    plt.style.use('seaborn-darkgrid')
    #plt.figure(figsize=())
    plt.plot(F,w,'r^')
    plt.xlabel("FoS")
    plt.ylabel(name)
    t = Table([F,w],names=('FoS',name))
    print(t)
    return t,F,w;
```


```python
Pillar_Strength(wh=2,formula=[PillarSt_Mark,PillarSt_CSIRO], name =["USA","AUS"])
```

    Pillar Strength for USA : 10.672600000000001
    Pillar Strength for AUS : 10.622399999999999





    [10.672600000000001, 10.622399999999999]




```python
FoS(P=9,wh=2,formula=[PillarSt_Mark,PillarSt_CSIRO], name =["USA","AUS"])
```

    Pillar Strength for USA : 10.672600000000001
    Pillar Strength for AUS : 10.622399999999999
    FoS for USA : 1.1858444444444445
    FoS for AUS : 1.1802666666666666





    ([1.1858444444444445, 1.1802666666666666],
     [10.672600000000001, 10.622399999999999],
     ['USA', 'AUS'])




```python
wh(P=9,FoS=1.2,formula=[PillarSt_Mark,PillarSt_CSIRO], name =["USA","AUS"])
```

    w/h ratio for USA : 2.03802190587042
    w/h ratio for AUS : 2.03336022215367





    (1.2, 10.799999999999999, ['USA', 'AUS'])




```python
FoS_Range(P=9,FoS_max=3,FoS_min= 0.5, interval= 0.1,formula=[PillarSt_Mark],name= "USA w/h ratio")
```


```python
a,b,c=FoS_wh_Range(P=9,FoS_max=3, FoS_min=0.5, interval=0.1,wh_max=6,wh_min=0.5,formula=[PillarSt_Mark],name= "USA w/h ratio")
```


```python
d,e,f=FoS_wh_Range(P=9,FoS_max=3, FoS_min=0.5, interval=0.1,wh_max=3,wh_min=0.5,formula=[PillarSt_CSIRO],name= "AUS w/h ratio")
```


```python
plt.plot(b,c,'r^',label='$Mark$')
plt.plot(e,f,'b^',label='$CSIRO$')
plt.xlabel('FoS')
plt.ylabel('w/h Ratio')
plt.legend()
plt.show()
```

e9938d3fc0ad84fa0c1fba24f9dc984faf6b9a23
ipynb
Jupyter Notebook
web-pillar-design.ipynb
RitwickGhosh/PillarPy
615fe59a044762801e239328d55c7f32e5c4d8ac
MIT
web-pillar-design.ipynb
RitwickGhosh/PillarPy
615fe59a044762801e239328d55c7f32e5c4d8ac
MIT
web-pillar-design.ipynb
RitwickGhosh/PillarPy
615fe59a044762801e239328d55c7f32e5c4d8ac
MIT
Qwen/Qwen-72B
1. YES
2. YES