Message Boards Message Boards

0
|
2479 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Isolating coefficients from a long exponential function

Posted 1 year ago

I would like to isolate the coefficients from the solution of this ODE, into a list:

sol = DSolve[{y'''[x] + y''[x] + y[x] == 0, y'''[0] == 1, y''[0] ==1,
              y'[0] == 0}, y[x], x]
soln= TrigToExp[sol];
Cases[soln, a_ Exp[b_ t] :> {b, a}]

Since the coefficients are long and messy.
The given attempt with "Cases" did not succeed.
How can I do that?

Thanks

POSTED BY: Ser Man
3 Replies

You probably mean

sol = DSolve[{y'''[x] + y''[x] + y[x] == 0, y'''[0] == 1, y''[0] == 1,    y'[0] == 0}, y[x], x]

soln = TrigToExp[sol];

Cases[soln, a__ Exp[b__ x] :> {b, a}, \[Infinity]]
POSTED BY: Roland Franzius
Posted 1 year ago

Thanks Roland! That worked!

POSTED BY: Ser Man
Posted 1 year ago
 soln = TrigToExp[y[x] /. sol[[1]]] // Simplify // ExpandAll
 Cases[soln, c_ Exp[__] -> c]
POSTED BY: Updating Name
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