Message Boards Message Boards

GROUPS:

Plotting an NDSolve solution as a function of a parameter?

Posted 6 months ago
1360 Views
|
5 Replies
|
1 Total Likes
|

Hello everyone,

I am trying to plot a function that is comprised of solutions from both NDSolve and NIntegrate versus one of the function's parameters (g). I am receiving several errors and was wondering if anyone could help me or tell me what I am trying is even possible.

Thank you,

Alex

Attachments:
POSTED BY: Alex L
Answer
5 Replies

You give no value to g.

Posted 6 months ago

g is the parameter. I am hoping to plot the function against.

POSTED BY: Alex L
Answer
Posted 6 months ago

Numerical solutions require numerical input so g has to have a numerical value. You can try using DSolve to get an analytic solution.

As said NDSolve needs g to be a number.

so define a function around your code that takes g as input.

Then run the code for various values of g ( using plot with long evaluating functions usually gives problems).

Then return your plots and plot the function as a function of g.

enter image description here

Attachments:
Posted 6 months ago

Thank you so much!

POSTED BY: Alex L
Answer
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