AceFEM: Divergence in iterative procedure (Newton-Raphson) for fine meshes

I am trying to model a problem of a nearly incompressible $ 10~\rm{m} \times 2~\rm{m}$ beam with a uniformly distributed end load. The beam has a Young’s modulus of $ 200~\rm{Pa}$ and a Poisson’s ratio of $ \nu=0.49995$ and I am using a mixed displacement-pressure (Q1P0) formulation with a perturbed Lagrangian approach.

I am using meshes of $ 2^N \times 2^N$ Q1P0 elements and for $ N\leq6$ to solution procedure is working fine. However, for $ N>6$ the procedure diverges very early on. I have tried changing the initial load and the load step size in the solution procedure, and I have tried changing the material properties. Whatever I try I cannot get the solution procedure to work for $ N>6$ , which is a problem because I need solutions for at least up to $ N=8$ .
Note: The solution procedure works fine with standard Q2 elements for $ N=8$ and I can’t figure out why it doesn’t work for the Q1P0 elements.

The solution procedure I am using is given below (unfortunately I don’t know how to make the Greek characters display properly in the code block)

SMTAnalysis[]; tolNR = 10^-5;  maxNR = 500;  targetNR = 100; \[Lambda]Max = 1;  \[Lambda]0 = \[Lambda]Max/1000;  \[CapitalDelta]\[Lambda]Min = \[Lambda]Max/10000;  \[CapitalDelta]\[Lambda]Max = \ \[Lambda]Max/100;  SMTNextStep["\[Lambda]" -> \[Lambda]0]; While[   While[    step =      SMTConvergence[tolNR,       maxNR, {"Adaptive BC",        targetNR, \[CapitalDelta]\[Lambda]Min, \ \[CapitalDelta]\[Lambda]Max, \[Lambda]Max}]    , SMTNewtonIteration[];    ];   If[step[[4]] === "MinBound", SMTStatusReport["Analyze"];     SMTStepBack[];];   step[[3]]    , If[step[[1]], SMTStepBack[];];   SMTNextStep["\[CapitalDelta]\[Lambda]" -> step[[2]]]   ]; 

Plotting the displacement of the end of the beam against $ N$ yields the following

enter image description here

It is clear that the behavior is good up until $ N=6$ .

The element code and notebook in which problem is solved (including solution procedure) are available here:
Q1P0 element
Convergence Test

Any help in improving the solution procedure would be appreciated!

MySQL – Call a View inside a Stored Procedure

Let’s say, I have a table as follows

tbl_1

id             name                 status               usertype                         flag ================================================================================================ 1              Name 1                  1                    2                               0 2              Name 2                  1                    3                               0 3              Name 3                  1                    1                               0 4              Name 4                  1                    4                               0 5              Name 5                  1                    5                               0  

HTML PAGE

<select id="type" name="type">    <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option>  </select> 

My requirement is that I need to get all the data from table where the usertype is selected from the html page by the user (could be 1, 2, 3,4,5, etc.)

I want to create a view, and call that inside stored procedure

I cannot pass an argument inside of a View. So, I was told to create a stored procedure, and call the view inside it. The problem is, I don’t know how to do it.

How to get applied stored procedure for inserted row in mysql php query

$ query = "CREATE PROCEDURE IF NOT EXISTS Insertion(IN firstname varchar(40),IN lastname varchar(40),IN email varchar(40),IN department varchar(40),IN doj date,IN basicpay int(11)) BEGIN

DECLARE HRA decimal(20,2); DECLARE DA decimal(20,2); DECLARE PF decimal(20,2); DECLARE NET_SALARY decimal(20,2);

IF department = ‘HUMAN RESOURCE’ THEN SET HRA = (5/100)*basicpay; SET DA = (7/100)*basicpay; SET PF = (10/100)*basicpay;

ELSEIF department = ‘MARKETING’ THEN SET HRA = (5/100)*basicpay; SET DA = (7/100)*basicpay; SET PF = (10/100)*basicpay;

ELSEIF department = ‘PRODUCTION’ THEN SET HRA = (5/100)*basicpay; SET DA = (7/100)*basicpay; SET PF = (10/100)*basicpay;

ELSEIF department = ‘FINANCE AND ACCOUNTING’ THEN SET HRA = (5/100)*basicpay; SET DA = (7/100)*basicpay; SET PF = (10/100)*basicpay;

ELSE SET HRA = (5/100)*basicpay; SET DA = (7/100)*basicpay; SET PF = (10/100)*basicpay;

END IF; SET NET_SALARY = basicpay+HRA + DA + PF;

insert into employees(FIRST_NAME,LAST_NAME,EMAIL,DEPARTMENT,DATE_OF_JOINING,BASIC_PAY,HRA,DA,PF,NET_SALARY) values(firstname,lastname,email,department,doj,basicpay,HRA,DA,PF,NET_SALARY);

END";

SQL DB corruption recovery procedure

I’ve like to have this discussion on db corruption topic. We run weekly dbcc checkdb and most time, this sql job went through without errors. However, if it does, that usually means big headache for any dbas.

The recommended way is to check if it can be fixed without data loss or restore from last good copy.

My question is about the procedure to restore from last good copy.

Our backup strategy is weekly full back on sunday, diff backup daily and tlog backup hourly.

Say if weekly integrity check indicated errors,

How to determine the last good backup once last good backup is determined, say corruption on wed, should I use last week full backup + diff backup on tuesday + all tlogs after tuesday’s diff backup till current time to restore db? question should I use replace option ?

Pause and resume execution of stored procedure

There are two processes(p1, p2) that may run simultaneously. p2 is a scheduled execution of SPROC while p1 consists of a group of stored procedures that is triggered on the request. Execution of p1 while p2 is in progress can create issues. Only one should run at a time. There are three ways to solve this problem

  1. When p1 starts check whether p2 is in progress and wait until it completes. p2 can run for more than a day and it might not be a preferable solution
  2. Kill p2, complete p1 and then restart p2. Killing and restarting p2 isn’t safe due to nature of the sproc
  3. pause p2 and resume p2 when p1 completes

Questions

1. How can I search and stop store procedure being executed?

2. Is there any way I can pause and resume a stored procedure that is being executed?

Strange behaviour on stored procedure

I have the following mysql stored procedure:

DELIMITER // CREATE PROCEDURE INSERT_INTO_WORKDAY(IN deviceName VARCHAR(16), IN cardUID VARCHAR(14))  BEGIN     SET @projectId = (SELECT MIN(ID) FROM PROJECT WHERE DEVICEID = (SELECT MIN(ID) FROM DEVICE WHERE NAME = deviceName) ORDER BY ID DESC LIMIT 1);     SET @workerId = (SELECT MIN(ID) FROM WORKER WHERE CARDNUMBER = cardUID);     SELECT @workerId;          SET @id = (SELECT MIN(ID) FROM WORKDAY WHERE WORKERID = @workerId AND PROJECTID = @projectId AND STOPTIME IS NULL AND STARTTIME IS NOT NULL);     IF (@id >= 0)         THEN             UPDATE WORKDAY SET STOPTIME = now() WHERE ID = @id;     ELSE         INSERT INTO WORKDAY (WORKERID, PROJECTID, STARTTIME) VALUES (@workerId, @projectId, now());     END IF; END; // DELIMITER ; 

When I call the procedure once, I get the result:

mysql> CALL INSERT_INTO_WORKDAY("Pepper_C1-1A6318", "045D91B22C5E80"); +-----------+ | @workerId | +-----------+ |         1 | +-----------+ 1 row in set (0.01 sec)  Query OK, 1 row affected (0.09 sec) 

From second run, is not working anymore:

mysql> CALL INSERT_INTO_WORKDAY("Pepper_C1-1A6318", "045D91B22C5E80"); +-----------+ | @workerId | +-----------+ |      NULL | +-----------+ 1 row in set (0.00 sec)  ERROR 1048 (23000): Column 'WORKERID' cannot be null 

I did try to isolate and run the procedure with only this two lines of code:

    SET @workerId = (SELECT MIN(ID) FROM WORKER WHERE CARDNUMBER = cardUID);     SELECT @workerId; 

And it behaves just like above, but if I try to run SELECT MIN(ID) FROM WORKER WHERE CARDNUMBER = "045D91B22C5E80"; alone, works without problems. The @projectId variable behaves normal everytime I call the stored procedure.

Can someone help me to find a solution? Thank you!

My setup:

mihai:~$   mysql -V mysql  Ver 8.0.22-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu)) 
mysql> describe WORKER; +------------+-------------+------+-----+---------+----------------+ | Field      | Type        | Null | Key | Default | Extra          | +------------+-------------+------+-----+---------+----------------+ | ID         | int         | NO   | PRI | NULL    | auto_increment | | FIRSTNAME  | varchar(15) | NO   |     | NULL    |                | | LASTNAME   | varchar(20) | NO   |     | NULL    |                | | CARDNUMBER | varchar(14) | NO   |     | NULL    |                | | POSITIONID | int         | NO   | MUL | NULL    |                | +------------+-------------+------+-----+---------+----------------+ 5 rows in set (0.01 sec) 

Procedure to truncate the desired table after a specific time does not work properly,”SYSDATE” and the “SYSTEM CLOCK” show different hours!

I wrote a procedure as you can see below:

create or replace procedure truncate_test is         hour_part char(40);     begin    <*** Other Parts***>                         select to_char(sysdate, 'HH24') into hour_part from dual; -- Check the time here      if (hour_part >= 16) then     execute immediate 'truncate table cust_modern_channel_branch';   end if;     <*** Other Parts***>  end; 

This procedure is a part of an ETL which runs everyday.The aim of this part of the procedure is to check the time and if it’s after 4:00 PM in the afternoon, it truncates the table (ETL might reach the truncate part at different hours). I’m using this query to extract the hour part of sysdate select to_char(sysdate, 'HH24'). The problem is that this query select sysdate from dual returns this 3:28:43 PM (I’ve omitted the date part) so the above query returns 15, but the system clock (bottom right corner) shows 4:08 PM !!So I’m expecting that the procedure truncates my table when I execute it cause it’s 4:08 PM but sysdate is showing a different time and nothing happens! why is this happening? Why the sysdate and system clock shows different hours?

Thanks in advance

Java stored procedure or user-defined function could not call Java method

After I created a Java external stored procedure in DB2 as in my previous question, the call

call user1.send_mail(    P_TO          => 'me@domain.com'   ,P_CC          => NULL   ,P_BCC         => NULL   ,P_FROM        => 'me@domain.com'   ,P_SUBJECT     => 'db2 java subject'   ,P_TEXT_MSG    => 'db2 java test'   ,P_HTML_MSG    => null   ,P_ATTACH_NAME => null   ,P_ATTACH_MIME => null   ,P_ATTACH_BLOB => null   ,P_SMTP_HOST   => 'domain.com'   ,P_SMTP_PORT   => 465   ,P_USER_NAME   => 'me@domain.com'   ,P_PASSWORD    => 'secret'); 

fails it due to the following error:

Java stored procedure or user-defined function "USER1.SEND_MAIL", specific name "SQL201208113215436" could not call Java method "send_mail", signature "(Ljava/lang/String".. SQLCODE=-4306, SQLSTATE=42724, DRIVER=3.68.61

I made sure that all parameters that have no default values receive non-NULL values. What else is necessary for this to work?

No authorized routine named “SQLJ.INSTALL_JAR” of type “PROCEDURE” having compatible arguments was found

My goal is to deploy a Java routine to a DB2 server. After reading Deploying Java routine class files to DB2 database servers on p.267-268 of IBM DB2 10.5 for Linux, UNIX, and Windows Developing User-defined Routines (SQL and External) I issued the following call in IBM Data Studio:

call sqlj.install_jar('file:/C:/Projects/javadb2.jar', 'javadb2'); 

where C:/Projects/javadb2.jar is the path on the DB2 server machine to the JAR to be deployed to its local filesystem. It throws the following error:

No authorized routine named "SQLJ.INSTALL_JAR" of type "PROCEDURE" having compatible arguments was found.. SQLCODE=-440, SQLSTATE=42884, DRIVER=4.18.60

I tried under the regular user and under db2admin to no avail. The only question that I found for this error on SE was where they added a 3d parameter, so this is not my case. Anyhow, with or without the 3d parameter of 0, it still fails with the same error message.

Rewrite existing procedure without merge as Oracle 12.1 doesn’t support it

I have a procedure where data is pushed into table using merge logic used as part of it. The procedure takes string passed at runtime and splits it into rows.

I need to change the merge part using any other method other than merge, maybe cursor for loop as Oracle 12.1 does not support merge and similar take input string and insert/update accordingly in the destination table. inside procedure and we cannot get it upgraded due to constraints.

So everything in proc would be same just that it would be without merge.

The details are inside the fiddle with table and sample data.

https://dbfiddle.uk/?rdbms=oracle_11.2&fiddle=34a88972aa53cf60b1199f9f277285f4