How to use two UEL in same problem in ABAQUS - abaqus

I am solving a contact problem. A footing under compressive load placed over soil. I would like to use two different types of user-defined elements one for the soil and other for the footing. Please note: I would like to use two different UEL. Not UMAT. How to call two UEL in the same problem? I found on the internet that in order to call two different material models (UMAT1 and UMAT2), string names are compared in an IF statement and the corresponding UMAT routine is referred inside one main Fortran file. How to achieve this for UEL?

There is parameter JTYPE passed into UEL routine. JTYPE is equal to user element type (TYPE=U1001 <=> JTYPE=1001) i.e
*USER ELEMENT,NODES=2,TYPE=U1001,PROPERTIES=4,COORDINATES=3,VARIABLES=6
1,2,3
*USER ELEMENT,NODES=2,TYPE=U1002,PROPERTIES=4,COORDINATES=3,VARIABLES=6
1,2,3
*ELEMENT,TYPE=U1001, ELSET=U1
11, 2, 11, 112, 115
12, 3, 14, 98, 114
*ELEMENT,TYPE=U1002, ELSET=U2
13, 6, 15
14, 7, 18
Then depending on JTYPE value (as a switch) you can code for many types of user elements in the same UEL routine (sample information written into ABAQUS.msg file UNIT 7).
INCREMENT 1 STARTS. ATTEMPT NUMBER 1, TIME INCREMENT 0.100
* ---- Process User Element START JTYPE 1001
**** BZ USER SUBR inc = 1 1
**** BZ USER SUBR XII 100000.000000000
**** BZ USER SUBR DU 0.000000000000000E+000
* ---- Process User Element START JTYPE 1001
**** BZ USER SUBR inc = 1 1
**** BZ USER SUBR XII 100000.000000000
**** BZ USER SUBR DU 0.000000000000000E+000
* ---- Process User Element START JTYPE 1002
**** BZ USER SUBR inc = 1 1
**** BZ USER SUBR XII 100000.000000000
**** BZ USER SUBR DU 0.000000000000000E+000
* ---- Process User Element START JTYPE 1002
**** BZ USER SUBR inc = 1 1
**** BZ USER SUBR XII 100000.000000000
**** BZ USER SUBR DU 0.000000000000000E+000

Related

How to average of last days data in influxdb

I want to calculate the average of unit_price from entries of the last known day from my influxdb database.
Below shows you the last two days data I have (14 entries per day)
I have 5 different days data in total.
> select * from "variable" order by time desc limit 28
name: variable
time area_code area_name unit_price
---- --------- --------- ----------
2021-05-11T23:00:00Z P Northern_Scotland 18.4695
2021-05-11T23:00:00Z N Southern_Scotland 17.598
2021-05-11T23:00:00Z M Yorkshire 16.968
2021-05-11T23:00:00Z L South_Western_England 18.6795
2021-05-11T23:00:00Z K Southern_Wales 18.081
2021-05-11T23:00:00Z J South_Eastern_England 18.501
2021-05-11T23:00:00Z H Southern_England 17.5875
2021-05-11T23:00:00Z G North_Western_England 17.4615
2021-05-11T23:00:00Z F North_Eastern_England 17.262
2021-05-11T23:00:00Z E West_Midlands 17.6085
2021-05-11T23:00:00Z D Merseyside_and_Northern_Wales 19.4355
2021-05-11T23:00:00Z C London 17.4405
2021-05-11T23:00:00Z B East_Midlands 17.3565
2021-05-11T23:00:00Z A Eastern_England 17.871
2020-11-01T00:00:00Z P Northern_Scotland 17.073
2020-11-01T00:00:00Z N Southern_Scotland 16.2225
2020-11-01T00:00:00Z M Yorkshire 15.6135
2020-11-01T00:00:00Z L South_Western_England 17.094
2020-11-01T00:00:00Z K Southern_Wales 16.527
2020-11-01T00:00:00Z J South_Eastern_England 16.8945
2020-11-01T00:00:00Z H Southern_England 16.128
2020-11-01T00:00:00Z G North_Western_England 16.0125
2020-11-01T00:00:00Z F North_Eastern_England 15.7395
2020-11-01T00:00:00Z E West_Midlands 16.086
2020-11-01T00:00:00Z D Merseyside_and_Northern_Wales 17.8605
2020-11-01T00:00:00Z C London 15.897
2020-11-01T00:00:00Z B East_Midlands 15.8445
2020-11-01T00:00:00Z A Eastern_England 16.2855
As you can see here, limit 14 average shows the same result as not using limit at all.
So this mean command is averaging 'all' the data, not any limited data.
select mean(unit_price) from "variable" order by time desc limit 14
name: variable
time mean
---- ----
1970-01-01T00:00:00Z 16.2924375
> select mean(unit_price) from "variable"
name: variable
time mean
---- ----
1970-01-01T00:00:00Z 16.2924375
>
I have tried nested selects, but can’t seem to find how to get an average of the final 14 entries (or from the final date with data)
Any help would be very much appreciated.
Think I may have solved with after playing some more with nested queries.
> select mean(unit_price) from "variable" group by time(1d) fill(none)
name: variable
time mean
---- ----
2019-04-12T00:00:00Z 15.572249999999997
2020-01-15T00:00:00Z 15.340499999999997
2020-11-01T00:00:00Z 16.377
2021-05-11T00:00:00Z 17.880000000000003
> select last("mean") from (select mean(unit_price) from "variable" group by time(1d) fill(none))
name: variable
time last
---- ----
2021-05-11T00:00:00Z 17.880000000000003
>

Progressive ID number based on the same value

I have in a Google spreadsheet in Col B some values that I would assign a progressive number in Col A.
In particular I would that this progressive number must be assigned to the unique value in Col B.
Desidered Output:
1 | dog
1 | cat
2 | dog
2 | cat
1 | mouse
2 | mouse
3 | dog
3 | cat
...
Assuming the data starts in row 2, see if this works
Arrayformula(if(len(B2:B), countifs(B2:B, B2:B, row(B2:B), "<="&row(B2:B)),))

Parsing Time from text using SAS

I have a maximum of 200 characters length of text for thousands of records which has date and time in it. I am trying to parse out the time
Here is the example of the text that I have
Your account your account your account on Jan 10, 2020 at 8.30 AM ET your account
Your account your account your account on Jan 3, 2020 6.30PM ET your account
Your account your account your account on Jan 11, 2020 at 6.30PM ET your account
Desired output
8.30 AM
6.30PM
6.30PM
In all the content ET is common and I am using index and substr function to parse out the time.
Time=substr(Text,index(Text,' on ')+19,6);
For the second line, I am also getting extra characters since there is no at and no space between time and PM
Is there any efficient way to parse the time?
Thanks
SAS can locate a text excerpt using a Perl regular expression that has a capture buffer.
data want(keep=parsed_timestring);
length parsed_timestring $8;
input;
/* Pattern:
* On a word boundary \b
* Capture start (
* 1 or 2 digits \d{1,2}
* A period \.
* 1 or 2 digits \d{1,2}
* 0 or 1 spaces \s?
* letter A or P (A|P)
* letter M M
* Capture end )
*/
prx = prxparse('/\b(\d{1,2}\.\d{1,2}\s?(A|P)M)/x');
if prxmatch (prx, _infile_) then
parsed_timestring = prxposn(prx,1,_infile_);
datalines;
Your account your account your account on Jan 10, 2020 at 8.30 AM ET your account
Your account your account your account on Jan 3, 2020 6.30PM ET your account
Your account your account your account on Jan 11, 2020 at 6.30PM ET your account
Your account your account your account on Jan 11, 2020 at 6666.30PM ET your account
;
proc print;
run;
In the last row parsed_timestring is blank because 6666.30PM starts with more than two digits on a word boundary and thus would not match the pattern and thus the line would not have a proper time string.

Select every hour query

I have a simple weather station DB with example content:
time humi1 humi2 light pressure station-id temp1 temp2
---- ----- ----- ----- -------- ---------- ----- -----
1530635257289147315 66 66 1834 1006 bee1 18.6 18.6
1530635317385229860 66 66 1832 1006 bee1 18.6 18.6
1530635377466534866 66 66 1829 1006 bee1 18.6 18.6
Station writes data every minute. I want to get SELECT not with all series, but just series written every hour (or every 60th series, simply said). How can I achieve it?
I tried to experiment with ...WHERE time % 60 = 0, but it didn`t work. It seems, that time column doesnt permit any math operations (/, %, etc).
Group by along with a one of the functions can do what you want:
SELECT FIRST("humi1"), FIRST("humi2"), ... GROUP BY time(1h)
I would imagine for most climate data you'd want the MEAN or MEDIAN rather than a single data point every hour
basic example, and more complex example

changing the value of bin in a record of aerospike db which is of map type in lua script

say aerospike database is having recorded data like below
let the namespace be employee
name age characteristics
sachin 25 MAP('{"weight":70, "height":25}')
now i want to change the value of height which is inside map for all the records in employee namespace through lua script.
i have tried for changing the bins of normal data type as below , i,e i
tried to change the age as below:
function changeAgeOfEmployee(rec)
if not aerospike:exists(rec) then
error ("Invalid Record. Returning")
return
else
age = 30
rec['age'] = age
aerospike:update(rec)
end
end
but i am not sure how to change the value in map in lua, can somebody please assist me in this
Your MAP data-type is basically a lua table. MAP in lua can be written as:
local m = map {"weight" => 70, "height" => 25}
To loop over all the key/value pairs you should use the pairs iterator like this:
for key, value in map.pairs(m) do
m[key] = 30 --this changes all the values of your MAP to 30
end
If you're going to modify a key of a map, or an index of a list, you should cast that bin to a local variable, then set it back to the record ahead of updating it.
function changes(rec)
rec['i'] = 99
local m = rec['m']
m['a'] = 66
rec['m'] = m
aerospike:update(rec)
end
In AQL
$ aql
Aerospike Query Client
Version 3.15.1.2
C Client Version 4.3.0
Copyright 2012-2017 Aerospike. All rights reserved.
aql> register module './test.lua'
OK, 1 module added.
aql> select * from test.demo where PK='88'
+----+-------+--------------------------------------+------------------------------------------+
| i | s | m | l |
+----+-------+--------------------------------------+------------------------------------------+
| 88 | "xyz" | MAP('{"a":2, "b":4, "c":8, "d":16}') | LIST('[2, 4, 8, 16, 32, NIL, 128, 256]') |
+----+-------+--------------------------------------+------------------------------------------+
1 row in set (0.002 secs)
aql> execute test.changes() on test.demo where PK='88'
+---------+
| changes |
+---------+
| |
+---------+
1 row in set (0.001 secs)
aql> select * from test.demo where PK='88'
+----+-------+---------------------------------------+------------------------------------------+
| i | s | m | l |
+----+-------+---------------------------------------+------------------------------------------+
| 99 | "xyz" | MAP('{"a":66, "b":4, "c":8, "d":16}') | LIST('[2, 4, 8, 16, 32, NIL, 128, 256]') |
+----+-------+---------------------------------------+------------------------------------------+
1 row in set (0.000 secs)

Resources