C_R

3537 Reputation

21 Badges

6 years, 60 days

MaplePrimes Activity


These are answers submitted by C_R

ODESteps does not apply an adequate method although it has one on board:
Student:-ODEs:-Solve:-FirstOrderLinear. Instead "homotopy method" is applied.

When tracing ODEstep I got the impression that ODEstep tries to follow dsolve closely and adds comments step by step. Programming this is probably non trivial because essential steps in the execution of a sophisticated command (that was initially not designed for the purpose of education) have to be identified and attributed to a mathematical correct instruction to a student.

Assuming no bug in the program flow, the answer to your question “Why ODEStep is unable” could be: FirstOrderLinear is not implemented yet. This is likely because it is not listed here under “Step-by-Step Computation”.
I guess we will see it implemented in the future.

 

Update:
The old link did not work because of a special character in the file name.
first_order_quadrature_ode_with_odesteps.mw

(now v1749 can compute the integral using two methods )

Maple distinguishes between many units because they either are in use or they have been. For some units the context is important. ?Units,annotations provides some examples. If you find them strange or exotic it’s probably because you use the SI system and do not have to deal with, for example, historic units.
Maple also provides energy conversions ?Units,EnergyConversions which seem to be useful in certain areas but are not known at all in others domains.

The units package has grown over the years and includes allot of options and functions users have requested but other users do not need. For this reason the package has become powerfull but not straighforward to use (at least it was for me).
Up to you to use Grays or not.

 

Personally, I use the default unit settings in combination with convert and simplify. The context panel is usefull too.
If you have any particular calculation or conversion problems consider uploading a file with


 

2*Unit('gray')

2*Units:-Unit(Gy)

(1)

Using the context panel and conversion to E0/em and erg

2*Units:-Unit(Gy)

2*Units:-Unit(Gy)

(2)

2*Units:-Unit(Gy)

2*Units:-Unit(Gy)

(3)

Now: Remove the context

convert(2*Units:-Unit(Gy), units, J/kg)

2*Units:-Unit(J/kg)

(4)

` `After that, the context pannel does not offer conversion to Gray anymore (but to other units)

2*Units:-Unit(J/kg)

2*Units:-Unit(J/kg)

(5)

NULL

Lets do a calculation

2*Units:-Unit(Gy)-2*Units:-Unit(J/kg)

2*Units:-Unit(Gy)-2*Units:-Unit(J/kg)

(6)

simplify(2*Units:-Unit(Gy)-2*Units:-Unit(J/kg))

0

(7)

NULL


 

Download Unit_conversion.mw

The problem with your algorithm is the break statement that terminates the inner loop without defining a condition for t[j+1].

When the outer loop continues and increments j from 2 to 3 then this statement

assigns t[3] to u2[0]. t[3] however has no numeric value assigned to and Maple starts evaluating symbolic expressions. This blows up the whole calculation without giving any usefull results.

 

Attached is your code with debugging statements that allow you to investigate line by line the computation.

?worksheet,interactive,debugger explains how to use it.

NULL

 

restart;

 

dbg:=proc ()

DBG> quit

showstat(dbg)


dbg := proc()
local HAM, TOL, x, N, h, M, t, alpha, f1, f2, f3, g1, g2, j, u1, u2, u3, v1, v2, i,
kf1, kf2, kf3, kg1, kg2, U;
   1   HAM := [1];
   2   Digits := 30;
   3   TOL := 1/1000;
   4   x[0] := 0;
   5   N := 5000;
   6   h := .1e-2;
   7   M := 20;
   8   t[0] := .6;
   9   alpha := 0.;
  10   f1 := (x, u1, u2, u3, v1, v2) -> u2;
  11   f2 := (x, u1, u2, u3, v1, v2) -> u3;
  12   f3 := (x, u1, u2, u3, v1, v2) -> u2^2-2*u1*u3-v1^2;
  13   g1 := (x, u1, u2, v1, v2) -> v2;
  14   g2 := (x, u1, u2, v1, v2) -> 2*u2*v1-2*u1*v2;
  15   for j from 0 while j <= M do
  16       u1[0] := 0;
  17       u2[0] := t[j];
  18       u3[0] := 0;
  19       v1[0] := .8;
  20       v2[0] := 0;
  21       for i from 0 while i <= N-1 do
  22           DEBUG(is((i = 221)*`and`(j = 2)));
  23           kf1[i,1] := f1(x[i],u1[i],u2[i],u3[i],v1[i],v2[i]);
  24           kf2[i,1] := f2(x[i],u1[i],u2[i],u3[i],v1[i],v2[i]);
  25           kf3[i,1] := f3(x[i],u1[i],u2[i],u3[i],v1[i],v2[i]);
  26           kg1[i,1] := g1(x[i],u1[i],u2[i],u3[i],v1[i],v2[i]);
  27           kg2[i,1] := g2(x[i],u1[i],u2[i],u3[i],v1[i],v2[i]);
  28           kf1[i,2] := f1(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,1],u2[i]+1/2*h*kf2[
                 i,1],u3[i]+1/2*h*kf3[i,1],v1[i]+1/2*h*kg1[i,1],v2[i]+1/2*h*
                 kg2[i,1]);
  29           kf2[i,2] := f2(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,1],u2[i]+1/2*h*kf2[
                 i,1],u3[i]+1/2*h*kf3[i,1],v1[i]+1/2*h*kg1[i,1],v2[i]+1/2*h*
                 kg2[i,1]);
  30           kf3[i,2] := f3(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,1],u2[i]+1/2*h*kf2[
                 i,1],u3[i]+1/2*h*kf3[i,1],v1[i]+1/2*h*kg1[i,1],v2[i]+1/2*h*
                 kg2[i,1]);
  31           kg1[i,2] := g1(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,1],u2[i]+1/2*h*kf2[
                 i,1],u3[i]+1/2*h*kf3[i,1],v1[i]+1/2*h*kg1[i,1],v2[i]+1/2*h*
                 kg2[i,1]);
  32           kg2[i,2] := g2(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,1],u2[i]+1/2*h*kf2[
                 i,1],u3[i]+1/2*h*kf3[i,1],v1[i]+1/2*h*kg1[i,1],v2[i]+1/2*h*
                 kg2[i,1]);
  33           kf1[i,3] := f1(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,2],u2[i]+1/2*h*kf2[
                 i,2],u3[i]+1/2*h*kf3[i,2],v1[i]+1/2*h*kg1[i,2],v2[i]+1/2*h*
                 kg2[i,2]);
  34           kf2[i,3] := f2(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,2],u2[i]+1/2*h*kf2[
                 i,2],u3[i]+1/2*h*kf3[i,2],v1[i]+1/2*h*kg1[i,2],v2[i]+1/2*h*
                 kg2[i,2]);
  35           kf3[i,3] := f3(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,2],u2[i]+1/2*h*kf2[
                 i,2],u3[i]+1/2*h*kf3[i,2],v1[i]+1/2*h*kg1[i,2],v2[i]+1/2*h*
                 kg2[i,2]);
  36           kg1[i,3] := g1(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,2],u2[i]+1/2*h*kf2[
                 i,2],u3[i]+1/2*h*kf3[i,2],v1[i]+1/2*h*kg1[i,2],v2[i]+1/2*h*
                 kg2[i,2]);
  37           kg2[i,3] := g2(x[i]+1/2*h,u1[i]+1/2*h*kf1[i,2],u2[i]+1/2*h*kf2[
                 i,2],u3[i]+1/2*h*kf3[i,2],v1[i]+1/2*h*kg1[i,2],v2[i]+1/2*h*
                 kg2[i,2]);
  38           kf1[i,4] := f1(x[i]+h,h*kf1[i,3]+u1[i],h*kf2[i,3]+u2[i],h*kf3[i
                 ,3]+u3[i],h*kg1[i,3]+v1[i],h*kg2[i,3]+v2[i]);
  39           kf2[i,4] := f2(x[i]+h,h*kf1[i,3]+u1[i],h*kf2[i,3]+u2[i],h*kf3[i
                 ,3]+u3[i],h*kg1[i,3]+v1[i],h*kg2[i,3]+v2[i]);
  40           kf3[i,4] := f3(x[i]+h,h*kf1[i,3]+u1[i],h*kf2[i,3]+u2[i],h*kf3[i
                 ,3]+u3[i],h*kg1[i,3]+v1[i],h*kg2[i,3]+v2[i]);
  41           kg1[i,4] := g1(x[i]+h,h*kf1[i,3]+u1[i],h*kf2[i,3]+u2[i],h*kf3[i
                 ,3]+u3[i],h*kg1[i,3]+v1[i],h*kg2[i,3]+v2[i]);
  42           kg2[i,4] := g2(x[i]+h,h*kf1[i,3]+u1[i],h*kf2[i,3]+u2[i],h*kf3[i
                 ,3]+u3[i],h*kg1[i,3]+v1[i],h*kg2[i,3]+v2[i]);
  43           u1[i+1] := u1[i]+1/6*h*(kf1[i,1]+2*kf1[i,2]+2*kf1[i,3]+kf1[i,4]
                 );
  44           u2[i+1] := u2[i]+1/6*h*(kf2[i,1]+2*kf2[i,2]+2*kf2[i,3]+kf2[i,4]
                 );
  45           u3[i+1] := u3[i]+1/6*h*(kf3[i,1]+2*kf3[i,2]+2*kf3[i,3]+kf3[i,4]
                 );
  46           v1[i+1] := v1[i]+1/6*h*(kg1[i,1]+2*kg1[i,2]+2*kg1[i,3]+kg1[i,4]
                 );
  47           v2[i+1] := v2[i]+1/6*h*(kg2[i,1]+2*kg2[i,2]+2*kg2[i,3]+kg2[i,4]
                 );
  48           if abs(v1[i+1]-1) <= TOL then
  49               N := i+1;
  50               print("Value of v = ",[(i+1)*h, v1[i+1], u2[N]]);
  51               if abs(u2[i+1]) <= TOL then
  52                   print("Value of f' = ",u2[i+1]);
  53                   break
                   else
  54                   if j = 0 then
  55                       t[j+1] := t[j]+(alpha-u1[i+1])/(i+1)/h;
  56                       U[j] := u2[i+1];
  57                       print("Value of u1[j] = ",%)
                       else
  58                       U[j] := u2[i+1];
  59                       print("Value of u1[j] = ",%);
  60                       t[j+1] := t[j]-(U[j]-alpha)*(t[j]-t[j-1])/(U[j]-U[j
                             -1]);
  61                       print("Value of t = ",%)
                       end if
                   end if
               end if
           end do;
  62       print(j,i)
       end do
end proc
 

 

stopat(dbg,49);

[dbg]

(1)

dbg()

2, 222

(2)

NULL


 

Download debug.mw

The reason is this line of code that (I assume) determines the integration constant

Since the solution contains Pi and c__1 as a name (one name too much)

solve throws and error

odesteps_fail_may_10_2024-2_debug_attempt.mw

 

PS.: Maybe someone can tell why I could not stopat or showstat the procedure

For a newbe, you have mastered the most demanding part (DynamicSystems package) quite well but you forgot to add a space to define multiplication and to declare the variables without a dot in an equation as functions of t. For variables with a dot Maple automatically assumes that they are functions of t.

Triple Cart derivation

with(DynamicSystems); with(Physics)

 

cart1eom := `m__1 `*(diff(v__1(t), t, t))+c__1*(diff(v__1(t), t))+k*(v__1(t)-v__2(t)) = F

`m__1 `*(diff(diff(v__1(t), t), t))+c__1*(diff(v__1(t), t))+k*(v__1(t)-v__2(t)) = F

(1)

cart2eom := m__2*(diff(v__2(t), t, t))+c__2*(diff(v__2(t), t))+k*(v__2(t)-v__3(t)) = k*(v__1(t)-v__2(t))

m__2*(diff(diff(v__2(t), t), t))+c__2*(diff(v__2(t), t))+k*(v__2(t)-v__3(t)) = k*(v__1(t)-v__2(t))

(2)

cart3eom := m__3*(diff(v__3(t), t, t))+c__3*(diff(v__3(t), t)) = k*(v__2(t)-v__3(t))

m__3*(diff(diff(v__3(t), t), t))+c__3*(diff(v__3(t), t)) = k*(v__2(t)-v__3(t))

(3)

F := alpha*k__m*k__g*V(t)/(R*r)-k__m^2*k__g^2*(diff(v__1(t), t))/(R*r^2)``

expand(cart1eom)

`m__1 `*(diff(diff(v__1(t), t), t))+c__1*(diff(v__1(t), t))+k*v__1(t)-k*v__2(t) = alpha*k__m*k__g*V(t)/(R*r)-k__m^2*k__g^2*(diff(v__1(t), t))/(R*r^2)

(4)

"(->)"

`m__1 `*(diff(diff(v__1(t), t), t))+c__1*(diff(v__1(t), t))+k*v__1(t)-k*v__2(t)-alpha*k__m*k__g*V(t)/(R*r)+k__m^2*k__g^2*(diff(v__1(t), t))/(R*r^2) = 0

(5)

collect(`m__1 `*(diff(diff(v__1(t), t), t))+c__1*(diff(v__1(t), t))+k*v__1(t)-k*v__2(t)-alpha*k__m*k__g*V(t)/(R*r)+k__m^2*k__g^2*(diff(v__1(t), t))/(R*r^2) = 0, [v__1(t), v__2, diff(v__1(t), t, t), diff(v__1(t), t)])

k*v__1(t)-k*v__2(t)+`m__1 `*(diff(diff(v__1(t), t), t))+(c__1+k__m^2*k__g^2/(R*r^2))*(diff(v__1(t), t))-alpha*k__m*k__g*V(t)/(R*r) = 0

(6)

"(->)"

cart1eom

(7)

eoms := [cart1eom, cart2eom, cart3eom]

[k*v__1(t)-k*v__2(t)+`m__1 `*(diff(diff(v__1(t), t), t))+(c__1+k__m^2*k__g^2/(R*r^2))*(diff(v__1(t), t))-alpha*k__m*k__g*V(t)/(R*r) = 0, m__2*(diff(diff(v__2(t), t), t))+c__2*(diff(v__2(t), t))+k*(v__2(t)-v__3(t)) = k*(v__1(t)-v__2(t)), m__3*(diff(diff(v__3(t), t), t))+c__3*(diff(v__3(t), t)) = k*(v__2(t)-v__3(t))]

(8)

NULL

sys_1 := DiffEquation(eoms, [V], [v__3])

_m1349275517664

(9)

a := StateSpace(sys_1)

_m1349214001216

(10)

"(->)"

a, b, c, d, inputcount, outputcount, statecount, sampletime, discrete, systemname, inputvariable, outputvariable, statevariable, parameters, systemtype, ModulePrint, ModuleContextMenu

(11)

"->"

"module() ... end module"

(12)

StateSpace(sys_1)

_m1349236337536

(13)

NULL

Download 403TripleCart_reply.mw

You use a(n,j) to determine elements of the Matrix Alanda. In Maple a(n,j) represents a two argument function. For your purposes the following code is sufficient

Alanda:=Matrix(16,16):

for n from 1 to 16 do
for j from 1 to 16 do

    Alanda[n,j]:=coeff(eq[n],A[j]):

end do:
end do:

For Digits:=10 the Matirx Alanda looks like this

For Digits:=100

There is a huge difference in the minimal matrix values.
With this big difference it can be expected that calcutations will differ or fail if the problem is I'll conditioned. 

 Try:

    end proc

In your code there is a "r" missing

Here is a solution derived with the help of MapleSim, where I used MapleSim to assemble a kinematic loop of 4 links including the constraint AC=BD

 

By symmetry the angles can be derived from the triangle AED with AE=AB/2=85 and E=CD/2=145.

Knowing that Angle A= Angle B and Angle C = Angle D, only Angle A and Angle D have to be calculated.

With the law of cosines I get Angle A = 52.56628938 deg and Angle D=27.74140544 deg.

 

 

Trick_question.msim

 

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

5 6 7 8 9 10 11 Last Page 7 of 17