maximum – If you use MaxValue to define a function, drawing is slow

I'm trying to compute c functions (from the theory of optimal transport), so I'll have to compute "supremums" for some functions $ f $ and costs $ c $
$$ g (y) = sup_ {x in mathbb {R}} c (x, y) -f (x) $$

My code works, but plotting is super slow.

c[x_,y_]: = - Log[Abs [x-y]+1]f[x_]: = Piecewise[{{E^(-x^2)x>0}{e^((-x^2)/5)x[{{E^(-x^2)x>0}{e^((-x^2)/5)x[{{E^(-x^2)x>0}{E^((-x^2)/5)x[{{E^(-x^2)x>0}{E^((-x^2)/5)x<=0}}]
h[x_,y_]:=c[x,y]-f[x]
g[y_]:=MaxValue[h[x,y],x]
Plot[f[x],{x,-1,1},PlotLabel->"F"]plot[g[y], {y, -1,1}, PlotLabel -> "f ^ c"]

How can I speed up plotting? I'm new to this area πŸ™‚

Vector analysis – Define the path integral if the scalar $ f $ and the curve $ mathbf {c} $ are in * curvilinear * coordinates

I'm currently doing a multivariable calculus course. I have seen path integrals in the Cartesian coordinate system as the following definition:

Definition.
The path integral of $ f (x, y, z) $ along the curve $ C $ is

$$ int_C f ds = int_a ^ bf ( mathbf {x} (u)) || mathbf {x} & # 39; (u) || you $$

from where $ mathbf {x}:[a,b] to mathbb R ^ 3 $ is the parametric representation of $ C $, The definition did not refer to the coordinate system.

Question.
Suppose that $ (x, y, z) = mathbf Phi ( xi_1, xi_2, xi_3) $ where the
transformation $ mathbf Phi: U to V $ is sufficiently differentiable and has one
inverse $ mathbf { Phi ^ {- 1}}: V to U $ from where $ U, V $ are open subsets of $ mathbb R ^ 3 $,

What would be the definition of a path all over $ C $ when $ f $ is a function of curvilinear
Coordinates ($ xi_1, xi_2, xi_3 $) and the curve has been parameterized
curvilinear coordinates as $ mathbf { xi} = mathbf { xi} (u) $ to the $ a le
> u le b $
?

Is the definition consistent with a regular "Cartesian" path? If so, can you derive from the above definition for Cartesian how you would obtain a path integral for a function in curvilinear coordinates?

rest api – Can I define multiple callback methods depending on the call method?

He is my current custom API:

add_action ('rest_api_init', function () {
register_rest_route (& # 39; my-project / v1 / form ?, & # 39; / get & # 39 ;, array ()
& # 39; Methods & # 39; => WP_REST_Server :: READABLE,
& # 39; call back & # 39; => & # 39; get_form & # 39;
));
});


add_action ('rest_api_init', function () {
register_rest_route (& # 39; my-project / v1 / form & # 39 ;, & # 39; / post & 39 ;, array ()
& # 39; Methods & # 39; => & # 39; POST & # 39 ;,
& # 39; call back & # 39; => & # 39; post_form & # 39;
));
});

Here I would like to write something, but I'm not sure if it's possible.
I am sure that this syntax i

add_action ('rest_api_init', function () {
register_rest_route (& # 39; my-project / v1 / & # 39 ;, & # 39; / form & # 39 ;,
Array (
& # 39; Methods & # 39; => & # 39; GET & # 39 ;,
& # 39; call back & # 39; => & # 39; GET_form & # 39 ;,
), Array (
& # 39; Methods & # 39; => & # 39; POST & # 39 ;,
& # 39; call back & # 39; => & # 39; post_form & # 39 ;,
));
});

Tagging – How does XMP define the facial area?

The XMP files created by Lightroom seem to follow the MWG description (currently shut down website) as it contains this link to describe its content:

xmlns: mwg-rs = "http://www.metadataworkinggroup.com/schemas/regions/"

I took a random XMP file of one of my pictures with a recognized person: the part mwg-rs: region is structured as follows:


    
    
     
      
       
       
       
      
     
    

As you can see, for this image, the area is indicated by an "area" structure that contains 4 values ​​that appear to be in percent relative to the entire image:

  • stArea: x and stArea: y are the coordinates of the upper left corner of the area relative to the upper left corner of the image
  • stArea: h and stArea: w are height and width

To answer your question, (0,0) is the upper left corner and (1,1) is the lower right corner,

As a side note, I do not know how to use the "rotation" parameter of the mwg-rs description part: In my place, I would do some tests πŸ™‚

Physics – How do I define another metric in xAct?

I'm using the "xAct" package and want to define two metrics with the relationship

$ bar {g} _ { mu nu} = A ( phi) g _ { mu nu} + B ( phi) nabla_ mu phi nabla_ mu phi $

from where $ g _ { mu nu} $ is the first metric and $ bar {g} _ { mu nu} $ is the second metric,$ phi $ is a scalar filed and $ nabla_ mu $ is the covariant derivative.

I appreciate that someone can help me!

Automata – Define A, B for two arbitrary languages ​​A A β—‡ B: = {xy | x ∈ A, y ∈ B, | x | = | y |}. Show that if A, B are regular, A β—‡ B is context-free

Basically, I wonder if the concatenation of two equal strings is context-free. I have seen several proofs of it online with PDAs, but we do not treat them in my course for automata, and my professor says they are not needed for the proof. Any help would be appreciated!

This is the full question:

Define A, B over Ξ£ for any two languages
A: B: = {xy | x ∈ A, y ∈ B, | x | = | y |}.
Show that if A, B are regular, A β—‡ B is context-free

Use a pattern to define an Ansible host variable for the host

Given the following:

everything:
...
Children:
node[01-05]:

How do I apply? Ansible host with (not surprisingly) different values ​​for each of node ?

How do I do that if Ansible host Value follows a similar pattern? Would that be valid?

        node[01-05]:
ansible-host: servers.node[01-05].example.com

What if the values ​​for Ansible host would be completely different?

This question seems to replace something from a variable file, but I am not sure if this can be applied to my hosts file and solve my problem.