OPTUM G2 via Matlab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi Christian grandma from Liverpool from time to time I get questions regarding parameter studies and I'm going to go through a couple of different ways of doing that in optimally - so what I mean by parameter studies is you have a problem for example a slope like this one here and you want to calculate the factor of safety but you want to do that not only for one friction angle but for a range of friction angles and what you could do is of course you can then clone the stage and then you can use another material with another friction angle and then run the stages like that record the results and eventually plot up say the factor of safety versus the friction angle so that's one way of doing it a smarter way of doing it is so the slope I'm going to be looking at is this one it has a cohesion of 15 kPa and a friction angle of 25 degrees a unit weight of 20 kilonewton per cubic meter and the smart way of doing a parameter analysis where we would vary this friction angle from say something like whatever 10 degrees to 45 degrees and it's actually already described in the materials manual let me just bring it up here it is under spatial variation of parameters page 25 so this section of the manual describes how to use not only constant values of the parameters but also how to operate with say a linearly varying strength with depth profiles so you would have something like this so it's bilinear in this case map where you can input a whole map of parameters so a two-dimensional map of parameters and then there is something called multiple datasets as well in page 27 of the materials manual and it's all described here actually how to work with not just one set of material data but multiple sets and the way it works is as follows so we have this pot you it's a little bit backward but you know we need to use actually a profile a profile defined by two points say the top and bottom here so minus 5 and 10 and and then with the corresponding value being the same a top and bottom meaning that we won't we will have a profile with a constant value of the parameter in question for example the friction angle and we have the possibility here to enter one profile in so I could say 10 at the top and I say let's say 25 degrees and minus 5 and 25 degrees and then you will see this change the profile and I could do this run and well that's a factor of safety very close to 1 with this very coarse mesh of a hundred lower bound element so it would definitely be more than one if you use more elements or another tivity and so on if you check out the friction angle that's just a constant 25 to 25 top and bottom now what we can do is we can actually also load an input file load a file with data and so you want to go to import and then you want to link to a data file and this data file you would want to create so I'm just gonna go through the steps of how to do that you first save the problem in a given folder just to know so you know where you I I had this one here that I'm working under and I'm going to call that slope okay so I then go to that folder this one I don't need and I create a Microsoft Excel worksheet I can call that Phi open that up and then I can create a profile here so it was ten at the top minus five meters at the bottom and then we can start entering our profile so we can start with ten ten so if we just load this file we import just this file well we'll have the same as before just with a constant friction angle of 10 degrees but I can enter multiple columns here so 15 and I think this is the way it works in Excel can extend this to let's make it 45 and the same down here so then what happens is that not just one run will be processed but each of these columns will be processed in sequence so first the run the first one is going to be with with ten degrees then 15 20 and so on up to 45 save that file and then import it P for parameter profile import link to data file and then you have various options with respect to it being single column data multiple column data or you can also have a custom range of data but we're going to just going to select multiple column data here and then select the file and proceed and here is the link then and you will see the field up here changes to profile again so if I then run this this is just a detail I just wanted to be sort of open about you're gonna get an error and there's going to be a message that the that this excel file can't be it's being used by another process so it can't be accessed this is a Microsoft deficiency more than anything else so what you have to do is actually close down this this worksheet you can close down Excel completely and then it will run so we then have multiple runs we are determining factors of safety our best strength reduction factor is what is the result is recorded us and this is a factor that of course increases as we go through the runs because we start from 10 degrees than 15 20 and so on up to 45 degrees and that of course leads to an increase in the factor of safety we go into XY plots once you're done and then plot the results s of this graph here if the x-axis is the run number basically which to which friction angle is attached and on the y axis we have the factors of safety select the curve here and goes with data and then you can basically copy paste this data into Excel or some other program and then plot it up as you wish so that's the easy way to handle multiple material parameter datasets what is a little less easy is supposed that we had a constant friction angle again of 25 degrees and we wanted to vary the slope inclination angle so say from 90 degrees to whatever something down here again we could create a sequence of stages and then manually change in this case it wouldn't be too onerous but if more involved changes were required this might be kind of a bit annoying to do so there is another way around that and that is to use the possibility of running up to the option calculation engine through the command prompt so if I type C and D here and then I type up some G - CMD the usage becomes apparent so you can call the up some calculation engine in this way up 22 CMD then the name of an input file and then an output file that's optional it's also optional to have a log file created and this echo can be there or cannot be there just basically as a question of whether you want the progress dialog from the that you see in the using the user interface if you want the results there printed on the screen as the prolate calculations progress so this is one way of doing it and it's also described in one of the manuals the command line version so there are some examples here the commands of course are described and explained and some examples are provided and what you can do if you want to basically process if you want to do this type of analysis with for a range of slope inclination angles well what you could do is you could generate a bunch of input files and then you could run process these through a batch file write and record the results and then pick those up and manipulate them display them as as you like so that's basically the same option that I'm gonna be using here today but in a sort of a slightly more automated manner through MATLAB where I have set up a couple of functions that are useful for this purpose of basically conducting these types of parameter studies or in general generating input files and then running them through MATLAB picking up the results and displaying them manipulating them within MATLAB so the idea is basically create have an input file and then have a basic input file and then on the on the basis of that base file generate input files that are then sent to opportunity to process the results our output to another file and then those results are picked up so the way it's going to work is that I need to create a base file and that's pretty much this file I have here I'm just going to rename it to slope so I want to just maintain the original file in a slope base g2x let me just copy that and then if I go to MATLAB and I'm already in that folder then I can open that input file up and the input file for those of you who have looked at it you know it's in XML format so it is readable but it is quite a large file with lots of data even for a very small problem like this it contains basically all the standard materials and everything you see on the screen is included in the input files so even for a small problem it's it's a relatively large file and what we want to do basically is change this this X x-coordinate down here right so we want to maintain a Y that's I should say this is 0 comma 0 and so y equal to 10 that means this height is 10 meters and so we want to be able to basically change the x coordinate here to have a given slope inclination angle so if I can find this entry for this coordinate for this point here the coordinates for this point in the input file well then I can change it manually can save the file and then I can I can run it now I can't find this manually what I usually do to help me find it manually is to give it some sort of unique ID in terms of a unique number so say nine point nine nine nine because I don't think the likelihood of that number being found anywhere else in the file is very high and then I can take the file I can search for this and here it is so that's node seven and I instead of changing I could change it manually I could change it to something like say three I save this and if I then go into Optim and open up again well you'll see it's changed instead what I'm gonna do now I'm gonna set things up to have this change be done in an automated manner so I'm going to define a variable and I'm gonna enclose I'm just going to call it X I'm gonna enclose it in dollar signs that's totally optional that's my own personal preference I know there's no other dollar signs in the input file so whatever I enclose in dollar signs is going to be a unique string so I could then take this base file I could then search for this set up a matlab script to search for this string and replace it with another number save the file under a new name probably and then run the file I could either open manually as I've just shown or I can run it through the optin G to C and D and it's the latter option that I'm looking to exploit here in this little exercise so I've set up a script and it I'll share a link to that script a little MATLAB script where I am I should also say of course now that I've modified this slope base file right and so I have this quantity here which to to optimize is nonsense then it's not going to be able to read it you're just going to get an error opening the input file just open the that's why I wanted to keep just the very original phantom we can just have a look at that as well but it's the base file here that I have modified so the idea is with this script is have this base input file and then define what I call a run file and I the name of that is going to be the same as the input file except this base is going to be changed to run so basically define a run the name of another file then there's a run command that's eventually the command I want to be you be using in MATLAB to invoke the the DOS prompt and invoke up to g2 by the DOS prompt so up 22 CMD run file the name of this run file and then I'm creating a log file as well called log file dot M and then echo I set that to an so we get results displayed on the screen so the idea is take this base file search for this variable dollar X dollar replace it with a relevant number create a new file save the result as a new file and then send that new file to Upton g2 CMD to be processed so I have a list of variables in this case it's a very short list it's only just one variable and that's this dollar X dollar and the reason I use this struct it's called in MATLAB curly brackets instead of regular brackets is that I might have a list of variables in this case I only have one but I might have a list of variables I could have x and x2 and these variables could be a variable length so then the normal standard arrays won't really cut it I have to use something else and this struct is appropriate for the purpose you've been doing it in many other ways but this this thing works and I have made quite good use of it now I call the there's inclination angle this angle here to the horizontal I call it beta and I want that to vary from 10 degrees up to 90 degrees with an interval of 10 degrees so I define this array called beta and then I want to translate this angle into the coordinate up here and since this is 0 comma 0 then the x-coordinate up here is related to the inclination angle in this way here so X is equal to 10 which is the height divided by 10 beta remember the 10 D we're working in degrees here so then I have a array of x coordinates generated and then I basically loop over the entire array could be beta here it could be X and I have a MATLAB function that I'll share as well which works in the it's called replace STR replace string and it works in the following way it takes some string called own string and searches for that in the file called own file then once it's found it replaces this own string by new string and saves the resulting file under the name specified here as new file so in this case the old string is this variable here Dola X dollar the new string is the the entry in the array that we have generated of x coordinates the old file is the is the say the base I called is the input file that may be a bit misleading the the base file and the new file is what I call the run file so that's the file we actually run and then I use this replace train to basically generate the new file and then dust that's a MATLAB command run command that is the command I want to be running as explained before as part of this run a log file is going to be generated and what is a log file well that is a file that just contains contains the log and the log is is this thing here so I'm gonna have a file for each run that has this type of information at the end of the file that's going to be this string best strength reduction factor and then a number so what I want to be doing is after the run has completed I want to read this log file I want to search further for this strength best strength reduction factor and then I want to read off this number and that is what this function here another function that I'll share they hurt us exactly it searches for a string in a given file and then reads the number following that strength this number is recorded as rest and these numbers entered into an array called FS factor of safety so that is how it works and let's see if we can if we can run this so it's called the script is called g2m on the score test and so we start with a factor of safety a to pop off around 2 and then it decreases remember we started from the slope inclination angle of 20 degrees and then we increase it up to 90° so at some stage yes in some states we fall below 1 this is entirely expected and the output here on the screen you've been either keep that that's what the echo command us or you can you can get rid of it simply by deleting the echo command so we are we are done now and the results are recorded here in this array FS and we can access that immediately and we can also we have the beta ray so here we have the inclination angle and the corresponding factor of safety we're gonna cost plot these b2 comma SS and put some labels on we want so it looks like this the inclination angle and the factor of safety for this very cause measure don't forget you would really want to use more element use that activity and so on and so forth probably upper and lower bound lap or lower bound the usual drill to eventually get something that is is very close to the exact solution and this is this is then how it looks and we can not open the the bass file obviously anymore because that contains still this variable dollar X dollar but we can open the runt file and that has now terminated at a or that has now reached the latest run file has has come to ninety degrees you can of course save these run files under a different name corresponding to the to the properties for example in this case corresponding to the slope inclination angle so so that's how that works as I said I will share this script and I'll also share this this function replace string replace STR and the other one was rest read and there's some some functions I wrote a long time ago I'm not really sure about the about the details of them but but they they do the job and they're quite useful for this purpose so I hope you found that useful so for now that's it till next time see you bye
Info
Channel: Optum Computational Engineering
Views: 1,254
Rating: 5 out of 5
Keywords: Geotechnical software, Finite element, Analysis software, Engineering software
Id: Eiu5bPuu7p0
Channel Id: undefined
Length: 24min 36sec (1476 seconds)
Published: Mon Jan 15 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.