Group Abstract Group Abstract

Message Boards Message Boards

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

Problem with NDSolve

Posted 12 years ago
5 Replies
Posted 12 years ago

In your code

In[52]:= ?ttf

Global`ttf

ttf[x_,r_,t_]=298

you have defined your ttf function to have the value 298, no matter what the values of x, r or t have.

Then in your NDSolve you use your ttf function in your system of equations

enf1 = NDSolve[{... ttf[0, r, t] == tme, ...}, ...]

and 298==373 will always be false.

I do not think this is a question of using or not using NumericQ. I think this is a misunderstanding of what you want your ttf function to be. I cannot guess from what you have shown what it is that you are trying to do or what the solution should be.

POSTED BY: Bill Simpson

You are right. It should be tf, not ttf. I'll correct this. Thanks!

Doing

?NumericQ[tmed1]

, the output is

False

What is the smart way to solve this? I don't know.

Posted 12 years ago

If I scrape his code, paste it into a notebook, restore all the missing \ in front of his [Rho], [Alpha], etc, (which I've noticed get eaten by the posting software if I attempt to do any editing of a previous post, it would be very very nice if the editing process would not do that), check the results of each step for any obvious warning signs and peek at the system that he will give to NDSolve to find enf1 the second time, just before I actually try that NDSolve, then I notice one of his items in that system is

In[50]:= ttf[0, r, t] == tme

Out[50]= False

Giving NDSolve a system that includes False as one of the items would be the first thing I would look at if I were trying to figure out why it wasn't working.

POSTED BY: Bill Simpson

You should try isolate your problem to a minimum amount of code. People usually do not have time to go through that much of code with so many definitions.

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