Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.4K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Eval/Plot a function which has a variable defined as a solution of an ODE

Posted 11 years ago
POSTED BY: B B
2 Replies
Posted 11 years ago

Thank you You perfectly answer to my question.

POSTED BY: B B

Hi there,

it would have helped to have the actual ODE, but I will for this illustration just make one up:

eqL\[Gamma] = \[Gamma]''[t] - \[Gamma]'[t] - \[Gamma][t] == Sin[t];

You can then run your NDSolve

s = NDSolve[{eqL\[Gamma], \[Gamma][0] == .79, \[Gamma]'[0] == 0}, \[Gamma][t], {t, 0, 2}]

Then you can define the x[t]; note that you need to add values for $l$ and $r$ unless you want to use Manipulate or Animate.

x = 1/2 (2 r Cos[\[Gamma][t]] + Sqrt[2] Sqrt[2 l^2 - r^2 + r^2 Cos[2 \[Gamma][t]]]) /. {s[[1, 1]], r -> 1, l -> 1}

and plot

Plot[x, {t, 0, 3}]

enter image description here

Cheers,

M.

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard