Replacement rules for partial derivatives

I have a system of EDP, and it contains terms of the form $ A ^ {(n, m)} (x, t) $, which is a shortcut for $$ frac { partial ^ n} { partial x ^ n} frac { partial ^ m} { partial t ^ m} A (x, t), $$ (that is to say Derivative(n,m)(A)(x,t)) and want to replace the output of the form $$ A ^ {(n, m)} (x, t), $$ with $$ partial ^ n_t (-i partial_t ^ 2-2 partial_t) ^ mA (x, t). $$

I think I can take care of the $ partial ^ n_t $ part by defining a rule for the derivative, that is to say
ruleDerF = Derivative(n_, m_)(f)(x_, t_) -> D( f(x, t), {t, n}), then apply it to the output in question.

However, I do not know how to care about the expansion of the next operator. For example, I can define the operator $$ – i partial_t ^ 2-2 partial_t, $$ by, let's say L_1(x_,t_)=(-I*D(#,{t,2})-2*D(#,{t,1}) then apply L_1(x,t)(A(x,t)). I do not know how to apply this $ m $ time, nor how to configure these replacement rules for this operator.

All suggestions are appreciated.

functional programming – Represent partial functions / curries in post-fixed notation?

I'm working on a small JSON query language. A query consists of a JSON array of JSON elements, such as strings, numbers, Booleans, and so on. Strings starting with one '$' or '@' represent respectively the unary or binary postfix operators.

I want to include some functional aspects in my query language (for example, a map operator who takes a function and a table, and produces a new table). However, I find it hard to represent these "functions as arguments" in postfix notation! For example, let's say I want to add a fixed number to each element of an array. I would instinctively write something like this:

((0, 2, 4, 6, 8), 1, "@add", "@map")

However, this would be interpreted as "performing a add operation on 1 and (0, 2, 4, 6, 8)and then call mapThis would produce an error in my query! Instead, I want to interpret the query as "perform a map operation using add(1) sure (0, 2, 4, 6, 8)Is it possible to achieve this goal, given the use of postfix notation?

How to insert a partial view @ HTML.Partial in an iframe

I need to insert a partial view of mvc in an iframe but that does not open the view.
Can someone give me advice?

list manipulation – Mathematica function equivalent to the Matlab residual function (partial fraction expansion)

I am looking for a Mathematica function equivalent to the Matlab residue function.

If there is no Mathematica equivalent, I would like to write a function taking into account the coefficients of two polynomials $ a $ and $ b $ leave the residues $ r $, the poles $ p $ and the term $ k of the partial fraction expansion of $ frac {b} {a} $:

$ frac {b (x)} {a (x)} = frac {b_m x ^ m + b_ {m-1} x ^ {m-1} + points + b_1 x + b_0} {a_n x ^ n + a_ {n-1} x ^ {n-1} + points + a_1 x + a_0} = frac {r_n} {x-p_n} + points + frac {r_2} {x-p_2} + frac {r_1} {x-p_1} + k (x) $

Two input lists:

polynomial coefficients a = {an, $ points $, a2, a1}

polynomial coefficients b = {bm, $ points $, b2, b1}

Three output lists:

residues r = {rn, $ points $ , r2, r1}

poles p = {pn, $ points $ , p2, p1}

polynomial k = {$ points $}

I know how to create polynomials $ a (x) $ and $ b (x) $ from the lists of entries $ a $ and $ b $ and how to do partial fraction expansion. However, I have not been able to understand how to calculate r, p and k

Residues[a_,b_] : =
Module[{apoly, bpoly,f,x},
(* build polynomials *)
bpoly = FromDigits[b, x];
apoly = FromDigits[a, x];
(* expansion of the partial fraction *)
f = apart[Expand[bpoly]/Develop[apoly]];

r = ???
p = ???
k = ???

{r, p, k}

Google Foobar Challenges Python Partial Test Case Errors "Queue"

I started the foobar challenge a few days ago, and I am now at the first issue of the third step, and I have the challenge "Queue to do" . The problem is that I receive partial errors in the verification process. There are 10 test cases with 2 open cases and 8 hidden cases, and I had a problem with three hidden test cases.
This is the question:

Queue to do

You are almost ready to destroy the LAMBCHOP Domsday device, but the security checkpoints that protect the underlying systems of LAMBCHOP will be problematic. You managed to shoot one without triggering alarms, which is great! Except that as assistant commander Lambda, you learned that the checkpoints are about to be subject to automatic control, which means that your sabotage will be discovered and your cover stolen - unless you can fool the automatic control system.

To deceive the system, you will have to write a program that will return the same amount of security check that the guards would have after controlling all the workers. Fortunately, Commander Lambda's desire for efficiency does not allow waiting times of several hours. Guards at checkpoints have therefore found ways to speed up the rate of transmission. Instead of checking every incoming worker, the guards check all people online while noting their security ID, and then let the line fill up. Once done, they go back to the line, this time leaving the last worker. They continue as well, leaving an extra worker on the line each time but saving the security IDs of those they check, until they jump the entire line, then they record the IDs of all the workers that they wrote down in a checksum and then leave for lunch. Fortunately, the orderly nature of the workers forces them to always align in a numerical order without gaps.

For example, if the first operator of the line has ID 0 and the security checkpoint line contains three employees, the process will look like this:
0 1 2 /
3 4/5
6/7 8
where the checksum XOR (^) of the guards is 0 ^ 1 ^ 2 ^ 3 ^ 4 ^ 6 == 2.

Similarly, if the first operator is identified by ID 17 and the checkpoint contains four, the process would look like this:
17 18 19 20 /
21 22 23/24
25 26/27 28
29/30 31 32
which produces the checksum 17 ^ 18 ^ 19 ^ 20 ^ 21 ^ 22 ^ 23 ^ 25 ^ 26 ^ 29 == 14.

All worker IDs (including the first worker) are between 0 and 200,000,000 inclusive, and the checkpoint line will always have a minimum length of 1 worker.

With this information, write a feature solution (start, length) that will cover the missing security checkpoint by generating the same checksum that the guards would normally submit before lunch. You just have time to find the ID of the first operator to check (start) and the length of the line (length) before the automatic review. Your program must therefore generate the appropriate checksum with these two values ​​only.


To provide a Java solution, edit
To provide a Python solution, edit

Test case
Your code must pass the following tests.
Note that it can also be run on hidden test cases not shown here.

- Java case -
Solution.solution (0, 3)

Solution.solution (17, 4)

- Python cases -
solution.solution (0, 3)

solution.solution (17, 4)


I have tested my first code:

def solution (start, length):
checksum = 0
for j in the beach (length):
for i in the range (length-j):
checksum ^ = (start + j * length + i)
return the checksum

This code has returned three hidden test errors: Test # 5, # 6, # 9.


I have therefore tried to reconstruct the answer using a table.

def solution (start, length):
checksum = 0
strin = []
    for j in the beach (length):
for i in the range (length-j):
strin.append (start + j * length + i)
for i in strin:
checksum ^ = i
return the checksum

But now, this one throws me another failure of test case in test n ° 3, n ° 5, n ° 6, n ° 9

I would like to know why this difference in Test # 3 was made. And if possible, I would like to know what would be the cause of failures in other test cases (# 5, # 6, # 9).

partial order – Does each partially ordered relationship and its dual have the same number of topological ordinances?

Given the Hasse diagram of a partially ordered relationship, is it true that the POSET itself and its dual POSET have the same number of topological ordinances? I have tried some examples and, although that seems to be the case, I need a formal way to prove it. So help me with that.

adjustment – partial and partial partial correlation

Mathematica has a Partial correlation function, but it's for the chronological data. However, by following the Partial and Partial Partial Correlation information, you can use simple methods. Mathematica orders.

(* The data *)
SATV = {500, 550, 450, 400, 600, 650, 700, 550, 650, 550};
HSGPA = {3.0, 3.2, 2.8, 2.5, 3.2, 3.8, 3.9, 3.8, 3.5, 3.1};
FGPA = {2.8, 3.0, 2.8, 2.2, 3.3, 3.3, 3.5, 3.7, 3.4, 2.9};
data = Transpose[{SATV, HSGPA, FGPA}];

(* Find residues for both regressions on SATV *)
resid1 = LinearModelFit[data[[All, {1, 2}]], x, x]["FitResiduals"];
resid2 = LinearModelFit[data[[All, {1, 3}]], x, x]["FitResiduals"];

(* Partial correlation *)
Correlation[resid1, resid2]
(* 0.7475739092548284 *)

(* Semi-partial correlation *)
Correlation[FGPA, resid1]
(* 0.43378526772255077 *)

The results correspond exactly to the R example in the link above.

simplifying expressions – The sum of the root powers of the unit gives only a partial answer

Mathematica seems to be unable to handle more sums than roots of unity. For example, Simplify[Sum[Exp[2 Pi I a b/m], {a m}], {b, m} [Element] Stationery] returns 0 instead of working in pieces like:$$ begin {observations} 0 & gcd (b, m) = 1 \ m & text {else} end {comments} \ $$ Has anyone managed to get the right answer?

formulas – Partial cell formatting with CONCATENATE in Google Sheets

Is it possible to partially format using concatenate in Google Sheets?

For example, = CONCATENER ("*", Sheet1! A1, Sheet1! B1)and I want to do the * in bold or blue color or something else.

I realize that I could be either:

  1. Divide it into several cells and control the color (it does not work for the sheet I'm working on because everything is happening in the sheet.) To begin, I've merged two cells in order to properly adjust the text Unmerging The text would be clogged, changing the width of the column would disturb other entries in the same column.)
  2. Convert it manually to plain text and make the necessary formatting changes. But that's also manual.

magento2 – Upgrade from Magento 2.2.6 to 2.3.1 broke the partial refund feature of a credit memo

In the have, there is a field "Refund for adjustment" at the bottom. Before upgrading to version 2.3.1 If I entered a value in this field, there was a "Update Totals" button that would update the total. But after upgrading to version 2.3.1, this button does not appear. Attach screenshots for more details.

Broken credit score[![][1]]2