cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Programming a ODE solution

Newbie

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 6

Re: Programming a ODE solution

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.

Re: Programming a ODE solution

Needs to be done as in the attached.

Alan

Re: Programming a ODE solution

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.

Re: Programming a ODE solution

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?

Re: Programming a ODE solution

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!

Re: Programming a ODE solution

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.

Announcements