C_R

2025 Reputation

19 Badges

4 years, 216 days

MaplePrimes Activity


These are answers submitted by C_R

I cannot answer the why but provide a way for "full simplification" for the first expression group of the attached worksheet.

restart

kernelopts('version');

Physics:-Version();

`Maple 2024.0, X86 64 WINDOWS, Mar 01 2024, Build ID 1794891`

 

`The "Physics Updates" version in the MapleCloud is 1732. The version installed in this computer is 1724 created 2024, April 15, 17:29 hours Pacific Time, found in the directory C:\Users\cra\maple\toolbox\2024\Physics Updates\lib\`

(1)

with(RealDomain):

simplify(eval(MTM:-det(<
    a, b/2, d/2 |
    b/2, c, e/2 |
    d/2, e/2, f
   >), PDETools:-Solve(MTM:-det(<
      map(`**`, x + y, 2), seq[reduce = `+`](cat(_, 1 .. 3) **~ 2, _ in [x, y]) |
      x, x || (1 .. 3) |
      y, y || (1 .. 3) |
      <1 $ 4>
     >) = inner([cat](a .. f), [x**2, x*y, y**2, x, y, 1]),
    [cat](a .. f), 'independentof' = [x, y]))/MTM:-det(<
   <x || (1, 2, 3)> |
   <y || (1, 2, 3)> |
   <1 $ 3>
  >));
map(simplify,%)

-(1/4)*(x1^2-2*x1*x2+x2^2+(y1-y2)^2)*(x1^2-2*x1*x3+x3^2+(y1-y3)^2)*(x2^2-2*x2*x3+x3^2+(y2-y3)^2)

 

-(1/4)*((y1-y2)^2+(x1-x2)^2)*((y1-y3)^2+(x1-x3)^2)*((y2-y3)^2+(x2-x3)^2)

(2)

 


For the second expression group the map trick does not work. The length of the subexpression seems to play a role

simplify((x2 - x3)*x1 - x2*x4 + x3*x4)
                      (x2 - x3) (x1 - x4)

#but
simplify((x2 - x3)*x1 - x2*x4 + x3*x4 + (y1 - y4)*(y2 - y3))
       (x2 - x3) x1 - x2 x4 + x3 x4 + (y1 - y4) (y2 - y3)

I hope there will be an answer on the why.

 

Download Why_not_touch_subexpressions-reply.mw

What worked for me: Substitute the IC into the solution of ode,implict from vv and not into the original sol_no_IC. This way, no branches need to be selected.

restart;
ode := x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1);
ic := y(1) = 1;
sol_no_IC_vv := dsolve(ode, implicit);
solve(%, {c__1});
subs(x = 1, ic, %);
solve(eval(sol_no_IC_vv, %), {y(x)})[];

 

Below is the solution for the difference term for lambda_i>0.
If you decide on 3 parameters and fix the others it can be plotted with implicitplot3d.
Was it something like this you were looking for?

Download inequality_reply.mw

difference_term := (-lambda__1 - lambda__2 - lambda__3)*theta^2 + (X__1*lambda__1 + X__2*lambda__2 - X__3*lambda__3 + lambda__1*(X__1 + delta__1) + lambda__2*(X__2 + delta__2) - lambda__3*(X__3 + delta__3))*theta;

(-lambda__1-lambda__2-lambda__3)*theta^2+(X__1*lambda__1+X__2*lambda__2-X__3*lambda__3+lambda__1*(X__1+delta__1)+lambda__2*(X__2+delta__2)-lambda__3*(X__3+delta__3))*theta

(1)

# I would expect such difference_term in theta to be always < 0, i.e., for any theta different from 0)
# (Note that lambda_1, lambda_2, and lambda_3 are always > 0, while theta, the three X and the three delta can be positive or negative. In other words, it suffices to show that the linear term in theta is always negative...)

NULL

You can get rid of the warnings with assumptions

`assuming`([solve(difference_term < 0, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 > 0, delta__2 > 0, delta__3 > 0])

{X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, theta < 0, -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1}

(2)

Replacing the big fraction by something shorter

W__ = lhs(({X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, theta < 0, -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1})[1][-1]); alias(%)

W = -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1

(3)

{X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, theta < 0, -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1}

{X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, W < X__1, theta < 0}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < W}

(4)

and removing from the two solutions in (2) common expressions

its := `intersect`(({X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, theta < 0, -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1})[1], ({X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, theta < 0, -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1})[2])

{X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3}

(5)

`minus`(({X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, theta < 0, -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1})[1], its); `minus`(({X__2 = X__2, X__3 = X__3, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, theta < 0, -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}, {X__2 = X__2, X__3 = X__3, 0 < theta, 0 < delta__1, 0 < delta__2, 0 < delta__3, 0 < lambda__1, 0 < lambda__2, 0 < lambda__3, X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1})[2], its)

{0 < theta, X__1 < W}

(6)

In words.
1# solution: For positive lambdas and deltas and arbitrary X__2, X__3, theta<0, W[1] has a certain value which is smaller than X__1.
2# solution: For positive lambdas and deltas and arbitrary X__2, X__3, theta>0, W[1] has a certain value which is greater than X__1.

Solving for X__1 yields a piecewise solution which is easier to interprete

`assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 > 0, delta__2 > 0, delta__3 > 0])

piecewise(0 < theta*lambda__1, [{X__1 < W}], theta*lambda__1 < 0, [{W < X__1}], [])

(7)

Doing this systematically: delta permutations

sol[1] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 > 0, delta__2 > 0, delta__3 > 0]); sol[2] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 > 0, delta__2 > 0, delta__3 < 0]); sol[3] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 > 0, delta__2 < 0, delta__3 > 0]); sol[4] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 > 0, delta__2 < 0, delta__3 < 0]); sol[5] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 < 0, delta__2 > 0, delta__3 > 0]); sol[6] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 < 0, delta__2 > 0, delta__3 < 0]); sol[7] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 < 0, delta__2 < 0, delta__3 > 0]); sol[8] := `assuming`([solve(difference_term < 0, X__1, useassumptions = true)], [lambda__1 > 0, lambda__2 > 0, lambda__3 > 0, theta <> 0, delta__1 < 0, delta__2 < 0, delta__3 < 0])

Removing identical solutions

{seq(sol[i], i = 1 .. 8)}

{piecewise(0 < theta*lambda__1, [{X__1 < W}], theta*lambda__1 < 0, [{W < X__1}], [])}

(8)

alias(W = W)

subs(W = -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1, {piecewise(0 < theta*lambda__1, [{X__1 < W}], theta*lambda__1 < 0, [{W < X__1}], [])})

{piecewise(0 < theta*lambda__1, [{X__1 < -(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1}], theta*lambda__1 < 0, [{-(1/2)*(2*X__2*lambda__2-2*X__3*lambda__3-theta*lambda__1-theta*lambda__2-theta*lambda__3+delta__1*lambda__1+delta__2*lambda__2-delta__3*lambda__3)/lambda__1 < X__1}], [])}

(9)

This is the solution for lambda__i > 0.   

Simple redefines the arithmetric operators. 

See Units,Simple,arithop

The programming guide (page 260) explains that in your case the arrow notation repeats without computation what was entered which are the by Units:-Simple redefined operators.

For example

[17.85*(2.65*t^2 + 1 + 3*t)^2/t^2, 17.85*(2.65*t^2 - 47 + 3*t)^2/t^2, 17.85*(2.65*t^2 - 97 + 3*t)^2/t^2, 17.85*(2.65*t^2 - 147 + 3*t)^2/t^2, 17.85*(2.65*t^2 - 197 + 3*t)^2/t^2]:
plot(%, t = 0 .. 25, labels = ['t', 'x'], labelfont = [Times, 12],legend=%)

 

This removes the error message

M := Array(1 .. 10, 1 .. 2);

for i to 10 do
    M[i, 1] := i;
    M[i, 2] := 3*i;
end do;

Mt := Interpolation:-LinearInterpolation(M);
E := t -> Mt(t);
diffeq := D(C)(t) = E;
sol:=dsolve({diffeq, C(0) = 0}, {C(t)}, numeric);
plots:-odeplot(sol,t=0..10);

However, there is a difference to

diffeq := D(C)(t) = 3*t;
sol:=dsolve({diffeq, C(0) = 0}, {C(t)}, numeric);
plots:-odeplot(sol,t=0..10);

that I do not understand.

By the way: I would not use linear interpolated functions since the first derivative is not defined between interpolated sections.

Edit: I have just seen Perbens answer which gives the same result as my second code snippet if you add to Perbens code

plot('int(Mt,0..t,numeric)',t=0..10);

 

You have quite some freedom to get a solution, but it will be more than one relation to deal with.

NULL

Assuming real in the following

(a*x^2+b*x+c)/(d*x+t)

(a*x^2+b*x+c)/(d*x+t)

(1)

First derivative > 0

(`@`(normal, diff))((a*x^2+b*x+c)/(d*x+t), x) > 0

0 < (a*d*x^2+2*a*t*x+b*t-c*d)/(d*x+t)^2

(2)

Since the numerator above is always positive the relation (2) can be simplified

(op(0, 0 < (a*d*x^2+2*a*t*x+b*t-c*d)/(d*x+t)^2))(`~`[`*`](op(0 < (a*d*x^2+2*a*t*x+b*t-c*d)/(d*x+t)^2), (`@`(denom, rhs))(0 < (a*d*x^2+2*a*t*x+b*t-c*d)/(d*x+t)^2)))

0 < a*d*x^2+2*a*t*x+b*t-c*d

(3)

With

indets(0 < (a*d*x^2+2*a*t*x+b*t-c*d)/(d*x+t)^2)

{a, b, c, d, t, x}

(4)

five indeterminates and one relation the problem is underdetermined (for a given x) by an order of four.
Replacing x by the limits of the interval allows to reformulate the problem.  

collect(isolate(subs(x = m, 0 < a*d*x^2+2*a*t*x+b*t-c*d), a), a)

(-d*m^2-2*m*t)*a < b*t-c*d

(5)

collect(isolate(subs(x = n, 0 < a*d*x^2+2*a*t*x+b*t-c*d), a), a)

(-d*n^2-2*n*t)*a < b*t-c*d

(6)

There are still too many unknowns. However, it is possible to group them into new ones and solve for a.

NULL

A*a <= B

A*a <= B

(7)

C*a <= B

C*a <= B

(8)

RealDomain:-solve({A*a <= B, C*a <= B}, a)

piecewise(And(0 <= B, A = 0, C = 0), [{a = a}], A = 0, [{a <= B/C}], A = 0, [{a <= B/C}, {B/C <= a}], A = 0, [{B/C <= a}], C = 0, [{a <= B/A}], C = 0, [{a <= B/A}, {B/A <= a}], And(0 < A, 0 < C, B/A <= B/C), [{a <= B/A}], And(0 < A, 0 < C, B/C < B/A), [{a <= B/C}], And(0 < A, C < 0, B/C <= B/A), [{a <= B/A, B/C <= a}], C = 0, [{B/A <= a}], And(A < 0, 0 < C, B/A <= B/C), [{a <= B/C, B/A <= a}], And(A < 0, C < 0, B/C <= B/A), [{B/A <= a}], And(A < 0, C < 0, B/A < B/C), [{B/C <= a}], [])

(9)

These are the relations for a which depend on A, B , C

A = lhs((-d*m^2-2*m*t)*a < b*t-c*d)/a, B = rhs((-d*m^2-2*m*t)*a < b*t-c*d), C = lhs((-d*n^2-2*n*t)*a < b*t-c*d)/a

A = -d*m^2-2*m*t, B = b*t-c*d, C = -d*n^2-2*n*t

(10)

For a given interval [m,n] there is the freedom to decide on t and d as well as b and c and then select the appropriate relation from (9) to determine a

 

Update 

Adressing a trivial case:

The solution above includes the case where  one of the roots of the numerator equals the pole p = -t/d (the zero of the denominator of (1)).
It is not required for the pole to be located outside the interval [m,n].
In this case, b and c cannot be chosen freely, but must fulfill the equations below, where e is an arbitrary parameter.

numer((a*x^2+b*x+c)/(d*x+t)) = denom((a*x^2+b*x+c)/(d*x+t))*(x+e)

a*x^2+b*x+c = (d*x+t)*(x+e)

(11)

map(coeffs, expand(a*x^2+b*x+c = (d*x+t)*(x+e)), x)

(a, b, c) = (d, d*e+t, e*t)

(12)

zip(proc (x, y) options operator, arrow; x = y end proc, ([lhs], [rhs])((a, b, c) = (d, d*e+t, e*t)))[]

a = d, b = d*e+t, c = e*t

(13)

 

NULL

 

 

Download underdetermined_relation_update.mw

 


 

Your problem has the following  structure

s*(a*s^3+s^4+b*s^2+c*s^2+d)

s*(a*s^3+s^4+b*s^2+c*s^2+d)

(1)

where the coefficients a, b, c, d are functions of λ0  λ1  λ2  λ3  µ1  µ2 and  µ3. (I assume in the following that you are able to express a, b, c, d as functions of λ0  λ1  λ2  λ3  µ1  µ2 and  µ3)
 
Solve now (1) for s

solve(s*(a*s^3+s^4+b*s^2+c*s^2+d), s)

0, RootOf(_Z^4+a*_Z^3+(b+c)*_Z^2+d)

(2)

You get the trivial solution and the roots for m, n, o, p in terms of a RootOf expression.
You can make them explict by

m, n, o, p := allvalues((0, RootOf(_Z^4+a*_Z^3+(b+c)*_Z^2+d))[2])

These are big expressions. Here is the solution for one of them

m

-(1/4)*a+(1/2)*((1/4)*a^2-(2/3)*b-(2/3)*c+(1/6)*(-288*d*b-288*d*c+108*d*a^2+8*b^3+24*b^2*c+24*b*c^2+8*c^3+12*(81*a^4*d^2+12*a^2*b^3*d+36*a^2*b^2*c*d+36*a^2*b*c^2*d+12*a^2*c^3*d-432*a^2*b*d^2-432*a^2*c*d^2-48*b^4*d-192*b^3*c*d-288*b^2*c^2*d-192*b*c^3*d-48*c^4*d+384*b^2*d^2+768*b*c*d^2+384*c^2*d^2-768*d^3)^(1/2))^(1/3)-6*(-(4/3)*d-(1/9)*b^2-(2/9)*b*c-(1/9)*c^2)/(-288*d*b-288*d*c+108*d*a^2+8*b^3+24*b^2*c+24*b*c^2+8*c^3+12*(81*a^4*d^2+12*a^2*b^3*d+36*a^2*b^2*c*d+36*a^2*b*c^2*d+12*a^2*c^3*d-432*a^2*b*d^2-432*a^2*c*d^2-48*b^4*d-192*b^3*c*d-288*b^2*c^2*d-192*b*c^3*d-48*c^4*d+384*b^2*d^2+768*b*c*d^2+384*c^2*d^2-768*d^3)^(1/2))^(1/3))^(1/2)+(1/2)*((1/2)*a^2-(4/3)*b-(4/3)*c-(1/6)*(-288*d*b-288*d*c+108*d*a^2+8*b^3+24*b^2*c+24*b*c^2+8*c^3+12*(81*a^4*d^2+12*a^2*b^3*d+36*a^2*b^2*c*d+36*a^2*b*c^2*d+12*a^2*c^3*d-432*a^2*b*d^2-432*a^2*c*d^2-48*b^4*d-192*b^3*c*d-288*b^2*c^2*d-192*b*c^3*d-48*c^4*d+384*b^2*d^2+768*b*c*d^2+384*c^2*d^2-768*d^3)^(1/2))^(1/3)+6*(-(4/3)*d-(1/9)*b^2-(2/9)*b*c-(1/9)*c^2)/(-288*d*b-288*d*c+108*d*a^2+8*b^3+24*b^2*c+24*b*c^2+8*c^3+12*(81*a^4*d^2+12*a^2*b^3*d+36*a^2*b^2*c*d+36*a^2*b*c^2*d+12*a^2*c^3*d-432*a^2*b*d^2-432*a^2*c*d^2-48*b^4*d-192*b^3*c*d-288*b^2*c^2*d-192*b*c^3*d-48*c^4*d+384*b^2*d^2+768*b*c*d^2+384*c^2*d^2-768*d^3)^(1/2))^(1/3)+((b+c)*a-(1/4)*a^3)/((1/4)*a^2-(2/3)*b-(2/3)*c+(1/6)*(-288*d*b-288*d*c+108*d*a^2+8*b^3+24*b^2*c+24*b*c^2+8*c^3+12*(81*a^4*d^2+12*a^2*b^3*d+36*a^2*b^2*c*d+36*a^2*b*c^2*d+12*a^2*c^3*d-432*a^2*b*d^2-432*a^2*c*d^2-48*b^4*d-192*b^3*c*d-288*b^2*c^2*d-192*b*c^3*d-48*c^4*d+384*b^2*d^2+768*b*c*d^2+384*c^2*d^2-768*d^3)^(1/2))^(1/3)-6*(-(4/3)*d-(1/9)*b^2-(2/9)*b*c-(1/9)*c^2)/(-288*d*b-288*d*c+108*d*a^2+8*b^3+24*b^2*c+24*b*c^2+8*c^3+12*(81*a^4*d^2+12*a^2*b^3*d+36*a^2*b^2*c*d+36*a^2*b*c^2*d+12*a^2*c^3*d-432*a^2*b*d^2-432*a^2*c*d^2-48*b^4*d-192*b^3*c*d-288*b^2*c^2*d-192*b*c^3*d-48*c^4*d+384*b^2*d^2+768*b*c*d^2+384*c^2*d^2-768*d^3)^(1/2))^(1/3))^(1/2))^(1/2)

(3)

NULL

NULL

You can now substitute a, b, c, d into the solutions for n, m, o, p and try to simplify. If assumitions can be made on λ0  λ1  λ2  λ3  µ1  µ2 and  µ3 it is advisable to simplify a, b, c, d, first.

NULL


 

Download det_roots_ans.mw

Its not simplify throwing the error, its RootOf

restart;
printlevel:=50;
allvalues(RootOf(1/sin(_Z)))

Its difficult to find out more. I assume that RootOf does not look into 1/sin(_Z) because 1/sin(_Z) has no roots and looks for dependencies on other variables. Since RootOf cannot find any other variable it reports that there are none. If a root is added

allvalues(RootOf(x/sin(_Z)))

one can observe how variables are changed to the place holder_Z in the RootOf call.
 

Maple does not have a built-in solution to prevent automatic simplification from removing a one from a product.

As is does not make sense to write 1 hour as h, it does not make sense mathematically to keep the one in a product. Edit: with units it makes sense now.

(Try whattype on your output and you will see that it is not a product any more.)

To get a printed one, you can find work-arounds here (all of which come with a drawback).
acers solution points toward a propper way: an inert 1 that could be evalauted to 1 by using the value command.

@MapleSoft: Please consider this for future releases

Below is an additional way that does not require typesetting knowlegde

 

restart; interface(version)

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

(1)

1

1

(2)

whattype(1)

integer

(3)

In 2d-Math, select the 1`` below and convert it to atomic (using right-click)

a_one := `#mrow(mn("1"),mi("\`\`"))`

`#mrow(mn("1"),mi("\`\`"))`

(4)

whattype(`#mrow(mn("1"),mi("\`\`"))`)

symbol

(5)

`#mrow(mn("1"),mi("\`\`"))`*h

`#mrow(mn("1"),mi("\`\`"))`*h

(6)

whattype(`#mrow(mn("1"),mi("\`\`"))`*h)

`*`

(7)

After computation, the atomic one can be removed by subs

subs(a_one = 1, `#mrow(mn("1"),mi("\`\`"))`*h)

h

(8)

subs(`#mrow(mn("1"),mi("\`\`"))` = 1, `#mrow(mn("1"),mi("\`\`"))`*h)

h

(9)

The second way (select and copypaste of GUI output) must be performed carefully to copy exactly the atomic one symbol and not more.


AtomicOne.mw

 

 

Technically, the injection at t=1 is called an event. An event normally requires reconfiuration of an ODE system. More on dsolve events under ?dsolve,numeric,Events. My understanding of the event options (maybe I am wrong) is that your event (ifelse(t=1,Dose,0)) cannot be given as an option. What you could do instead is splitting the problem at the event into two problems (one before and one after the event) and then plot everything with plots,display. By doing so the event becomes an initial condition for the second problem

However, before you do so, have a look at the event. As you defined it, it does not add any dose to the system because the timespan is infinite small. You need to define an injection amount. I have done this below by introducing a time span epsilon

restart;
k12 := 0.0452821;
k21 := 0.0641682;
k1x := 0.00426118;
Dose := 484;
Inj := Heaviside(t - 1) - Heaviside(t - 1 - epsilon);
epsilon := 0.1;
ode_sys := diff(SA2(t), t) = SA1(t)*k12 - SA2(t)*k21, diff(SA1(t), t) = Inj - k1x*SA1(t);
ics := SA2(0) = 0, SA1(0) = 0;
Solution1 := dsolve({ics, ode_sys}, {SA1(t), SA2(t)}, numeric);
plots:-odeplot(Solution1, [[t, SA1(t), color = "red", thickness = 1], [t, SA2(t), color = "blue", thickness = 1]], t = 0 .. 500, labels = ["Time t", "Salicylic acid"], labeldirections = [horizontal, vertical]);

 

Why not remove the differential from the start?

In your example you could have devided expression (1) by dz. This effectively transforms (1) into a differential quotient.

Maple does not accept differentials for integration but can work this way with differential quotients.

restart

NULL

`&tau;_` = int(diff(`&tau;_`(z), z), z = l .. -l)

`&tau;_` = int(diff(`&tau;_`(z), z), z = l .. -l)

(1)

diff(`&tau;_`(z), z) = -I*z*B__0*x^2*_j/d^2-I*y*B__0*x^2*_k/d^2

diff(`&tau;_`(z), z) = -I*z*B__0*x^2*_j/d^2-I*y*B__0*x^2*_k/d^2

(2)

subs(diff(`&tau;_`(z), z) = -I*z*B__0*x^2*_j/d^2-I*y*B__0*x^2*_k/d^2, `&tau;_` = int(diff(`&tau;_`(z), z), z = l .. -l))

`&tau;_` = int(-I*z*B__0*x^2*_j/d^2-I*y*B__0*x^2*_k/d^2, z = l .. -l)

(3)

value(%)

`&tau;_` = (2*I)*y*B__0*x^2*_k*l/d^2

(4)

NULL


 Mathematically, this is the exact way and (I assume) the reason why we don't find differentials in Maple, even though they are still widely used in physics and engineering.

Download RemoveDifferential_wothout_differential.mw

with 2024

(normal@expand@combine)((2), trig)

same as

normal(expand(combine(expr2, trig)))

 

You can use format strings to format the output as you want

a := 3*89/100.;
b := 3*21/100.;
printf("%g,%g,%6.2f,%9.2f", a, b, a, b);
                        a := 2.670000000

                       b := 0.6300000000

2.67,0.63,  2.67,     0.63

Newer versions of Maple have the context pannel (or right click on the output) for numeric formating. I don't know if that is possible in Maple 2016.

 

Prefixnotation is especially useful in functional programming where a sequence of commands is grouped using the composition operator @. It is way of separating functions (i.e. Maple commands) from arguments. Otherwise, nested commands with allot of parentheses have to be used.

There is little documentation on that and it is IMO not self-explaining. I got a pretty good explanation here in MaplePrimes. And here is a nice example of a self-made “unary prefix operator” that simplifies a rational expression. (I have put operator in quotation marks since depending on what is does it can equally be called function or command in Maple. In this example it is rather a command.)

I agree that for only two operands infix notation is often preferable. But in functional programming the number of operands (or better arguments if interpreted from a procedure perspective) can change in the course of processing composed commands.

I think a bit more explanatory documentation on top of dharr's examples would not harm.

I hope this completes the picture why Maple sometimes provides infix and prefix notation for the same operation. Functional programming without some prefix variants would be less powerful.

1 2 3 4 5 6 7 Last Page 1 of 11