Skip to main content
1-Visitor
Aug 25, 2014 1:37 AM UTC
Question

Programming a ODE solution

I am trying to program a solution to an ODE but I get the message that no "givn found to solve this block". Please tell me where I have gone wrong. I am a beginner in programming. I have attached a file containing the program to solve an ODE. If this succeeds I have a more complicated program involving loops and if statements.

6 replies

Werner_E
25-Diamond I
Aug 25, 2014 7:16 AM UTC

You can't use a solve block inside a program like you did!

In case your intention was to use con as an argument to your program - you can turn a solve block into a function, too. See attachment.

Translate
nvsuryan1-VisitorAuthor
1-Visitor
Aug 26, 2014 12:25 AM UTC

My question is can I have a solve block in a programming block. I have solved the ODE but I am trying an interative process to find the value of the constant with a program similar to the one I sent but has more for loops.

Translate
Werner_E
25-Diamond I
Aug 26, 2014 12:52 AM UTC

Narasipur Suryanarayana wrote:

My question is can I have a solve block in a programming block.

As already said - no. But you can turn the solve block into a function like I showed and call that function from within a program.

I have solved the ODE but I am trying an interative process to find the value of the constant with a program similar to the one I sent but has more for loops.

More loops? I havent seen a single loop in th program you sent. All your program would do is to solve the ODE and evaluate one of the function for argument 10.

Translate
19-Tanzanite
Aug 25, 2014 7:18 AM UTC

Needs to be done as in the attached.

Alan

Translate
nvsuryan1-VisitorAuthor
1-Visitor
Aug 26, 2014 12:31 AM UTC

Mr. Werner Exinger answered my question and confirmed that a solve block cannot be used in programming. If I need to solve the ODE with different initial conditions is there any way that I can automate to computations?

Translate
Werner_E
25-Diamond I
Aug 26, 2014 12:48 AM UTC

Narasipur Suryanarayana wrote:

Mr. Werner Exinger answered my question and confirmed that a solve block cannot be used in programming. If I need to solve the ODE with different initial conditions is there any way that I can automate to computations?

Sure, and Alan and me, we have both shown how to do that in your sheets!

Translate