Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.1K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to use FindRoot output as input to NDSolve for 1st order DFEQ?

Posted 10 years ago
POSTED BY: Robert Curl
5 Replies

Dear Mr. Clarke,

It works like a charm!

Thank you,

Bob Curl

POSTED BY: Robert Curl

Please see this article:

http://support.wolfram.com/kb/12502

for an explanation of why ?NumericQ had to be added

POSTED BY: Sean Clarke
POSTED BY: Daniel Lichtblau

Thank you for your reply Mr. Lichtblau. I apologize for all the mistakes. I will follow up on your suggestions and post the complete code in the future. In the meantime, I have managed to get the program to work by setting up a grid of values of y[x] and x using FindRoot to populate the grid with values g and then create a 2D InterpolatingFunction . I replace the g function that calls FindRoot directly by the InterpolatingFunction. It feels like a kluge to me, but it works.

POSTED BY: Robert Curl

THe code above will of course not run as given (no definition for h). Also there is a typ0 {g.g0} where certainly you want a comma separator {g,g0}. The upshot is I cannot replicate the actual issue. I will take a guess that first you need to make g into a function that only exists for explicitly numeric input. That can be done as below.

g[x_?NumberQ, y_?NumberQ] = ...

There seem to be other issues (e.g. g does not seem to be a variablebut rather a function). Really you should post with full input to replicate the problem; this is simply too confused as it stands.

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