> restart;

>

> with(PDEtools);

>

> with(Units[Standard]);

> with(ScientificConstants);

>

> #

>

> # Electron velocity distribution:

>

> f[e] := A[e]*exp(-B[e]*(((1/2)*m[e]*v^2)^2+((1/2)*m[e]*v^2*m[e])*`ϖ`^2*lambda[e]^2)/T[e]^2);

> f[e, 1] := f[e]/A[e];

>

> f[e, 2] := (1/2)*f[e, 1]*m[e]*v^2;

> expr[e, 1] := `assuming`([4*Pi*(int(f[e, 1]*v^2, v = 0 .. infinity))], [positive]);

> expr[e, 2] := `assuming`([4*Pi*(int(f[e, 2]*v^2, v = 0 .. infinity))], [positive]);

> expr[e, lhs] := simplify(expr[e, 1]/expr[e, 2]);

> expr[e, rhs] := 1/T[e];

> eq[e, 1] := expr[e, lhs]/expr[e, rhs] = 1;

>

> # Constants:

> `ϖ` := 22*10^6*Unit('Hz');

> T[e] := 3*Unit('eV');

> lambda[e] := Unit('mm');

> m[e] := evalf(Constant(m[e], units));

>

> eq[e, 2] := simplify(eq[e, 1]);

> B[e] := fsolve(eq[e, 2], B[e]);

> A[e, res1] := simplify(1/expr[e, 1]);

> A[e, res2] := simplify(T[e]/expr[e, 2]);

>

Download questions_1.mpl.txt

> restart;

> with(PDEtools);

>

>

> # Electron velocity distribution:

> f[e] := A[e]*exp(-B[e]*(((1/2)*m[e]*v^2)^2+((1/2)*m[e]*v^2*m[e])*`ϖ`^2*lambda[e]^2)/T[e]^2);

> f[e, 1] := f[e]/A[e];

>

> f[e, 2] := (1/2)*f[e, 1]*m[e]*v^2;

> expr[e, 1] := `assuming`([4*Pi*(int(f[e, 1]*v^2, v = 0 .. infinity))], [positive]);

> expr[e, 2] := `assuming`([4*Pi*(int(f[e, 2]*v^2, v = 0 .. infinity))], [positive]);

> expr[e, lhs] := simplify(expr[e, 1]/expr[e, 2]);

> expr[e, rhs] := 1/T[e];

> eq[e, 1] := expr[e, lhs] = expr[e, rhs];

>

> # Constants:

> `ϖ` := 22*10^6;

> T[e] := (3*1.6)*10^(-19);

> lambda[e] := 0.1e-2;

> m[e] := 9.1*10^(-31);

>

>

>

> eq[e, 2] := simplify(eq[e, 1]);

> B[e] := fsolve(eq[e, 2], B[e]);

> A[e, res1] := simplify(1/expr[e, 1]);

> A[e, res2] := simplify(T[e]/expr[e, 2]);

>

Download questions_2.mpl.txt

I am solving two coefficients (A_e and B_e) in one velocity distribution function (3D) with two closures (1: normalization 2: average kinetic energe). I solved B_e first by dividing 2 closures which eliminate A_e first and then recalculate A_e by substituting B_e to either of two closures. See file question_1 and questions_2 (describing the same question with/without using physics units). In question_2, I do not use units system. However, the A_e obtained from two closures are 3 order different, which makes no sense at all. In question_1 I use units then A_e from the 2nd closures won't return anything. Can anyone explain why it happens and suggest some tricks to avoid it? Thank you in advance.