Skip to main content
10-Marble
April 7, 2014
Solved

Backsolving for variable(s) is it possible using MathCad Solve Blocks?

  • April 7, 2014
  • 1 reply
  • 3117 views

I have written with Werner's help a reasonably complicated worksheet which solves a coupled ODEs within a solve block. The ODEs are themselves nested functions. To get the answer I desire it normally take many runs because the output functions are dependant on many input variables. I have read that a competing product TKSolver can do backsolving for the input variables in order to achieve a desired output function which describes the goal. I have looked at making the ODE solve block into a function and passing back the initial conditions but that is not what is desired because the nested functions are "bound up" as part of the ODE definition.

What is needed is some way of defining a goal output within the solve block and somehow (maybe via external program control) changing the input variables to achieve that goal. The goal in my case is just one variable but it is a dependant on other variables particularly height which the coupled ODE is solves for. I have seen examples in the forum where ODEs can be functions but usually they have discrete parameters within the ODE which can be changed by passing the changed function parameters back to the ODE and then recalculating the solve block. In my case the ODE functions within the solve block are complex i.e. (have no separable discrete parameters) as all input parameters are defined outside the solve block. Obviously the ODE equations are dependant on those inputs but as I see it one can not changes those inputs in a dynamic sense to arrive at a revised output to achieve the desired goal. My question is has someone achieve what I am describing by using MathCad. Indeed can it be done with MathCad and if so has someone an example worksheet that they are willing to share, from which I can discern the methodology that has been used to achieve that end. If it is possible would this make the ODE very unstable i.e. "hunt" or is there a way to avoid such a situation?

Kind regards, Mark

Best answer by Werner_E

Played around a bit I and guess that with the data and equations given there will be no solution. QScout seems to never get as high as 6.4 L/s. At least not with values of Y the odesolveblock will like, as it fails for higher values of Y. Look at the attached - the graph for Qscout looks a bit strange to me.

1 reply

19-Tanzanite
April 8, 2014

Attached is a simple projectile program that changes the input variable to alter the solution obtained from an ODE solve block to meet a specified target output (It's in MC15 format I'm afraid, as I don't have Prime 3). It's possible this might point you in the right direction. However, I can't tell if this is really what you are looking for without seeing the detail of your problem.

Alan

10-Marble
April 8, 2014

Alan;

Even this "simple" example is somewhat mind bending to me at least. I think I know what you are doing but how you worked out the form of these functions and how they actually produce output is impressive. I will see if I can do something similar with my example but if I fail I may need further help.

Thank you, Mark

19-Tanzanite
April 8, 2014

Mark Buckton wrote:

Alan;

Even this "simple" example is somewhat mind bending to me at least. I think I know what you are doing but how you worked out the form of these functions and how they actually produce output is impressive. I will see if I can do something similar with my example but if I fail I may need further help.

Thank you, Mark

I've attached the same problem, but with a few more words of explanation, which might help.

Alan

Edit: Slightly improved file