Skip to main content
1-Visitor
July 26, 2010
Question

solving second order ODE more efficiently

  • July 26, 2010
  • 3 replies
  • 6723 views

Hello,

I have got a linear set of two ordinary differential equations of second order with two unknowns. The starting conditions are known. However, depending on the result an external disturbance must be considered. Once this disturbance occurs the same equations hold but at the time of the disturbance, new inital conditions depending on the previously calculated solution, must be considered.

Currently, I have managed to solve this problem by setting up a first mathcad sheet for the interval from the start till the the first external disturbance. I have also created a second mathcad sheet for the second interval from after the first disturbance to the second disturbance. And so on.

Unfortunately, I have to consider many disturbances and not just a few. As I would like to perform a parameter studies, I suppose my current approach is not suitable. I am currently using MATHCAD 14 and have only used ODESOLVE to solve my problem so far. If anybody has an idea as how my problem could be implemented in MATHCAD more efficiently, kindly let me know. Thanking you in advance for any help in this regard.

Thank you.

3 replies

1-Visitor
July 29, 2010

Make an image of the system, attach in the forum. Your description impacts as if some components of the system is subjected to "non-linear" parameters. Odesolve is valid for DE's with non linear coefficients. At least it is for a large class of known variable coefficients DE's. From what you are saying, you know what value at each step, which in your description it corresponds to recasting the system. Don't be short of an abstract, a very descriptive abstract.

jmG

1-Visitor
July 29, 2010

Hello,

Thank you for your reply. I have attached my worksheet and would also like to state some details for your reference. First I have obtained a free decay response and from that I have to determine the new initial conditions. The value of x2(t) must be either +/- 2 in this case. From the plot I pick the time point where x2 reaches the value of 2(+/-). I have done this each time seperately as it is just two times that we obtain the value of x2=+/- 2 after which it decreases.I would like to know in case where x2 reaches +/- 2 a number of times, is it possible to write a program that will do the same calculation esily instead of calculating the IC seperately each time. I would also like to know if its better to do the same using a programming language like C++ or Fortran or so. As I am not familiar with MATH CAD, any help in this regard will be highly appreciable. If you need further information regarding the problem, please let me know.Thank you once again.

regards,

Nandita Nanjappa.

1-Visitor
July 29, 2010

Mathcad 11 can't read your work sheet. I don't understand why you have to recalculate initial conditions so many times and past a certain behaviour the IC's aren'r needed anymore. The project looks like the bouncing ball project. It has a solution without solving DE.

jmG

1-Visitor
July 30, 2010

Sounds like you want to set up your ODESolve as a function, with the initial conditions and the integration range as variables. Then you can write loop that runs through the disturbances and integrates from one disturbance to the next.

1-Visitor
July 30, 2010

Hello,

Thank you very much for your reply. I wanted to use a similar approach to solve my problem but as I aam not very experienced with MATHCAD, it would be really nice if you could give me an idea or some examples as to how I could write the program. Thank you in advance for your help.

Regards,

Nandita.

1-Visitor
July 30, 2010

Look up the neon bulb oscillator sheet (might be only in the collaboratory -- not everything was copied over here). It shows integrating a system with multiple states.

1-Visitor
July 31, 2010

What I did in sequence:

1 plug the bouncing ball

2. clean and move your graphs

3. crash

4. crashcrashcrash etc.

So, after so many crashes: end of it.

While cleaning, I could visualize but can't do anything . Must understand first what you are trying to do, but you have no abstract. Whether possible or not to set the system recursive , don't know. PTC Mathcad aren't saving in lower version at all, otherwise they would either come red or work. Crashing is the absolute indication of incompatibility. If your system makes sense, it might then have another form. That in a DE system the IC's have to "update" . that's rather unusual . You need to solve the system only once based on the last IC's but how to arrive at the last IC"s ? Maybe a 2d boundary system.

jmG

1-Visitor
August 11, 2010

Hello,

I have tried to program the loop for re-solving the ODE with newly calculated initial conditions for atleast 5 impacts. The program llop has some missing information or a major error as I know I haven`t programmed it correctly. If somebody could check the program and help me modify it, I will be extremely grateful. If you have further questions, please let me know.Any help in this regard will be highly appreciable. Thanking you in advance for your help.

P.S: I have attached the file as both MATHCAD 14 and 11 compatible versions. For MATHCAD 11, i just saved the file as a MATHCAD 11 version using MATHCAD 14 as that`s the only version i have. I hope it works now. If there is an alternative way I could do it then please let me know.

1-Visitor
August 11, 2010

All red in 11. It does not take definition [ ...:=] in the sole block.

Trying to make it work 11 and if you use 14 is incoherent.

You don't have enough project description to evaluate if your

approach applies. In some ways it looks like the "Advection".

jmG