Message Boards Message Boards

Plotting an NDSolve solution as a function of a parameter?

Posted 3 years ago

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
5 Replies

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 BY: Martijn Froeling

You give no value to g.

POSTED BY: Gianluca Gorni
Posted 3 years ago

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

POSTED BY: Alex L
Posted 3 years ago

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

POSTED BY: Rohit Namjoshi
Posted 3 years ago

Thank you so much!

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