07-27-2016 07:47 AM
Hello,
I wrote this small code to visualise the oscillation of BZ reaction. I expect to see oscillation like in the page 3 and 7 of the link below
http://home2.fvcc.edu/~dhicketh/DiffEqns/spring2014projects/SilasSchwarz/Final/Final/bzreaction.pdf
This work is done in Matlab and I would like to reproduce it in Labview with the same parameters. But so far I couldn't see the oscillation.
Could anybody body spot what is wrong in this code?
Cheers,
Zied
Solved! Go to Solution.
07-27-2016 08:59 AM
You're not using a differential equations solver. You're using a calculator. I would recommend you look under Mathematics -> Differential Equations -> Ordinary Differential Equations -> ODE Solver.vi
It has an implementation of the "ode45" algorithm that's popularly used in Matlab.
07-27-2016 10:02 AM
Hi,
I followed the tutorial in Labview using the control and simulation module. The calculators are just to simplify the code but I am using the integrators. I think it can work in this way according to the tutorial below.
The ODE under mathematics seems more complicated and less user friendly.
07-27-2016 10:46 AM - edited 07-27-2016 10:47 AM
I'd say they're no less friendly, just less fancy looking. Here's a VI that solves your ode and plots it as in that article.
07-28-2016 03:35 AM
Thank you very much Ilovemath.
I run your ODE but I couldn't see the oscillations like in page 7 of the document attached above.
And the graph I get reminded me of the graph I obtained with the first version of the VI I built with the control and simulation module with explicit math operations and not the formulas.
I attached here.
Thanks,
Zied
07-28-2016 09:43 AM
I did notice that, but didn't have time yesterday to look into it. I implemented their matlab scripts and it turns out the constants they give; e , e' and q are actually 10^-n and not 10^n. A typo in a student paper, how rare 🙂 Once I changed this I got the correct plot as seen here:
Attached the VI. It runs much slower than in Matlab, so be warned.
07-28-2016 10:57 AM
Perfect. Now I have 2 ways to do it. Ilovemath, you are amazing. I wish I could give you more kudos.
Thanks,
Zied
07-28-2016 01:10 PM
No problem! Does the way I set it up make enough sense that you could do this in the future with other ODEs?
07-29-2016 10:54 AM - edited 07-29-2016 10:55 AM
Hi again,
Indeed, your method is straightforward. I just need to copy paste my equations and variables.
1- I would like to ask you about the ODE solvers. I noticed that each time I change the solver, I get a different graph ( it is still oscillating BTW).
I think it should be one that is correct and the others are wrong.
I checked in the litterature and I found that the authors confirm that for the model I am using the Runge-Kutta (4,5) algorithm fails to solve the system of differential Equations and that the model is too stiff and highly dependant of the initial conditions.
Also they recommend the use of the multi-stage Adomian decomposition method (MADM) or just the ADM to give reliable result. Un fortunately I could't find in Labview.
Do you have any suggestion to add it?
2- I am trying to avoid using external software but maybe the unique solution is to use a solver from Matlab through the mathscript.
3- I would like also to ask whether it is possible to get the analytical formula of the integrated model (ie. in my case x(t)=...or y(t)) instead of just a graph because I plan to feed back control the model (the frequency or the chaos) and it is likely to be easier to tweak a formula than a curve.
4- As I said earlier, I would like to study the chaotic behaviour of some models. As a mathematician, do you think that ODE can be used to describe this kind of phenomena?
I hope I didn't not exagerate of asking many questions at once.
Cheers,
Zied
07-29-2016 11:15 AM - edited 07-29-2016 11:16 AM