🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Sizing design variable

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

 

Hey guys!

 

I have a problem with composite optimization. I would like to ask you to help me modify a script.
I have made a composite skateboard tutorial and after size optimization there were many plies. These plies have initial values like 0.41535 mm, and upper bound value something similar, but bigger. The manufacturable thickness was 0.5 mm, so I had to alter the upper bound value equal to multiple of the manufacturable thickness.

I found a script on the script exchange, which is attached, that can change the upper bound, initial value and lower bound of the design variables for the multiples of the manufacturable plies.

I think it would be useful if this script would be able to modify the upper bound value of the design variables in the following way:

 

If the initial value (IV) is less than or equal to the manufacturable thickness (TMANUF) then the upper bound value of the design variables (UBV) has to be equal to the manufacturable thickness (TMANUF).
If TMANUF IV <= 2 x TMANUF then UBV = 2 x TMANUF

Generally: If  n x TMANUFIV <= (n+1) x TMANUF then UBV = (n+1) x TMANUF; where n = 0, 1, 2, 3 ...

Could someone modify this script with this changes?

Thank you for your help in advance!

 

Best regards,

Tüki 

 

Unable to find an attachment - read this blog

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Pandurang"
    Altair Community Member
    Updated by Pandurang

    Hi lmre,

     

    Try This:


    *createmarkpanel designvars 1 'Select DESVARs.'
    set DesvarIDList [ hm_getmark designvars 1 ]
    *clearmark designvars 1
    #puts $DesvarIDList

    #set ScaleFactor [hm_getfloat 'Enter scaling factor value. Default = 1 if 0.' 'Entering scaling factor value']
    set PlyThiManu [hm_getfloat 'Enter the manufacturable ply thickness.' 'Entering manufacturable ply thickness']

    foreach DesvarID $DesvarIDList {

    set DesvarName [ hm_getentityvalue designvars $DesvarID 'name' 1 ]
    set DesvarIV [ hm_getentityvalue designvars $DesvarID 'initialvalue' 0 ]
    set DesvarLB [ hm_getentityvalue designvars $DesvarID 'lowerbound' 0 ]
    set DesvarUB [ hm_getentityvalue designvars $DesvarID 'upperbound' 0 ]

    puts 'Original UB value = $DesvarUB'
    ##################  MOdification #####################################

    # If the initial value (IV) is less than or equal to the manufacturable thickness (TMANUF) then the upper bound value of the design variables (UBV) has to be equal to the manufacturable thickness (TMANUF).
    if {$DesvarIV <= $PlyThiManu } {
        set DesvarUB $PlyThiManu
    }

    # If TMANUF < IV <= 2 x TMANUF then UBV = 2 x TMANUF
    if {$PlyThiManu < $DesvarIV & $DesvarIV <= [expr 2* $PlyThiManu]} {
        set DesvarUB [expr 2 * $PlyThiManu]

    ######################################################################
    ######################################################################

    # # Muliply it by one so it'll output in fix notation
    # set UBValueoutput [ expr { 1*$DesvarUB } ]

    # #set ScaledUBValue [ expr { $ScaleFactor*$DesvarUB } ]
    # set ScaledUBValue [ expr { $PlyThiManu*10 } ]
    # set ScaledDesvarIV [ expr { $PlyThiManu*2 } ]
    # set ScaledDesvarLB [ expr { $PlyThiManu*0 } ]

    # *sizedesvarupdatewithddvalfield '$DesvarName' $ScaledUBValue $ScaledDesvarIV $ScaledDesvarLB -1 0
    *sizedesvarupdatewithddvalfield '$DesvarName' $DesvarUB $DesvarIV $DesvarLB -1 0
    #*sizedesvarupdatewithddvalfield 'autoply' 0.025 0.0113599 0 -1 0

    puts 'UB Value updated = $DesvarUB'


    }

     

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi lmre,

     

    Try This:


    *createmarkpanel designvars 1 'Select DESVARs.'
    set DesvarIDList [ hm_getmark designvars 1 ]
    *clearmark designvars 1
    #puts $DesvarIDList

    #set ScaleFactor [hm_getfloat 'Enter scaling factor value. Default = 1 if 0.' 'Entering scaling factor value']
    set PlyThiManu [hm_getfloat 'Enter the manufacturable ply thickness.' 'Entering manufacturable ply thickness']

    foreach DesvarID $DesvarIDList {

    set DesvarName [ hm_getentityvalue designvars $DesvarID 'name' 1 ]
    set DesvarIV [ hm_getentityvalue designvars $DesvarID 'initialvalue' 0 ]
    set DesvarLB [ hm_getentityvalue designvars $DesvarID 'lowerbound' 0 ]
    set DesvarUB [ hm_getentityvalue designvars $DesvarID 'upperbound' 0 ]

    puts 'Original UB value = $DesvarUB'
    ##################  MOdification #####################################

    # If the initial value (IV) is less than or equal to the manufacturable thickness (TMANUF) then the upper bound value of the design variables (UBV) has to be equal to the manufacturable thickness (TMANUF).
    if {$DesvarIV <= $PlyThiManu } {
        set DesvarUB $PlyThiManu
    }

    # If TMANUF < IV <= 2 x TMANUF then UBV = 2 x TMANUF
    if {$PlyThiManu < $DesvarIV & $DesvarIV <= [expr 2* $PlyThiManu]} {
        set DesvarUB [expr 2 * $PlyThiManu]

    ######################################################################
    ######################################################################

    # # Muliply it by one so it'll output in fix notation
    # set UBValueoutput [ expr { 1*$DesvarUB } ]

    # #set ScaledUBValue [ expr { $ScaleFactor*$DesvarUB } ]
    # set ScaledUBValue [ expr { $PlyThiManu*10 } ]
    # set ScaledDesvarIV [ expr { $PlyThiManu*2 } ]
    # set ScaledDesvarLB [ expr { $PlyThiManu*0 } ]

    # *sizedesvarupdatewithddvalfield '$DesvarName' $ScaledUBValue $ScaledDesvarIV $ScaledDesvarLB -1 0
    *sizedesvarupdatewithddvalfield '$DesvarName' $DesvarUB $DesvarIV $DesvarLB -1 0
    #*sizedesvarupdatewithddvalfield 'autoply' 0.025 0.0113599 0 -1 0

    puts 'UB Value updated = $DesvarUB'


    }

     

    Thank you very much, it is working fine. :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />