Skip to main content
added 4 characters in body
Source Link
corey979
  • 24.3k
  • 7
  • 60
  • 105

The subject is a bit cryptic, I know, but here is what I'd like to do: Let's say I am solving an ODE like this:

s = DSolve[{x'[t] == 1, y'[t] == x[t] t, x[0] == x0, 
   y[0] == y0}, {x[t], y[t]}, t]

which gives

{{x(t)->t+x0,y(t)->1/6 (2 t^3+3 t^2 x0+6 y0)}}

I could then apply the new rule to the second one that comes out of the DSolve to obtain y[t]y[t] as a function of x[]tx[t].

Now I'd like to convert the first of the replacement rules with one that replaces t, so the rule should look like this:

t -> -x0 + x[t]

I think the way to accomplish this would be to convert the Head Rule of my first rule to an Equal, and feed that into Solve. I tried to do that, but I can't get this to work.

The subject is a bit cryptic, I know, but here is what I'd like to do: Let's say I am solving an ODE like this:

s = DSolve[{x'[t] == 1, y'[t] == x[t] t, x[0] == x0, 
   y[0] == y0}, {x[t], y[t]}, t]

which gives

{{x(t)->t+x0,y(t)->1/6 (2 t^3+3 t^2 x0+6 y0)}}

I could then apply the new rule to the second one that comes out of the DSolve to obtain y[t] as a function of x[]t.

Now I'd like to convert the first of the replacement rules with one that replaces t, so the rule should look like this:

t -> -x0 + x[t]

I think the way to accomplish this would be to convert the Head Rule of my first rule to an Equal, and feed that into Solve. I tried to do that, but I can't get this to work.

The subject is a bit cryptic, I know, but here is what I'd like to do: Let's say I am solving an ODE like this:

s = DSolve[{x'[t] == 1, y'[t] == x[t] t, x[0] == x0, 
   y[0] == y0}, {x[t], y[t]}, t]

which gives

{{x(t)->t+x0,y(t)->1/6 (2 t^3+3 t^2 x0+6 y0)}}

I could then apply the new rule to the second one that comes out of the DSolve to obtain y[t] as a function of x[t].

Now I'd like to convert the first of the replacement rules with one that replaces t, so the rule should look like this:

t -> -x0 + x[t]

I think the way to accomplish this would be to convert the Head Rule of my first rule to an Equal, and feed that into Solve. I tried to do that, but I can't get this to work.

edited title
Link
Pirx
  • 4.2k
  • 13
  • 38

How to "solve""invert" a rule

added 122 characters in body
Source Link
Pirx
  • 4.2k
  • 13
  • 38

The subject is a bit cryptic, I know, but here is what I'd like to do: Let's say I am solving an ODE like this:

s = DSolve[{x'[t] == 1, y'[t] == x[t] t, x[0] == x0, 
   y[0] == y0}, {x[t], y[t]}, t]

which gives

{{x(t)->t+x0,y(t)->1/6 (2 t^3+3 t^2 x0+6 y0)}}

I could then apply the new rule to the second one that comes out of the DSolve to obtain y[t] as a function of x[]t.

Now I'd like to convert the first of the replacement rules with one that replaces t, so the rule should look like this:

t -> -x0 + x[t]

I think the way to accomplish this would be to convert the Head Rule of my first rule to an Equal, and feed that into Solve. I tried to do that, but I can't get this to work.

The subject is a bit cryptic, I know, but here is what I'd like to do: Let's say I am solving an ODE like this:

s = DSolve[{x'[t] == 1, y'[t] == x[t] t, x[0] == x0, 
   y[0] == y0}, {x[t], y[t]}, t]

which gives

{{x(t)->t+x0,y(t)->1/6 (2 t^3+3 t^2 x0+6 y0)}}

Now I'd like to convert the first of the replacement rules with one that replaces t, so the rule should look like this:

t -> -x0 + x[t]

I think the way to accomplish this would be to convert the Head Rule of my first rule to an Equal, and feed that into Solve. I tried to do that, but I can't get this to work.

The subject is a bit cryptic, I know, but here is what I'd like to do: Let's say I am solving an ODE like this:

s = DSolve[{x'[t] == 1, y'[t] == x[t] t, x[0] == x0, 
   y[0] == y0}, {x[t], y[t]}, t]

which gives

{{x(t)->t+x0,y(t)->1/6 (2 t^3+3 t^2 x0+6 y0)}}

I could then apply the new rule to the second one that comes out of the DSolve to obtain y[t] as a function of x[]t.

Now I'd like to convert the first of the replacement rules with one that replaces t, so the rule should look like this:

t -> -x0 + x[t]

I think the way to accomplish this would be to convert the Head Rule of my first rule to an Equal, and feed that into Solve. I tried to do that, but I can't get this to work.

Source Link
Pirx
  • 4.2k
  • 13
  • 38
Loading