Message Boards Message Boards

0
|
1109 Views
|
5 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Transforming the equation into the relationship between t and dt

Posted 6 months ago

First, let's take a slightly simpler formula, and the code is as follows:

Error[t_] := (S1^(t/dt) - S2^(t/dt))*X0 + (1 - S1^(t/dt))/(1 - S1)*
   STAR1 - (1 - S2^(t/dt))/(1 - S2)*STAR2
X = Error[t]
D[X, t] == 0

I want to obtain a relationship between t and dt in the equation D[X, t]==0 (just like t is the dependent variable and dt is the independent variable, or t is on the left side of the equation and dt is on the right side of the equation). What methods or instructions can be used to simplify it?

If consider a more complex situation where S1, S2, STAR1, and STAR2 all contain dt, the code is as follows:

S1 = 1 - dt*A + 1/2*dt*dt*A*A;
S2 = 1 - dt*A;
STAR1 = S1*B;
STAR2 = S2*B;
Error[t_] := (S1^(t/dt) - S2^(t/dt))*X0 + (1 - S1^(t/dt))/(1 - S1)*
   STAR1 - (1 - S2^(t/dt))/(1 - S2)*STAR2
X = Error[t]
D[X, t] == 0

And what method can I use to simplify at this time?

POSTED BY: James James
5 Replies

Right away I see a problem with

Solve[X == 0 && dt == 0.00006, {dt,t}]

Since X is two-dimensional, it is a system of three equations in two unknowns, You should not expect it to have solutions.

POSTED BY: Gianluca Gorni
Posted 6 months ago

Okay, haha, what if I write it like this?

{r = 22, l = 2 10^-1, c = 1 10^-4, vi = 24};
\[CapitalDelta]vi = 0;
A = {{0, -1/l}, {1/c, -1/(r c)}};
G = Inverse[A];
B = {1/l, 0};
S1 = Inverse[DiagonalMatrix[{1, 1}] - dt*A + 1/2*dt*dt*A . A];
S2 = Inverse[DiagonalMatrix[{1, 1}] - dt*A];
STAR1 = S1 . G . (B*vi + G . B*\[CapitalDelta]vi/dt) - 
   G . (B*(vi + \[CapitalDelta]vi) + G . B*\[CapitalDelta]vi/dt);
STAR2 = S2 . G . (B*vi + G . B*\[CapitalDelta]vi/dt) - 
   G . (B*(vi + \[CapitalDelta]vi) + G . B*\[CapitalDelta]vi/dt);
X0 = {0, 0};
X = (MatrixPower[S1, t/dt] . Log[S1]/dt - 
      MatrixPower[S2, t/dt] . Log[S2]/dt) . X0 - 
   MatrixPower[S1, t/dt] . Inverse[DiagonalMatrix[{1, 1}] - S1] . 
     STAR1 . Log[S1]/dt + 
   MatrixPower[S2, t/dt] . Inverse[DiagonalMatrix[{1, 1}] - S2] . 
     STAR2 . Log[S2]/dt;
Solve[X[[1]] == 0 && dt == 0.00006, {t, dt}]
POSTED BY: James James

Why solving for dt if you already know its value? You can try this:

FindRoot[Simplify[X[[1]] == 0 /. dt -> 0.00006], {t, .05}]

but you are working with extremely small numbers and the results are not very reliable.

POSTED BY: Gianluca Gorni

The last case can be solved symbolically:

S1 = 1 - dt*A + 1/2*dt*dt*A*A;
S2 = 1 - dt*A;
STAR1 = S1*B;
STAR2 = S2*B;
Error[t_] := (S1^(t/dt) - S2^(t/dt))*X0 + (1 - S1^(t/dt))/(1 - S1)*
   STAR1 - (1 - S2^(t/dt))/(1 - S2)*STAR2
X = Error[t];
Solve[D[X, t] == 0, t] // FullSimplify
POSTED BY: Gianluca Gorni
Posted 6 months ago

Thank you for your answer! This time, I brought in the specific numerical value and wanted to find the corresponding value of t when X==0&&dt=0.00006. I used the following writing method (Solve instruction), but it seems that I cannot solve it.

{r = 22, l = 2 10^-1, c = 1 10^-4, vi = 24};
\[CapitalDelta]vi = 0;
A = {{0, -1/l}, {1/c, -1/(r c)}};
G = Inverse[A];
B = {1/l, 0};
S1 = Inverse[DiagonalMatrix[{1, 1}] - dt*A + 1/2*dt*dt*A . A];
S2 = Inverse[DiagonalMatrix[{1, 1}] - dt*A];
STAR1 = S1 . G . (B*vi + G . B*\[CapitalDelta]vi/dt) - 
   G . (B*(vi + \[CapitalDelta]vi) + G . B*\[CapitalDelta]vi/dt);
STAR2 = S2 . G . (B*vi + G . B*\[CapitalDelta]vi/dt) - 
   G . (B*(vi + \[CapitalDelta]vi) + G . B*\[CapitalDelta]vi/dt);
X0 = {0, 0};
X = (MatrixPower[S1, t/dt] . Log[S1]/dt - 
      MatrixPower[S2, t/dt] . Log[S2]/dt) . X0 - 
   MatrixPower[S1, t/dt] . Inverse[DiagonalMatrix[{1, 1}] - S1] . 
     STAR1 . Log[S1]/dt + 
   MatrixPower[S2, t/dt] . Inverse[DiagonalMatrix[{1, 1}] - S2] . 
     STAR2 . Log[S2]/dt;
Solve[X == 0 && dt == 0.00006, {dt,t}]
POSTED BY: James James
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract