tutorials:spectral-light-modeling-architecture
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:spectral-light-modeling-architecture [2025/05/28 16:18] – barley1965 | tutorials:spectral-light-modeling-architecture [2025/06/01 17:45] (current) – barley1965 | ||
---|---|---|---|
Line 42: | Line 42: | ||
</ | </ | ||
- | You can see in the commented block that we have already used several lamps. You can do the same: change the composition of lamps as you like, save the code file, and then on //Render View// -> //Flux renderer//, to see the color combination. You may then click on the '' | + | You can see in the commented block that we have already used several lamps. You can do the same: change the composition of lamps as you like, save the code file, and then on //Render View// -> //Flux renderer//, to see the color combination. |
+ | |||
+ | {{: | ||
+ | |||
+ | You may then click on the '' | ||
+ | |||
+ | <code java> | ||
+ | module Leaf (int ID, super.length, | ||
+ | Measurement ms, float rfr, float absred, float absfarred, | ||
+ | float absblue, float as) extends Box(length, width, 0.01){ | ||
+ | { | ||
+ | Phong myShader = new Phong(); | ||
+ | myShader.setDiffuse(reflectionSPD); | ||
+ | myShader.setDiffuseTransparency(transmissionSPD); | ||
+ | // | ||
+ | setShader(new AlgorithmSwitchShader(new RGBAShader(0, | ||
+ | |||
+ | float getSurface() | ||
+ | { | ||
+ | float SCF = 1000; | ||
+ | return this.length*this.width*SCF; | ||
+ | } | ||
+ | }; | ||
+ | </ | ||
- | We note that Leaf has a lot of parameters apart from its length and width, the absorbed light al and the amount of assimilates as: We will come back to that later. Let’s first of all explore the shader of the leaf, it’s called a Phong shader, named after the researcher who worked on this topic. Using such a Phong shader allows you to specify spectra for reflection and transmission (methods setDiffuse() and setDiffuseTransparency()). The arguments for these methods are two arrays with numbers containing the amount of light reflected and transmitted per waveband, based on measurements using a spectrophotometer). The two arrays can be found at the very end of Parameter.rgg (they are in fact curves that are constructed with the static statement in L. 397-401 using data from other arrays (L. 257ff). | + | We note that '' |
- | Back to the definition of the Leaf module: you note that one of its parameters is called ms and it’s of a type we’ve never seen before: Measurement. Let’s see how this is used: go to Main.rgg, L. 63. Here we see in the method absorbAndGrow() that the parameter ms of Leaf is updated: | + | |
- | + | Back to the definition of the Leaf module: you note that one of its parameters is called | |
- | A “measurement” is in fact a data table, in which the absorbed spectrum is stored, one measurement per wavelength. This is done by an extended light model called FluxLightModel. A spectral measurement can now be used in several ways: we can output the data to a graph and display the absorbed spectrum as is done in L. 140 of Main.rgg. Or we can pick specific wavelengths such as the peaks of absorbed blue (450 nm), red (630 nm), and far red (760 nm) and store them in the previously defined variables absblue, absred and absfarred (L. 132 – 134). | + | |
- | It is then quite easy to calculate the red/far red ratio (L. 135), which is another one of the variables of Leaf. | + | <code java> |
- | The R/FR ratio is translated within the plant into an equilibrium ratio of two forms of phytochromes Pr and Pfr. This is not a linear relation; therefore we need to employ another function that we called calcPhytochrome(), | + | lf[ms] = lm.getAbsorbedPowerMeasurement(lf); |
+ | </code> | ||
+ | A '' | ||
+ | |||
+ | <code java> | ||
+ | lf[absblue] = lf[ms].data[19]; | ||
+ | lf[absred] = lf[ms].data[86]; | ||
+ | lf[absfarred] = 0.0001 + lf[ms].data[135]; | ||
+ | </ | ||
+ | |||
+ | It is then quite easy to calculate the red/far red ratio (L. 135), which is another one of the variables of Leaf. | ||
+ | |||
+ | <code java> | ||
+ | lf[rfr] = lf[absred]/ | ||
+ | </ | ||
+ | |||
+ | The R/FR ratio is translated within the plant into an equilibrium ratio of two forms of phytochromes Pr and Pfr. This is not a linear relation; therefore we need to employ another function that we called '' | ||
+ | |||
+ | <code java> | ||
+ | public static double calcPhytochrome(float rfr) | ||
+ | { | ||
+ | double phi = 0; | ||
+ | double Zpfr = 1.7; | ||
+ | double phiR = 0.75; | ||
+ | double phiFR = 0.03; | ||
+ | return phi = 1 - (rfr + Zpfr) / ( (rfr/ | ||
+ | } | ||
+ | </ | ||
+ | |||
The function basically defines the response curve of phytochrome ratio to R/FR. You can see the dynamic output in the graphs “Red/Far red ratio” and “Phytochrome ratio”. | The function basically defines the response curve of phytochrome ratio to R/FR. You can see the dynamic output in the graphs “Red/Far red ratio” and “Phytochrome ratio”. | ||
- | What is the effect of different wavelengths on plant morphology? There are several, but it is known that a low R/FR will enhance internode length and leaf surface, and that blue light will have the opposite effect. Also, blue light will have a delaying effect on the phyllochrone. We have added a number of functions to this effect, that will modify the parameters of the logistic growth function for internodes and leaves, as a function of R/Fr and absorbed blue light (methods “maxlength”, | + | |
+ | {{: | ||
+ | |||
+ | |||
+ | What is the effect of different wavelengths on plant morphology? There are several, but it is known that a low R/FR will enhance internode length and leaf surface, and that blue light will have the opposite effect. Also, blue light will have a delaying effect on the phyllochrone. We have added a number of functions to this effect, that will modify the parameters of the logistic growth function for internodes and leaves, as a function of R/Fr and absorbed blue light (methods “maxlength”, | ||
+ | |||
+ | <code java> | ||
+ | public static double maxlength(float absblue, float rfr) | ||
+ | { | ||
+ | float residual = 0.15; | ||
+ | float phi = calcPhytochrome(rfr); | ||
+ | float ml = residual + (Math.exp(-phi-25*absblue)); | ||
+ | return ml; | ||
+ | } | ||
+ | |||
+ | public static double intslope(float absblue, float rfr) | ||
+ | { | ||
+ | float residual = 0.01; | ||
+ | float phi = calcPhytochrome(rfr); | ||
+ | float isl = residual + 0.1*Math.exp(-phi-25*absblue); | ||
+ | // | ||
+ | return isl; | ||
+ | } | ||
+ | |||
+ | public static int phyllochron(int rank, int id) | ||
+ | { | ||
+ | if(rank> | ||
+ | float phi = calcPhytochrome(lef[rfr]); | ||
+ | return (int) (28 + 8*Math.exp(-10*lef[absblue]+2*phi)); | ||
+ | else { return 28;} | ||
+ | } | ||
+ | </ | ||
Tasks: | Tasks: | ||
1) Run the model with different lamp configurations! Observe the effect on internode length and leaf surface dynamics! | 1) Run the model with different lamp configurations! Observe the effect on internode length and leaf surface dynamics! | ||
- | 2) Run the model for a number of steps, then move a lamp*, or change its power output! You can also add a Sky light source but beware that this has a dramatic effect on the R/FR ratio (hint! To prevent this, you have to increase the power output of the two far red lamps as it currently is too low). Once you have added a Sky light, you can also have a look at the Photosynthesis rate dynamics (for some reason, the light output of the LED lamps alone is a bit too low). | + | |
- | 3) Open the Excel file Spectre.xlsx and inspect the way the relation between absorbed blue and rfr and slope/ | + | 2) Run the model for a number of steps, then move a lamp<sup>*</ |
+ | |||
+ | 3) Open the Excel file {{tutorials: | ||
4) Currently we have only one plant in the scene: go to Parameters.rgg, | 4) Currently we have only one plant in the scene: go to Parameters.rgg, | ||
- | *to move a lamp, you can click on its tip and then drag the lamp into one direction (x, y z) by clicking, holding and moving one of the three arrowheads. If selection in the scene doesn’t work you can try finding the lamp using the Flat Object Inspector window that is already open in your model: | + | |
+ | ''< | ||
| | ||
tutorials/spectral-light-modeling-architecture.1748441887.txt.gz · Last modified: 2025/05/28 16:18 by barley1965