output – Simultaneous Equations and Subbing Values Into the Results

Ok, I’m at a standstill. I’ve been working on this for longer than I want to admit. I have the question condensed to its essence, I think.

I want this to be for illustrative purposes for students, so I want it to be general in use.

Essentially, I want to take two equations (I made these up for the Notebook). I want to be able to solve (or Eliminate) a variable of choice. Doesn’t matter which one.

I want to print the output in symbolic form, which I can do apparently. then I want to take that output and sub values in for any, or all the variables and print that result.

One of the hardest things I’ve found in MMA is taking an output and using it and not having all kinds of issues with variable, number errors and other things that seem erroneous (to me).

I’ve tried using Out, % and probably other things I don’t even remember at the moment. I have read through Stack postings, and pages of obtuse MMA documentation, but if I find something that seems to work, it doesn’t work for very long, where an error shows up, or the Notebook doesn’t give results anymore….like this one.

This Notebook worked well, at first….that was yesterday. Today it doesn’t, and this twitchy behavior is frustrating. It’s probably something I’m not understanding, but it’s hard to understand something if you don’t understand it, if that makes sense.

Here, I’m trying to output the variables of the previous two results from ‘Eliminate’. I then want to take values for these variables and then print those results. I’m getting Null results where before I wasn’t, and I’ve no idea why, or what’s changed, and I’m out of ideas.

Insights please?

Thank you

enter image description here

eqn = Eliminate({a x + c y == a X + c Y, 
2 a x^2 + 2 n y^2 == 4 a X^2 + 3 n Y^2}, X);
Solve(eqn, Y)

list = {Out(11)};
list2 = {Out(12)};
Variables(Apply(List, list, 1))
Variables(Apply(List, list2, 1))

graphs – Error type chart with simultaneous errors

1. What is an error type chart?

Our monitoring system measures the parameters of telecommunications services at regular intervals, and based on the measured parameter values, automatically decides if there were service errors. For every monitored service, there is a chart on our dashboard, which displays in percents the ratio of error-detecting measurements to all measurements. Different service error types are displayed with different colors.

2. EASY CASE: Mutually exclusive error types

In most cases, one measurement can detect at most one service error type, so I could use stacked bar charts. This way the user can examine not just the percentage of different error types, but also the total percentage of errors, which is shown by the total height of the stack. Example chart with 6 possible error types:

enter image description here

The users like this solution.

3. MY PROBLEM: Simultaneous error types

In rare cases one measurement can detect more than one service error type, even all of them.

a] I cannot use stacked bar charts because the height of the stack would be misleading. For example, if there are 100 measurements, and 5 of them detects errors, but all of them detect the same 3 error types, then the top of the stack would be at 15%, while the total error ratio is 5%.

b] I also cannot use use unstacked bar charts, because at the smallest supported display resolution there are only 10-15 pixels for every time interval, so there would be only 1-2 pixels per bar if I put them next to each other.

c] Both problems could be solved by unstacked line charts. Here is an example with 7 error types:

enter image description here

Unfortunately the users don’t like it, because “it’s very hard to see the total error percentage”. Although there is another chart which displays the total error percentage, they would still prefer being able to see its value on the error type chart. I could add yet another, possibly thicker chart line, which shows the total error ratio but in some cases there are 16 different error types and I’m not sure that adding a 17th line with a special meaning wouldn’t make the chart too complex.

4. MY QUESTION: How could I display on the same chart not just the different error type ratios, but also the total error ratio in a meaningful way?

virtualization – VirtualBox: Simultaneous Windows and Linux guests on Windows 10 host

I am running VirtualBox on Windows 10.

I have disabled Hyper-V from previously using Hyper-V, where I didn’t have much success running a Linux guest (and also struggled with the networking).

My Linux guests run fine, both using KVM paravirtualization.

I noticed, when starting the install of my Windows 10 guest, that the default paravirtualization option chosen by VirtualBox is Hyper-V (which is apparently the default for Windows guests).

So, my first question: Why does VirtualBox choose this when Hyper-V is not installed/enabled?

I am currently busy installing Windows 10 after having restarted and forced KVM as the paravirtualization interface, but notice that the installation is running quite slowly, though it seemed to be running as slowly when Default/Hyper-V was selected.

Is there a way to successfully run Windows and Linux guests on VirtualBox on a Windows host at decent speeds?

nt.number theory – Simultaneous reductions of elliptic curves: same number of points $|E(Bbb F_p)| = |E'(Bbb F_p)|$ for some prime $p$?


Let $E,E’$ be two elliptic curves over $Q$. Is there at least one prime number $p geq 5$ of good reduction for $E,E’$ such that $|E(F_p)| = |E'(F_p)|$ ?

If $E,E’$ are isogenous over $Q$, this is clearly true. In any case, Fran├žois Charles proved that there are infinitely many primes $p$ such that the reductions of $E,E’$ mod $p$ are isogenous over $overline{F_p}$. If the result holds over $F_p$, we are done.

For instance, for the curves $y^2 = x^{3} – 3 x – 3, y^2 = x^{3} + x + 6$, the smallest such prime is $p = 3121$.

One could ask if the above question can be generalized to arbitrary smooth projective irreducible curves $C,C’$ (not necessarily of the same genus!) over $Q$, or even over a number field $K$ (though the heuristic only works well if the primes $mathfrak{p}$ are totally split over $Q$, or at least have degree $f leq 2$).

Using ideas from there, one can show that if $E,E’$ are not isogenous over $overline{Q}$, then the set of such primes has density $0$. According to Lang–Trotter heuristics, one should expect the number of such primes $p<X$ to be $sim c sqrt{x} / log(x)$ for some $c geq 0$ (if $c neq 0$, this should give infinitely many such primes).

Note: in his talk, he mentions that he doesn’t know what happens for three elliptic curves, nor what happens over $F_p$ instead of $overline{F_p}$.
For four (or more) elliptic curves, one should not expect infinitely many primes such that $|E_i(F_p)|$ are all equal when $1 leq i leq 4$.

nt.number theory – Simultaneous embeddings of ring of integers into product of rings

This question is about something mentioned in Katz’s “$p$-adic $L$-functions for CM fields” in section 2.0.

Let $K$ be a number field with $(K:mathbb{Q}) = d$ and ring of integers $mathcal{O}_K$. Let $Sigma$ be the set of embeddings $sigma colon K to overline{mathbb{Q}}$, and $K^{gal}$ the compositum of the fields $sigma(K)$ over all $sigma in Sigma$, the Galois closure of $K$. Then let $mathcal{O}^{gal}$ be the ring of integers in $K^{gal}$, and $R$ an algebra over $mathcal{O}^{gal}$. For each $sigma in Sigma$, we have a ring homomorphism $sigma colon mathcal{O}_K otimes R to R$ given on pure tensors by $n otimes r mapsto sigma(n)r$. We can take them all together to produce

$$ mathcal{O}_K otimes R to prod_{sigma in Sigma} R, qquad n otimes r mapsto (sigma(n)r)_sigma. $$

Katz then states that this is an isomorphism if the discriminant of $K$ is invertible in $R$.

I’m trying to figure out what the image of this map is when the discriminant is not invertible. If $R$ is flat over $mathbb{Z}$, it should be injective, just because each $sigma$ is injective. I thought I had found an obstruction to surjectivity using the homomorphism of Abelian groups
$$ prod_sigma R to R, qquad T((r_sigma)_sigma) = sum_sigma r_sigma $$
where the composition $mathcal{O}_K otimes R to prod_sigma R to R$ is $n otimes r mapsto operatorname{Tr}_{mathcal{O}_K/mathbb{Z}}(n)r$. The image is then the subgroup of $R$ generated by traces of elements of $mathcal{O}_K$. However, the subgroup of $mathbb{Z}$ generated by traces of elements of $mathcal{O}_K$ is not the different ideal as I had assumed (e.g. $Tr(1) = d$ is there regardless of whether any primes dividing $d$ ramify), and so it doesn’t have as tight a connection to ramification in $K$ as I hoped.

Is there a nice description of the image of this map in general or in certain cases? I am most interested in the case when $R$ is the ring of integers in a finite extension of $mathbb{Q}_p$.

Trouble in solving simultaneous equations with subscripts

My goal is to solve equation with subscripts. But the result shows {{}}.
Strange enough, If I don’t use subscripts, result shows.
Is there a limitation in using subscripts?
How to fix code below?

This code doesn’t work. How to fix to use subscript?

 Solve(Subscript(y, 1) == Subscript(x, 1) + Subscript(x, 2) && 
  Subscript(y, 2) == Subscript(x, 1)/(
   Subscript(x, 1) + Subscript(x, 2)), {Subscript(x, 1), Subscript(x, 

This code works with no subscript.

Solve(y1 == x1 + x2 && y2 == x1/(x1 + x2), {x1, x2})

differential equations – Solving simultaneous ODEs with NDSolve causes unexpected singularity error (ndsz)

I’m trying to model the evaporation of a binary droplet in a square well by solving a couple of PDEs for its height profile and composition. I can manage it for a single liquid pretty well, but when I introduce the PDE for composition NDSolve quickly finds a singularity in the composition variable (importantly the singularity moves slightly if I change the number of points). I can’t seem to find any way to stabilise the system, can anyone help me? Is there something fundamental about NDSolve that I’m missing?

(I asked a similar question a while ago but I’ve restructured my code to make it easier to share here)

The equations are:

frac{partial h}{partial t} = – C frac{partial}{partial x}Big(frac{1}{3} frac{partial^3h}{partial x^3}h^3 + frac{B1}{2} frac{partial X}{partial x}Big) – (1-AX)

frac{partial X}{partial t} = -frac{C}{3} h^2 frac{partial^3h}{partial x^3}frac{partial X}{partial x} – frac{hB1}{2} Big(frac{partial X}{partial x}Big)^2 + frac{A}{h}X(1-X)

with height $h$ and composition $X$.

And the boundary conditions are

$h(t)=1$ and $X(t)=X(t=0)$ at $x=1$, $frac{partial h}{partial x}=frac{partial X}{partial x}=0$ at $x=0$, and $frac{partial^3h}{partial x^3}=0$ at $x=0$ and $x=1$.

I discretise all this using finite differences.

This is what I get for a single liquid droplet (when I suppress equation 2) and I expect something qualitatively similar for a binary droplet.
Droplet curves when the composition equation is suppressed

Here is a minimum replicable example:

    N1 = 100; dx = 1/N1; (*Discretise*)
    C1  = 1; (*parameter C*)
    a = 1.5; b = 1 - a; hInitial = Table(a + b i^2 dx^2, {i, 0, N1}); (*Initial height profile*)
    E1 = 1;(*evaporation on/off switch*)
    Cc = C1/(24 * dx^3);
    A1 = 0.01; B1 = 1;  (*Control constants in the equations above*)
    CcX = (C1 B1)/(2 dx^2); CcX2 = C1/(6 dx^2);
    X0 = 0.4; XInitial = Table(X0, {i, 0, N1}); (*Initial composition ratio*)
    Sc = 1; (*Composition on/off switch*)
    TGap = 0.085;(*for spacing curves in the plot*)

     dv(v_List) :=
      With({h = Take(v, Length(v)/2 - 1), hN = v(((Length(v)/2))), 
        X1 = v((Length(v)/2 + 1 ;; Length(v) - 1)), XN = v((-1))},
         dh1 = 
          ListCorrelate({0, 0, 1 , 1, 0}, #) &, (*derivatives are discretised as finite differences. 
          ListCorrelate achieves this.*)

         dh2 = ListCorrelate({0, 1, 1, 0, 0}, #) &,
         dh3 = ListCorrelate({0, -1, 3, -3, 1}, #) &,
         dh4 = ListCorrelate({-1, 3, -3, 1, 0}, #) &,
         hi = ListCorrelate({0, 0, 1, 0, 0}, #) &,
         dh5 = ListCorrelate({-2, 1, 0, -1, 2}, #) &,
         dx1 = ListCorrelate({0, -1, 1}, #) &,
         dx2 = ListCorrelate({-1, 1, 0}, #) &,
         Xi = ListCorrelate({0, 1, 0}, #) &
            -Cc*(dh1(#1)^3*dh3(#1) - dh2(#1)^3*dh4(#1)) -  
            CcX*(dh1(#1)^2*dx1(#2) - dh2(#1)^2*dx2(#2)) - 
            E1*(1 - A1 Xi(#2)), (*ODE for heights*)

            0,(*height is pinned at edge, (1, 1)*)

            Sc*(-CcX2* hi(#1)^2*dh5(#1)*dx2(#2) - 
            CcX/C1* hi(#1)*dx2(#2)^2 + 
            A1 *(hi(#1))^-1*Xi(#2)*(1 - Xi(#2))), (*ODE for composition*)
            0 (*composition ratio is fixed at edge, XN = 0.4*)
            } &(
         Flatten@Join({h((3))}, {h((2))}, {h}, {1}, {3 - 3 h((-1)) + h((-2))}), 
         Flatten@Join({X1((2))}, {X1}, {XN})))

              (*this contains the boundary conditions*)


    v0 = Join(hInitial, XInitial); (*Initial conditions*)
    system2d = 
     NDSolve({v'(t) == dv(v(t)), v(0) ==  v0,

            Take(values((tt)), Length(values((tt)))/2), 
             {tt, 1,  Length(values)}) < 0, 
         "StopIntegration")(*WhenEvent to stop integration at touchdown*)}, 

       v, {t, 0, 2})((1, 1, 2));

    values = InterpolatingFunctionValuesOnGrid@system2d; 
    times = Flatten@InterpolatingFunctionGrid@system2d;

    T1 = 0; timesteps = {}; For(i = 1, i < Length(times), i++, 
     If(times((i)) > T1, {T1 = T1 + TGap, 
       timesteps = Append(timesteps, {i, times((i))})}));
    finaltime = {{-1}}; firstandfinaltime = {{1}, {-1}};

    heights = 
      Table(Take(values((tt)), Length(values((tt)))/2), 
        {tt, 1, Length(values)});

    comps = Table(
       Take(values((tt)), -(Length(values((tt)))/2)),  
        {tt, 1, Length(values)});

      ListPlot(Table({i*dx, heights((ttt((1)), i + 1))}, {i, 0, N1}), 
       PlotRange -> {{0, 1}, {0, 1.05*a}}, Joined -> True, 
       AxesLabel -> {x, h}), {ttt, finaltime}))

      ListPlot(Table({i*dx, comps((ttt((1)), i + 1))}, {i, 0, N1}), 
       PlotRange -> {{0, 1}, {0, 1}}, Joined -> True,
       AxesLabel ->{x, X}), {ttt, finaltime}))

Thank you for any help you can offer me!