Skip to main content
1-Visitor
February 26, 2016
Solved

Definition of solve block as function

  • February 26, 2016
  • 5 replies
  • 2237 views

Hi all,

I have been using  MathCad Prime 3.1 for some weeks: I recently implemented a solve block in which I defined a system of ODEs with guess values and initial conditions: the solution is calculated via "odesolve" function. Since I need to have the time and initial conditions as parameters, I was wondering how to define the solve block as a function, in order to recall it wherever within my worksheet.

Does anyone know how to do this?

Thanks a lot!

Domenico

Best answer by AlanStevens

Here's a simpler version than Stuart's, but uses Prime (actually Prime 2, but should be the same in 3.1):

ode.PNG

Alan

5 replies

23-Emerald V
February 26, 2016

Domenico Cavaiuolo wrote:

Hi all,

I have been using  MathCad Prime 3.1 for some weeks: I recently implemented a solve block in which I defined a system of ODEs with guess values and initial conditions: the solution is calculated via "odesolve" function. Since I need to have the time and initial conditions as parameters, I was wondering how to define the solve block as a function, in order to recall it wherever within my worksheet.

Does anyone know how to do this?

I haven't got Prime available on my current PC, but I think the same thing as shown below should work in Prime 3.1.  Import the M15 worksheet to see if it does!  Essentially, you define another function (that takes the time and initial conditions as arguments) that executes the solve block, and then call that function to solve the ODE system.

Stuart

1-Visitor
February 26, 2016

Perfect, it works! I chose Alan's anwers since it's more relevant to topic discussion on MathCad Prime .

Thank you for your feedback.

Domenico

19-Tanzanite
February 26, 2016

Here's a simpler version than Stuart's, but uses Prime (actually Prime 2, but should be the same in 3.1):

ode.PNG

Alan

1-Visitor
February 26, 2016

Thank you Alan for the feedback!

Domenico

24-Ruby IV
February 26, 2016

Sorry.

Late but see an attach