LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to vary coefficients in F(x,y) box of Runge-kutta, for each time I run.

In Runge Kutta, we are given a F(x,y) array of stings to write right side of equation. But my problem is I have coefficients that I want to vary, and thus have just one control to change value in each equation. How would F(x,y) box know the value of these coefficients?
These are the equations
dC(3) = 1/vg*(W*Koh - Ku_oh*C(1)*C(3) - Ks_oh*C(2)*C(3) - Koh_oh*C(3)^2);
dC(1) = 1/vg*(-Ku_oh*C(1)*C(3));
dC(2) = 1/vg*(A1*Ku_oh*C(1)*C(3) - Ks_oh*C(2)*C(3) - (Ds/r^2)*(C(2) - C(6)/Hs));
dC(4) = 1/vg*(Ko3*W - (Do3/r^2)*(C(4) - C(5)/Ho3) - Ko3_o3*C(4)^2);
dC(5) = 1/vw*((Do3/r^2)*(C(4) - C(5)/Ho3) - Ksl_o3l*C(
6)*C(5) - Ko3l_o3l*C(5)^2);
dC(6) = 1/vw*((Ds/r^2)*(C(2) - C(6)/Hs) - A2*Ksl_o3l*C(6)*C(5));

Where Ks', Ds', Hs' and As' have constant value for each run. So how can i have centralized control on these coefficients, and still use runge kutta.
Download All
0 Kudos
Message 1 of 5
(2,962 Views)
I recommend breaking out the string parsing VIs. The idea is that you can search and replace each formula string and replace constants with fixed values. It will be a tricky bit of coding (nested for loops--fancy text searches) but it should do the job.

Good luck with your project!
0 Kudos
Message 2 of 5
(2,962 Views)
Thanks Jeremy

Well I quite didn't get ur solution. How can I break the string and pass it.

Can u explain it to me in somewhat detail.

I appreciate ur help.

Thanks

Regards

Ankit
0 Kudos
Message 3 of 5
(2,962 Views)
Here are the beginning to the edits. It is enough to get the idea. You should extend the coding to include all the variables. Care should be taken with the variable names so that you are searching for a variable named V it does not replace a variable named VM to get [stuff]M .
0 Kudos
Message 4 of 5
(2,962 Views)
Thanks Jeremy

But I do not ahve LABVIEW 7 and so am not able to see it.

If u can just save it as LABVIEW 6 file and post it.

Thanks
0 Kudos
Message 5 of 5
(2,962 Views)