text:
## Introduction

Food allergies are immune-mediated adverse responses triggered by the inhalation or ingestion of proteins in specific foods1,2,3. The incidence and prevalence rates of food allergies have increased in recent decades, posing a global health problem. Allergens can cause not only acute allergic reactions, such as skin (hives), respiratory tract (wheezing, coughing), and gastrointestinal tract (nausea, vomiting, and diarrhea), but also critical conditions, such as anaphylaxis4,5. At present, food allergen labeling is mandatory and legislated in many countries. In Japan, food allergen labeling regulations have been adopted for processed foods containing seven specific raw materials, including wheat, buckwheat, peanut, egg, milk, shrimp, and crab. The guidelines stipulate that any foods containing allergenic proteins must be labeled if the concentration exceeds 10 mg/kg (ppm)6. For food-allergic consumers, even a tiny quantity of an allergen can induce an allergic reaction7. Therefore, the rapid and easy identification of processed foods accidentally contaminated with allergenic substances is crucial for risk management strategies in the food processing industry to effectively prevent food allergy incidents.

Many methods for detecting various food allergens have been assessed8. The enzyme-linked immunosorbent assay (ELISA) is widely used for the quantitative analysis of targeted proteins owing to its advantages of high sensitivity, high specificity, ease of use, and high sample throughput. Accordingly, it is one of the most commonly used assays for detecting and quantifying food allergens in the food industry and in official food control agencies9,10. Several ELISA-based immunodiagnostic test kits are commercially available for the detection of food allergens11,12,13. However, proteins are susceptible to unintended proteolytic degradation during the extraction processes used in protein-based detection methods, which can cause false-negative results, and complex food matrices can contain interfering organic components, which may give rise to false positives14,15. Because DNA molecules are more stable than proteins, nucleic acid-based detection methods, among which the real-time quantitative polymerase chain reaction (qPCR) is the most widely used method for amplifying specific nucleic acid (DNA/RNA) targets, are increasingly used in food allergen detection16,17,18,19. However, qPCR testing requires highly trained personnel and expensive equipment (i.e., a thermal cycler) with precise temperature setpoint control for amplification and therefore is not a cost-effective and easy-to-use detection tool.

Loop-mediated isothermal amplification (LAMP) has been recognized as an alternative to qPCR for on-site detection without requiring specialized equipment20,21. The LAMP assay, in which a set of four to six specifically designed LAMP primers and Bst DNA polymerase with high strand-displacement activity are used to amplify a specific DNA target, can be performed in 30–60 min under isothermal conditions (60–65 °C)22,23. Various methods for detecting LAMP amplification products are available, such as visualization of the amplification products through traditional gel electrophoresis post amplification, real-time measurement of the turbidity caused by the magnesium pyrophosphate that is produced as a reaction byproduct, and real-time detection of the LAMP amplicons using an intercalating fluorescent dye (e.g., SYBR Green I). In addition, naked-eye colorimetric detection by using indicator dyes is possible. For example, phenol red is a pH-sensitive indicator dye used to monitor significant pH changes from alkaline to acidic associated with the LAMP reaction and hydroxynaphthol blue (HNB) is a metal indicator dye used to monitor a rapid decrease in the concentration of free Mg2+ ions owing to the formation of insoluble magnesium pyrophosphate during DNA amplification24,25,26. However, there are fundamental issues with the conventional LAMP method that remain to be solved for its application in the on-site multiplexed diagnostics of multiple food allergens. That is, it is necessary to prepare and individually test many sample/reagent mixtures for each food allergen target. This procedure requires not only long and tedious sample preparation to yield a test result, but also a relatively large amount of LAMP reagents, generally, 10–25 µL for testing a single food allergen. To address these concerns, Lab-on-a-chip technologies have considerable potential for enabling multiplexed LAMP assays in microfluidic devices for the simultaneous detection of targeted nucleic acids in a single operation27,28,29,30,31,32,33,34.

In our previous studies35,36,37, we developed a versatile microfluidic device for the multiplexed detection of targeted nucleic acids based on the LAMP method. The microfluidic device allows sequential dispensing of sample/reagent mixtures into an array of reaction microchambers with a single operation, thus possibly providing a platform for rapid and easy sample-to-answer diagnostics. With the aim to minimize crop losses and to ensure a stable supply of affordable food in agriculture, we demonstrated the ability of the fabricated diagnostic device to detect not only a DNA plant virus infecting tomato, but simultaneously also four RNA plant viruses infecting cucurbits within 60 min35. In addition, we demonstrated that the toxic plant Colchicum autumnale could be detected within 60 min to provide a reliable screening method for plant poisoning in emergency medical care36. Moreover, we can simultaneously diagnose coronavirus disease and other infectious diseases, including those caused by severe acute respiratory syndrome, seasonal influenza A, and pandemic influenza A 2009, by running a colorimetric reverse transcription LAMP assay for 30 min using our microfluidic device37. However, in the sequential liquid dispensing method previously proposed, the maximal allowable flow rate for dispensing multiple microchambers is limited by an increase in the flow resistance, which increases in proportion to not only the flow rate, but also the number of microchambers filled. In this study, we designed a new valve configuration to be used as a permanent stop valve (hereinafter referred to as an “air plug-in valve”) in the microfluidic diagnostic device with the aim of significantly improving the performance of sequential liquid dispensing into an array of reaction microchambers. The most distinctive feature of the air plug-in valve proposed here is that the liquids reaching a set of two passive valves push against each other through the air plug, resulting in high pressure resistance performance because the applied pressure is offset. Using an optimally designed microfluidic device with 10 microchambers arranged in a circle, we demonstrate the simultaneous detection of three food allergens based on specific DNA targets of wheat (Triticum aestivum), buckwheat (Fagopyrum esculentum), and peanut (Arachis hypogaea).

## Methods

### Fabrication process of the multiplexed diagnostic device

We developed a fabrication process of a polydimethylsiloxane (PDMS)-based microfluidic device employed for multiplexed genetic detection, combining a soft lithography process and a wax reflow process38. Figure 1a shows an example of the fabricated microfluidic device (with a size of 50 mm × 25 mm) consisting of two main parts: a mixing region and a dispensing region, which also serve as the reaction and detection regions. Five microchambers in an array are interconnected via two independent rectangular microchannels (200 µm in width and 50 µm in height) for introducing the liquid into the microchambers and for exhausting the air in the microchambers, respectively.

The fabrication process used can be briefly described as follows: first, a negative thick photoresist (SU-8 3050; MicroChem, Newton, MA, USA) was patterned on a 4-inch single-crystal silicon wafer (e-Prize, Yokohama, Japan) as a mold in a single-step photolithography process. Next, to create deep localized microchamber structures (max. 1 mm in depth), the SU-8 mold and pieces of wax of 2.7 mg (Ferris File-A-Wax; Freeman Manufacturing & Supply, Avon, OH, USA) were simultaneously subjected to a low-pressure air plasma surface treatment in a plasma asher (JPA300; J-Science Lab, Kyoto, Japan) at a power of 150 W for 2 min. Then, the pieces of wax were placed in the center of the top surface of each SU-8 chamber pattern (Fig. 1b). Subsequently, a reflow process was conducted by heating the mold containing the wax pieces on a hotplate at 135 °C for 3 min (EC1200-N; AS ONE, Osaka, Japan). After cooling down to room temperature, semi-ellipse-shaped chamber molds with a uniform shape were obtained because of the surface tension of the molten wax (Fig. 1c). It should be noted that the plasma surface treatment of the SU-8 mold and the pieces of wax before the reflow process remarkably improved the adhesion strength between them, probably due to the removal of surface contaminations. Subsequently, the SU-8 master mold with the semielliptical wax structures was replicated in PDMS (Silpot 184; Dow Corning Toray, Tokyo, Japan) after curing on a hot plate at 80 °C for 40 min. After peeling off the PDMS from the SU-8 master mold, circular holes (with a diameter of 1.0 mm) for one inlet and two outlet ports were punched into the PDMS microfluidic device using a biopsy punch piercing tool (Kai Industries, Gifu, Japan). Finally, both the microchambers and microchannels were sealed with a white polyvinyl chloride (PVC) sheet (EB-235; Hikari, Osaka, Japan) using a silicone-based adhesive double-sided tape (No. 5303 W; Nitto Denko, Osaka, Japan). Figure 1d shows images of a PMDS microchamber acquired with a scanning electron microscope (S-3000 N; Hitachi High-Tech, Tokyo, Japan). A three-dimensional (3D) PDMS microchamber with an extremely smooth curved surface was obtained. A 3D image and cross-sectional profiles of the PDMS microchamber acquired with a digital microscope (VHX-7000; Keyence, Osaka, Japan) revealed that the maximum depth of the semielliptical PDMS microchamber was approximately 1 mm, the expected design value (Fig. 1e).

In this study, microfluidic devices with 10 microchambers arranged in a single row or in a circle were also fabricated by the same process. Additionally, to investigate the effect of air leakage at the interface of the PDMS device and the silicone-based adhesive double-sided tape, we prepared a modified PDMS device that was covalently bonded to a thin PDMS layer spin-coated on a 4-inch glass wafer (AS-4; Toshin Riko, Tokyo, Japan) by air plasma surface treatment. In experiments, a syringe pump (YSP-201; YMC, Kyoto, Japan) or a pressure-driven micropump (Flow EZ 7000 mbar, Fluigent SA, Le Kremlin-Bicêtre, France) equipped with a flow sensor (Flow Unit, Fluigent SA) were used to introduce the liquid in the devices. A smartphone camera was used to capture video images of the sequential liquid dispensing process into multiple microchambers and photographs of multiple microchambers to analyze color change after LAMP assays.

### Theory for sequential liquid dispensing

In our previous study37, we introduced a method of sequential liquid dispensing into multiple reaction microchambers by controlling the burst pressures in a pair of passive stop valves integrated in each microchamber (Fig. 2). In brief, the dispensing procedure was as follows: first, the flow of liquid stops after it reaches the passive stop valve S1 (designed with burst pressure P1), which acts as a temporary stop valve, and is redirected toward the microchamber. After the microchamber is filled with liquid, the flow of liquid is stopped at the passive stop valve S2 (designed with burst pressure P2), which acts as a permanent stop valve, and then, the liquid flows toward the second microchamber by passing through valve S1 because P1 < P2. Valve S2 also helps exhausting the air in the microchambers. All microchambers can be sequentially filled with liquid by repeating this process. In the dispensing process, the possible number of microchambers dispensed and the maximal allowable flow rate can be theoretically designed by the sequential liquid dispensing theory that we suggested and that is described by the following equation:

$$\begin{array}{*{20}c} {P_{2} > P_{1} + \left( {m - 1} \right)\Delta P\left( {L_{1} } \right) + \Delta P\left( {L_{2} } \right) + \Delta P\left( {L_{3} } \right)} \\ \end{array}$$
(1)

where ΔP(L1), ΔP(L2), and ΔP(L3) are the pressure differences required to flow a liquid in microchannels with characteristic lengths L1, L2, and L3, respectively, and m is the number of microchambers that have been fully filled. Definitions of L1, L2, and L3 are given in the next section. The flow resistance inside the microchamber is not considered because the microchamber is considerably larger in space than the microchannels. The theoretical pressure drop ΔP(L) in a rectangular microchannel is given by the following equation39:

$$\begin{array}{*{20}c} {\Delta P\left( L \right) = Q \times \frac{12\eta L}{{H^{3} W}}\left( {1 - 0.630\frac{H}{W}} \right)^{ - 1} } \\ \end{array}$$
(2)

where W, H, and L are microchannel width, height, and length, respectively, η is the dynamic viscosity of the liquid (η = 1 mPa·s for water), and Q is the volumetric flow rate.

According to the dispensing theory (Eq. 1), to increase the flow rate for the same possible number of microchambers dispensed, it is required to reduce the microchannel length, in particular L1, decrease the burst pressure P1 of the temporary stop valve S1, and increase the burst pressure P2 of the permanent stop valve S2, thus reducing the time required for dispensing liquid into the microchambers. The theoretical burst pressure, P(g) (Pa), of valve S1 is described as follows37:

$$\begin{array}{*{20}c} {P\left( g \right) = - \gamma \left( {\frac{{\cos \left( {\min \left( {\theta_{m} + \beta ,180^\circ } \right)} \right) + \cos \theta_{m} }}{{g + r\left( {1 - \cos \beta } \right)}} + \frac{{\cos \theta_{m} + \cos \theta_{f} }}{H}} \right)} \\ \end{array}$$
(3)

where g is the gap between the vertical sidewall of the microchannel and the convex structure embedded on the opposite sidewall (hereinafter referred to as a “single-faced stop valve”), H is the height of the microchannel, θm is the water contact angle for the top and sidewall surfaces of the microchannel at a narrow gap (θm = 108° for PDMS), θf is the water contact angle for the bottom surface of the microchannel (θf = 102° for the silicone-based adhesive double-sided tape), and γ is the surface tension of the liquid (γ = 0.073 N/m for water). When the corner radius r at the back edge of the convex structure is not negligible, the denominator g + r (1 ‒ cos β) in the first term is the redefined gap distance between a certain position on the corner at an angle β and the vertical sidewall of the microchannel, where β is the angle between the direction perpendicular to the longitudinal direction of the microchannel and the position of the liquid–air meniscus corresponding to being pinned at the corner of the convex structure. In this study, we investigated newly designed valve configurations for the permanent stop valve S2 to improve the pressure resistance performance. We analyzed the theoretical and experimental performance of sequential liquid dispensing into an array of microchambers by implementing a double-faced stop valve or air plug-in valve (the designs of the two valves are described in detail in the next section) and compared it with that of the single-faced stop valve reported in our previous study37.

### Operating procedure for the multiplexed LAMP assay in the microfluidic device

The aim of this study was to introduce a rapid and easy sample-to-answer platform for the multiplexed detection of multiple allergens in processed foods in a single operation. We explored the possibility of the simultaneous detection of three specific DNA targets from wheat, buckwheat, and peanut using our newly designed microfluidic diagnostic device with 10 microchambers arranged in a circle. The operating procedure for the multiplexed colorimetric LAMP assay in the microfluidic diagnostic device for the simultaneous genetic detection of the three allergens is as follows (Supplementary Fig. S1): first, 0.5 µL of three specific primer sets designed to amplify the targeted plant allergen genes (No. 2 and 7 for wheat; No. 3 and 8 for buckwheat; and No. 4 and 9 for peanut) and 0.5 µL of universal primer sets to identify all plant species as a positive control (No. 5 and 10) were pre-spotted and dried in each reaction chamber (volume ≈ 3 µL) on a hot plate at 80 °C for 3 min. Subsequently, both the microchambers and the microchannels on the PDMS surface were sealed with a PVC sheet using a silicone-based adhesive double-sided tape. After dispensing a mixture of DNA sample and LAMP reagents into the multiple reaction chambers at a flow rate of 30 µL/min using the syringe pump, the inlet and outlet ports were sealed with a silicone-based adhesive double-sided tape along with a polyethylene terephthalate release liner on one side. Here, the release liner is laminated on both sides to cover the adhesive layers of the double-sided tape. The microfluidic device was further mechanically clipped between two glass plates (S9213; Matsunami Glass, Osaka, Japan) placed on both sides of the device to prevent leakage at the interfaces between the PVC sheet, PDMS, and polyethylene terephthalate release liner. To avoid deformation of the device by the mechanical clipping, the PDMS device was sandwiched between two additional glass plates. Finally, the device was immersed in a hot water bath (TB-2N; AS ONE, Osaka, Japan) to amplify the target DNA through the LAMP reaction under isothermal conditions at 60 °C for 60 min.

HNB (FUJIFILM Wako Pure Chemical, Osaka, Japan) was used as an indicator for the visible colorimetric detection of the LAMP reaction and for image analysis for endpoint color quantification. In our previous study37, we developed a method to quantitatively assess color differences between a positive reaction (sky blue) and a negative reaction (violet) after the LAMP assays, based on a representation of the CIE L*a*b* color space (CIELAB). In the CIELAB color space, L* indicates lightness, and a* and b* are chromaticity coordinates. In brief, first, the RGB values for each microchamber were quantified using ImageJ (version 1.52a, National Institutes of Health, Bethesda, MD, USA) from photographs taken with a smartphone camera and subsequently converted to XYZ tristimulus values in the CIE XYZ color space. The color parameter values L*, a*, and b* were calculated using the XYZ values. This calculation method has been previously thoroughly described40. HNB was added to the mixture of DNA sample and LAMP reagents in each reaction chamber at final concentration of 150 µM. The Loopamp DNA Amplification Kit (Eiken Chemical, Tokyo, Japan), including a 2 × reaction mixture and a thermostable Bst DNA polymerase, was employed to perform the LAMP reactions. DNA was extracted from wheat, buckwheat, peanut, and tea plant (Camellia sinensis; used as a negative control) using a TaKaRa NucleoSpin Plant II kit (Takara Bio, Shiga, Japan) and was quantified using a NanoDrop 1000 spectrophotometer (Thermo Fisher Scientific, Waltham, MA, USA). Four plant samples including T. aestivum (voucher no. JU2021TA10), F. esculentum (voucher no. JU2021FE11), A. hypogaea (voucher no. JU2021AH12), and C. sinensis (voucher no. JU2021CS13) were obtained from the botanical garden of Josai University. All specimens were deposited at the botanical garden of Josai University.

## Results and discussion

### Reproducibility of microchamber structures constructed based on wax reflow

In our previous studies35,36,37, we used hemispherical polymer beads (2 mm in diameter; SAYAKOBO, Yokohama, Japan) to create deep localized microchamber structures instead of the wax reflow process (Supplementary Fig. S2). The polymer beads were manually glued onto each SU-8 chamber pattern as a mold using an epoxy adhesive (Araldite; Huntsman Japan, Kobe, Japan) at room temperature for 12 h. This fabrication process led to low reproducibility of the microchambers, i.e., the low controllability of the adhesive layer thickness and excess adhesive being squeezed out at the bonding interface decreased the replication accuracy, particularly at the intersection of the microchannel and the entrance of the microchamber. Such process failures sometimes led to unexpected air bubbles being trapped in the microchamber (Fig. 3a). This unfavorable result was most likely caused by a non-uniform flow on a step or around an obstacle at the entrance of the microchamber. The probability of sample dispensing without air bubbles was 87.0% in experiments with 20 devices and a total of 100 chambers. By implementing the thermal reflow process using wax, the probability of dispensing without air bubbles was markedly improved up to 100% in experiments with 20 devices and a total of 100 chambers (Fig. 3b).

### Sequential liquid dispensing using a double-faced stop valve

In this study, we improved the pressure resistance performance of valve S2 by changing its geometrical configuration. As shown in Fig. 4a, the gap distance of valve S2 is determined by two convex structures facing each other embedded on both sidewalls of the microchannel (referred to as a capillary stop valve41). In our devices, the valve structure of S2 is hereinafter referred to as a double-faced stop valve, whereas the S1 valve is a single-faced stop valve. The theoretical burst pressure of the double-faced stop valve can be derived as follows:

$$\begin{array}{*{20}c} {P\left( g \right) = - \gamma \left( {\frac{{2\cos \left( {\min \left( {\theta_{m} + \beta ,180^\circ } \right)} \right)}}{{g + 2r\left( {1 - \cos \beta } \right)}} + \frac{{\cos \theta_{m} + \cos \theta_{f} }}{H}} \right)} \\ \end{array}$$
(4)

The gap distance of the double-faced stop valve S2 was experimentally measured to be g2 = 21.4 μm (Fig. 4), resulting in a theoretical burst pressure P2 of 5.85 kPa for r2 = 6.4 µm in a microchannel (W = 202.1 µm and H = 59.0 µm). The theoretical burst pressure of the single-faced stop valve with the same gap distance (g2 = 21.4 μm) was calculated to be P2 = 4.47 kPa. Thus, the burst pressure can be increased by 1.3 times compared to that of the single-faced stop valve by implementing the double-faced stop valve for S2. It should be noted that five pairs of S2 were arranged in series (Fig. 4a) because we assumed that the gap distance (g2) and/or corner radius (r2) of one or more valves would not be the design value because of unexpected process failures in soft lithography. Thus, the one of the five valves that has the highest burst pressure (P2) determines the actual valve performance limit in microfluidic devices. For comparison, the gap distance g1 of 40.5 μm for the single-faced stop valve S1 resulted in a theoretical burst pressure P1 of 2.79 kPa. The microchannel lengths L1, L2, and L3 were set as 5.0 mm, 1.0 mm, 0.2 mm, as shown in Fig. 4a.

Figure 4b shows that an array of 10 microchambers was filled completely with water colored with blue food color (0.1% w/v) when we used the pressure-driven micropump at a flow rate of 10 µL/min. As expected, the possible number of microchambers dispensed when using the double-faced stop valve S2 was increased by 1.7 times as compared to the six microchambers that could be achieved at the same flow rate with the single-faced stop valve S2 used previously37. However, as predicted by the theoretical dispensing model, the possible number of microchambers dispensed decreased to five and two when the flow rate was increased to 20 µL/min (Fig. 4c and Video S1) or 50 µL/min (Fig. 4d), respectively.

### Sequential sample dispensing using an air plug-in valve

According to the dispensing theory described in Eqs. (14), the maximal allowable flow rate is limited by an increase in the flow resistance ΔP(L1), which increases in proportion to not only the flow rate, but also the number of microchambers filled. When using the geometric dimensions of the microchannels and a pair of passive stop valves as designed in this study, the maximal allowable flow rate for dispensing 10 microchambers was limited to approximately 10 µL/min. It should be noted that a further reduction of the gap distance (g2 = 20 µm as a design value) of the permanent stop valve S2 would improve the pressure resistance (P2), but would negatively affect the patterning accuracy of the SU-8 mold by photolithography.

Therefore, we propose a newly designed valve configuration for the permanent stop valve, which we termed an “air plug-in valve.” As shown in Fig. 5a, a set of two double-faced stop valves S2 was placed downstream and upstream in the upper microchannel (hereinafter referred to as the air exhaust microchannel) for exhausting the air in the microchambers. Five pairs of S2 were arranged in series to avoid the risk of unexpected failures in the fabrication process as mentioned in the previous section. The most distinctive feature of the air plug-in valve proposed here is that air is trapped in the part of the air exhaust microchannel connecting two S2 valves of neighboring microchambers when the next microchamber is completely filled with liquid (Fig. 5a). For example, both S2 valves of the first microchamber are subjected to the total pressure given on the right side of Eq. (5a) while the second microchamber is being filled with liquid. This condition corresponds to the case where m = 1 in Eq. (1), and the pressure applied to the S2 valves reaches the maximum right before the liquid reaches the S2 valves of the second microchamber. However, once the air trapping between the S2 valves of the first and second microchambers is completed, the pressure applied to the S2 valves of the first microchamber decreases to the pressure given on the right side of Eq. (5b) because the liquids reaching the two valves push against each other through the air plug, resulting in the offsetting of the applied pressure.

$$\begin{array}{*{20}c} {P_{2} > P_{1} + \Delta P\left( {L_{1} } \right) + \Delta P\left( {L_{2} } \right) + \Delta P\left( {L_{3} } \right)} \\ \end{array}$$
(5a)
$$\begin{array}{*{20}c} {P_{2} > \Delta P\left( {L_{1} } \right)} \\ \end{array}$$
(5b)

It can be concluded that the burst pressure P2 of the permanent stop valves S2 should be designed only to satisfy the constraint given by Eq. (5a), i.e., they are required to have flow resistance only until the liquid has been fully dispensed into the next microchamber. This also means that the limitation to the possible number of microchambers dispensed has been removed by implementing the air plug-in valve for S2.

Figure 5b–d shows that all 10 microchambers were sequentially filled with water containing green food color (0.1% w/v) at flow rates of 10, 30, and 70 μL/min (Video S2). Thus, the air plug-in valve allowed successful dispensing into all 10 microchambers at flow rates below 70 μL/min. According to the constraint given by Eq. (5a), the theoretical maximal allowable flow rate is limited to approximately 70 µL/min for dispensing 10 microchambers given the geometric dimensions of the microchannels and the pair of passive stop valves in the design used in this study. Thus, the experimental results satisfactorily agreed with the theoretically predicted maximal allowable flow rate. The allowable flow rate achieved with the implementation of the air plug-in valve was seven times higher than that obtained with the previous valve arrangement using double-faced stop valves and 14 times higher than that obtained with the single-faced stop valves used in our previous study (the maximal allowable flow rate was 5 μL/min for 10 microchambers)37. Notably, the dramatic improvement in the pressure resistance of the permanent stop valves allowed us to introduce the liquid manually into the microfluidic device (Video S3; estimated mean flow rate: ~ 40 µL/min).

### Unexpected behavior of the air plug-in valve

Unexpectedly, we observed that the liquid–air meniscus, which had previously been pinned by the air plug-in valve, gradually leaked downstream and, at the first microchamber, both upstream and downstream, as the dispensing proceeded (yellow arrows in Fig. 5b–d). This unexpected valve leakage behavior was most likely due to the gas permeability of PDMS42. The leakage length (LL) seemed to increase not only with an increasingly upstream position of the valve in the device, but also with an increase in flow rate. Figure 6a shows LL at the air plug-in valve downstream of each microchamber at flow rates of 10–70 µL/min. The values of LL were estimated right after the 10th microchamber was completely filled. LL gradually decreased as the valves were located further downstream until it reached 0.8 mm, after which it decreased with a larger negative slope. Five pairs of S2 were arranged in series in the air exhaust microchannel, resulting in a total length of 0.8 mm between the back edge of the first valve convex structure (set to the zero position of LL) and the back edge of the fifth valve (Fig. 5a). The transition region near LL = 0.8 mm was most likely due to the geometric differences in the microchannel, i.e., periodic fluctuations in the microchannel width due to the facing convex structures embedded on both sidewalls of the microchannel.

To investigate the effect of air leakage at the interface of the PDMS device and the silicone-based adhesive double-sided tape, we prepared a modified PDMS device that was covalently bonded to a thin PDMS layer coated on a 4-inch glass wafer by air plasma surface treatment. The LL values measured for the modified PDMS device are also plotted in Fig. 6a. It can be seen that there was no significant difference between two types of devices. Thus, negligible air leakage occurred at the interface between the PDMS device and adhesive tape. In addition, although all air plug-in valves S2 were subjected to an applied pressure described in Eq. (5b) right after the air trapping between adjacent valves was completed, the air plug trapped between the first and second microchambers exhibited a larger internal pressure than any other air plugs located downstream (Fig. S3), i.e., the internal pressure increased with an increase in the number of microchambers that had been dispensed, according to Eq. (1). Therefore, LL can be considered to increase not only at air-plug in valves located further upstream, but also at a higher flow rate because of an increase in flow resistance that can be estimated by Eq. (2).

In Fig. 6b, the data for the PDMS device covalently bonded to a thin PDMS layer coated on a 4-inch glass wafer are replotted as a function of the product of the internal pressure (P) applied to each air plug and the natural logarithm of time (ln(t)). P was theoretically calculated according to Eq. (1), and t was experimentally determined as the total time elapsed between a certain air plug being completed and all 10 microchambers being completely filled with water. The data are listed in Table S1 in the supplementary information. As shown in the graph, under the conditions of LL ≥  0.8 mm, LL is expressed regardless of the flow rate and valve position as follows:

$$\begin{array}{*{20}c} {LL \propto P \times \ln \left( t \right)} \\ \end{array}$$
(6)

where the coefficient of determination (R2) was estimated to be 0.823, indicating that the assumption presented in Eq. (6) is valid. Therefore, we can theoretically predict LL even during the design process of microfluidic devices. It should be noted that, when pumping stopped the flow of liquid into the microfluidic device, the inlet tubing was removed, and the leakage of liquid at the air plug-in valves was significantly reduced because the internal pressure in both the microchannel and microchambers immediately decreases to atmospheric pressure. A fundamental way to overcome the leakage problem is to replace PDMS with engineering plastics with lower gas permeability, such as polymethyl methacrylate, polycarbonate, or cyclo-olefin polymer.

### Multiplexed LAMP assay for the detection of food allergens

We explored the possibility of the rapid, simultaneous detection of multiple food allergenic substances i.e., specific DNA targets from wheat (T. aestivum), buckwheat (F. esculentum), and peanut (A. hypogaea), by the colorimetric LAMP method using a microfluidic device with a circular arrangement. With the aim of providing a microfluidic diagnostic device for the simultaneous genetic detection of seven allergens in processed foods, we compactly housed 10 microchambers in a circle instead of using a single row format. As shown in Fig. 7, in a device with a circular arrangement, green-colored water (0.1% w/v) could be successfully sequentially dispensed into all microchambers at a flow rate of 30 µL/min (Video S4). Our sequential liquid dispensing method provides substantial flexibility in the design of microfluidic devices, thus allowing the geometric design of 10 microchambers arranged in a circle and compactly housed within the 20-mm outermost diameter formed by the air exhaust microchannel. The geometric dimensions of this type of device were designed as L1 = 1.52 mm, L2 = 0.80 mm, and L3 = 0.89 mm. The theoretical maximal allowable flow rate for dispensing water into the 10 microchambers was estimated to be below 160 µL/min, the gap distances were g1 = 40.5 μm and g2 = 21.4 μm for valves S1 and S2, respectively, the corner radius at the back edge of the convex structures was r1 = r2 = 6.4 µm, and the width and height of the microchannel were W = 202.1 µm and H = 59.0 µm, respectively.

Figure 8a shows an experimental result for the detection of wheat-specific DNA (total DNA concentration: 1.0 ng/µL) by the colorimetric LAMP method using the microfluidic device. After the wheat DNA sample mixed with the LAMP reagents was introduced into the device, the LAMP assay was conducted in a hot water bath at 60 °C for 60 min. As expected, positive reactions, manifested by a color change of HNB (150 µM) in the LAMP reaction solution from violet to sky blue, were clearly observed in chambers 2, 5, 7, and 10, without false-positive and false-negative results. LAMP assays with buckwheat DNA and peanut DNA yielded true-positive results in chambers 3 and 8 (Supplementary Fig. S4a) and 4 and 9 (Fig. S4b), respectively, as well as in chambers 5 and 10 used as a positive control.

Figure 8b shows the simultaneous detection of multiple food allergens in a mixture of wheat DNA and buckwheat DNA (total DNA concentration: 1.0 ng/µL each) by the LAMP assay; positive reactions occurred in chambers 2, 3, 5, 7, 8, and 10, without any cross-contamination. Multiplexed LAMP assays with other combinations of the DNA samples, i.e., mixtures of wheat DNA and peanut DNA (Fig. S4c) and buckwheat DNA and peanut DNA (Fig. S4d), also yielded true test results. Similarly, a mixture of all three DNA samples (1.0 ng/µL each) yielded positive reactions in all chambers except chambers 1 and 6, used as a negative control (Fig. 8c). In contrast, when DNA extracted from a tea plant (1.0 ng/µL) was introduced into the device, a color change from violet to sky blue was observed only in the positive control chambers (Nos. 5 and 10), without false-positive reactions in the other chambers (Fig. 8d).

Figure 9 shows the distributions of color differences plotted in the a* − b* chromatic plane of the CIELAB space from the LAMP results presented in Fig. 8 (similarly, the data presented in Fig. S4 are plotted in Supplementary Fig. S5). The result revealed that the colors of the positive and negative groups were clearly separated after the LAMP assays were run for 60 min, for any combination of the three food allergens and tea plant used as a negative control.

## Conclusions

With the aim of improving the performance of PDMS-based microfluidic devices employed for the rapid and easy-to-use multiplexed genetic diagnostics, we proposed a newly designed valve configuration, termed an air plug-in valve. The pressure resistance performance of the air plug-in valve was remarkably enhanced after the air trapping between facing valves was completed. By replacing the previous valve arrangement using double-faced stop valves with the air plug-in valves, which was used as a permanent stop valve, the maximal allowable flow rate significantly increased by up to 14 times (~ 70 µL/min) for sequentially dispensing a liquid to fill an array of 10 reaction microchambers. Further, the limitation to the possible number of microchambers dispensed was removed by implementing the air plug-in valve. We demonstrated that the fabricated microfluidic device enables the simultaneous detection of three plant food allergens (wheat, buckwheat, and peanut) by colorimetric LAMP assays run at 60 °C for 60 min in a single operation, without cross-contamination between the reaction microchambers. It should be noted that the diagnostic device could be designed with a geometrical configuration of 10 reaction microchambers arranged in a circle and compactly housed within a 20-mm outermost diameter because our sequential liquid dispensing method provides substantial flexibility in the design of microfluidic devices.

In future studies, to simplify the operating procedure, we will further develop not only a method to pre-store the LAMP reagents in the microfluidic device, but also a pumpless microfluidic device based on a combination of centrifugal pumping and capillary valving, without the need for an external pumping system (i.e., a syringe or pressure pump). The final goal is to develop a rapid and easy sample-to-answer diagnostic platform that allows the simultaneous detection of not only all seven allergenic ingredients that must be labeled under Japanese law, i.e., wheat, buckwheat, peanut, egg, milk, shrimp, and crab, but also foodborne pathogens (e.g., Salmonella enterica, S. aureus, Campylobacter jejuni, and E. coli O157:H7) using our microfluidic device, to ensure food safety and security. In principle, it is possible to flexibly customize the type of nucleic acid target of interest (DNA/RNA); thus, this highly versatile technology can be applied to the on-site multiplexed genetic detection of not only allergens, but also infectious diseases caused by various pathogens (viruses, bacteria, fungi, and parasites), poisonous plants, and illegal drugs, without a need for laborious and multiple operations.


text:
Boundary integral formulae for the reconstruction of electric and electromagnetic inhomogeneities of small volume
ESAIM: Control, Optimisation and Calculus of Variations, Volume 9 (2003), pp. 49-66.

In this paper we discuss the approximate reconstruction of inhomogeneities of small volume. The data used for the reconstruction consist of boundary integrals of the (observed) electromagnetic fields. The numerical algorithms discussed are based on highly accurate asymptotic formulae for the electromagnetic fields in the presence of small volume inhomogeneities.

DOI: 10.1051/cocv:2002071
Classification: 35J25,  35R30,  65R99
Keywords: electromagnetic imaging, small inhomogeneities, numerical reconstruction algorithms
@article{COCV_2003__9__49_0,
author = {Ammari, Habib and Moskow, Shari and Vogelius, Michael S.},
title = {Boundary integral formulae for the reconstruction of electric and electromagnetic inhomogeneities of small volume},
journal = {ESAIM: Control, Optimisation and Calculus of Variations},
pages = {49--66},
publisher = {EDP-Sciences},
volume = {9},
year = {2003},
doi = {10.1051/cocv:2002071},
zbl = {1075.78010},
mrnumber = {1957090},
language = {en},
url = {http://archive.numdam.org/articles/10.1051/cocv:2002071/}
}
TY  - JOUR
AU  - Ammari, Habib
AU  - Moskow, Shari
AU  - Vogelius, Michael S.
TI  - Boundary integral formulae for the reconstruction of electric and electromagnetic inhomogeneities of small volume
JO  - ESAIM: Control, Optimisation and Calculus of Variations
PY  - 2003
DA  - 2003///
SP  - 49
EP  - 66
VL  - 9
PB  - EDP-Sciences
UR  - http://archive.numdam.org/articles/10.1051/cocv:2002071/
UR  - https://zbmath.org/?q=an%3A1075.78010
UR  - https://www.ams.org/mathscinet-getitem?mr=1957090
UR  - https://doi.org/10.1051/cocv:2002071
DO  - 10.1051/cocv:2002071
LA  - en
ID  - COCV_2003__9__49_0
ER  -
%0 Journal Article
%A Ammari, Habib
%A Moskow, Shari
%A Vogelius, Michael S.
%T Boundary integral formulae for the reconstruction of electric and electromagnetic inhomogeneities of small volume
%J ESAIM: Control, Optimisation and Calculus of Variations
%D 2003
%P 49-66
%V 9
%I EDP-Sciences
%U https://doi.org/10.1051/cocv:2002071
%R 10.1051/cocv:2002071
%G en
%F COCV_2003__9__49_0
Ammari, Habib; Moskow, Shari; Vogelius, Michael S. Boundary integral formulae for the reconstruction of electric and electromagnetic inhomogeneities of small volume. ESAIM: Control, Optimisation and Calculus of Variations, Volume 9 (2003), pp. 49-66. doi : 10.1051/cocv:2002071. http://archive.numdam.org/articles/10.1051/cocv:2002071/

[1] H. Ammari, M.S. Vogelius and D. Volkov, Asymptotic formulas for perturbations in the electromagnetic fields due to the presence of inhomogeneities of small diameter II. The full Maxwell Equations. J. Math. Pures Appl. 80 (2001) 769-814. | MR | Zbl

[2] S. Andrieux and A. Ben Abda, Identification of planar cracks by complete overdetermined data: Inversion formulae. Inverse Problems 12 (1996) 553-563. | MR | Zbl

[3] S. Andrieux, A. Ben Abda and M. Jaoua, On the inverse emerging plane crack problem. Math. Meth. Appl. Sci. 21 (1998) 895-907. | MR | Zbl

[4] H.D. Bui, A. Constantinescu and H. Maigre, Diffraction acoustique inverse de fissure plane : solution explicite pour un solide borné. C. R. Acad. Sci. Paris Sér. II 327 (1999) 971-976. | Zbl

[5] E. Beretta, A. Mukherjee and M. Vogelius, Asymptotic formuli for steady state voltage potentials in the presence of conductivity imperfection of small area. ZAMP 52 (2001) 543-572. | MR | Zbl

[6] M. Brühl, M. Hanke and M.S. Vogelius, A direct impedance tomography algorithm for locating small inhomogeneities. Preprint (2001). | MR | Zbl

[7] A.P. Calderon, On an inverse boundary value problem, in Seminar on Numerical Analysis and its Applications to Continuum Physics. Soc. Brasileira de Matemática, Rio de Janeiro (1980) 65-73. | MR

[8] D.J. Cedio-Fengya, S. Moskow and M.S. Vogelius, Identification of conductivity inperfections of small diameter by boundary measurements. Continuous dependence and computational reconstruction. Inverse Problems 14 (1998) 553-595. | Zbl

[9] I. Daubechies, Ten Lectures on Wavelets. SIAM, Philadelphia (1992). | MR | Zbl

[10] G.B. Folland, Introduction to Partial Differential Equations. Princeton University Press, Princeton (1976). | MR | Zbl

[11] A. Friedman and M. Vogelius, Identification of Small Inhomogeneities of Extreme Conductivity by Boundary Measurements: A Theorem on Continuous Dependence. Arch. Rational Mech. Anal. 105 (1989) 299-326. | MR | Zbl

[12] S. He and V.G. Romanov, Identification of small flaws in conductors using magnetostatic measurements. Math. Comput. Simul. 50 (1999) 457-471. | MR

[13] M.S. Joshi and S.R. Mcdowall, Total determination of material parameters from electromagnetic boundary information. Pacific J. Math. (to appear). | MR | Zbl

[14] K. Miller, Stabilized numerical analytic prolongation with poles. SIAM J. Appl. Math. 18 (1970) 346-363. | MR | Zbl

[15] P. Ola, L. Païvärinta and E. Somersalo, An inverse boundary value problem in electrodynamics. Duke Math. J. 70 (1993) 617-653. | MR | Zbl

[16] M.S. Vogelius and D. Volkov, Asymptotic formulas for perturbations in the electromagnetic fields due to the presence of inhomogeneities of small diameter 34 (2000) 723-748. | Numdam | MR | Zbl

[17] D. Volkov, An inverse problem for the time harmonic Maxwell Equations, Ph.D. Thesis. Rutgers University (2001).

Cited by Sources:

format: plain


text:
# Question 780de

Dec 2, 2016

$\text{75.0 mL}$

#### Explanation:

The thing to remember about dilution calculations is that the ratio that exists between the volume of the diluted solution and the volume of the concentrated solution is equal to the ratio that exists between the concentration of the concentrated solution and the concentration of the diluted solution.

$\text{volume of diluted solution"/"volume of concentrated solution" = "molarity of concentrated solution"/"molarity of diluted solution}$

These two ratios give you the dilution factor, $\text{DF}$, which essentially tells you the factor by which the concentration of the concentrated solution decreased after the dilution.

You know that the concentration of the diluted solution must be $\text{0.750 M}$ and that the concentration of the stock solution is $\text{1.00 M}$.

This will give you

"DF" = (1.00 color(red)(cancel(color(black)("M"))))/(0.750color(red)(cancel(color(black)("M")))) = 4/3

This is exactly the ratio that must exist between the volume of the diluted solution, which is equal to $\text{100.0 mL}$, and the volume of the stock solution, let's say ${V}_{\text{stock}}$

$\text{DF" = "100.0 mL"/V_"stock}$

Therefore,

V_"stock" = "100.0 mL"/(4/3) = 300.0/4color(white)(.)"mL" = color(darkgreen)(ul(color(black)("75.0 mL")))#


text:
When quoting this document, please refer to the following
DOI: 10.4230/LIPIcs.RTA.2011.361
URN: urn:nbn:de:0030-drops-31350
URL: http://drops.dagstuhl.de/opus/volltexte/2011/3135/
 Go to the corresponding LIPIcs Volume Portal

### Left-linear Bounded TRSs are Inverse Recognizability Preserving

 pdf-format:

### Abstract

Bounded rewriting for linear term rewriting systems has been defined in (I. Durand, G. Sénizergues, M. Sylvestre. Termination of linear bounded term rewriting systems. Proceedings of the 21st International Conference on Rewriting Techniques and Applications) as a restriction of the usual notion of rewriting. We extend here this notion to the whole class of left-linear term rewriting systems, and we show that bounded rewriting is effectively inverse-recognizability preserving. The bounded class (BO) is, by definition, the set of left-linear systems for which every derivation can be replaced by a bottom-up derivation. The class BO contains (strictly) several classes of systems which were already known to be inverse-recognizability preserving: the left-linear growing systems, and the inverse right-linear finite-path overlapping systems.

### BibTeX - Entry

```@InProceedings{durand_et_al:LIPIcs:2011:3135,
author =	{Ir{\`e}ne Durand and Marc Sylvestre},
title =	{{Left-linear Bounded TRSs are Inverse Recognizability Preserving}},
booktitle =	{22nd International Conference on Rewriting Techniques and Applications (RTA'11)},
pages =	{361--376},
series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN =	{978-3-939897-30-9 },
ISSN =	{1868-8969},
year =	{2011},
volume =	{10},
editor =	{Manfred Schmidt-Schau{\ss}},
publisher =	{Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik},


text:
# Hard X-ray emissions from Cassiopeia A observed by INTEGRAL

 Title Hard X-ray emissions from Cassiopeia A observed by INTEGRAL Publication Type Journal Article Year of Publication 2016 Authors Wang, W, Li, Z Journal ApJ Volume 825 Start Page 102 Keywords Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Solar and Stellar Astrophysics


text:
# Is 5 a prime number?

Five is a number very present in our lives. We have 5 fingers and toes, most starfishes have 5 arms, there are five human senses, five vowels, and five Olympic rings, just to mention some!
One of the main mathematical properties of 5 is that it is a prime number, as we are about to learn.

We will start recalling some definitions that we have widely discussed in our Prime Numbers article. If you still feel unfamiliar with these notions, we invite you to first read that article and come back here later.

A factor of a natural number is a positive divisor of the number. A proper factor of a natural number is a factor that is different from 1 and from the number itself.

For example,  $$35=5\times7=1\times35$$; thus, 1, 5, 7, and 35 are all factors of 35, but only 5 and 7 are proper factors of 35.

A natural number is called a prime number if it is greater than 1, and it doesn’t have proper factors. For example, the first prime numbers are 2 and 3.

A composite number is a natural number that has proper factors. As we saw, 35 has two proper factors, thus 35 is a composite number.

## Why is 5 a prime number?

Number 5 is a prime number because it doesn’t have proper factors. In other words, the only factors of 5 are 1 and itself.

To be sure of it, notice that the integers greater than 1 and less than 5 are: 2, 3, and 4. Since 5 is not even, neither 2 nor 4 is a factor of 5. Moreover,  $$5=(3\times1)+2$$, thus the remainder of dividing 5 by 3 is 2. In other words, 3 isn’t a factor of 5 either.

Therefore, 5 is the third prime number, preceded by 2 and 3.

Example: Is 215 a prime number?

To answer this question, we should verify if 215 has proper factors. Since 215 ends in 5, we know that 5 is a factor of it:  $$125=5\times25$$. In other words, 5 and 25 are proper factors of 125.

This means that 125 is a composite number, it isn’t prime! In fact, we don’t need to find all the proper factors of 125 to ensure it is composite, we only need to find one proper factor, and we know one from the beginning: it is 5.

As a result, we have the following rule.

Any number, different from 5, ending in 0 or 5 is not a prime number: Notice that any number ending in 0 or 5, and greater than 5, has 5 as a proper factor.

Therefore, they are all composite numbers. For example, $$85 = 5 × 17$$, which means that 85 is a composite number. The same can be said about $$230 = 5 × 46$$.

## Which class of prime number is 5?

One amazing thing about 5 is that it is a prime number which is the sum of two other primes: 5 = 2 + 3.

Since it is the 3rd prime number, and 3 is also prime, 5 belongs to the class of super-prime numbers: they are the prime numbers that occupy a prime position in the list of all prime numbers.

Number 5 can be classified into many different classes of prime numbers. We will name three of them here, and then we will see to which of these classes number 5 belongs.

Let’s find out why:

• Notice that $$5 = (2 × 3) − 1$$, where 2 and 3 are the first two prime numbers. Thus, 5 has the form of a primoral prime.
• Notice that:
$$2^0-1=1-1=0$$
$$2^1-1=2-1=1$$
$$2^2-1=4-1=3$$
$$2^3-1=8-1=7$$
Therefore, 5 is between the two Mersenne primes 3 and 7, but it is not a Mersenne prime. Nevertheless, if we use n=5 as exponent, we get  $$2^5-1=32-1=31$$ which is a prime number.
• Notice that using the first prime number p = 2, we get 2(2) + 1 = 5. Thus, 5 is the first safe prime.

We invite you to read other articles on prime numbers, on our webpage, to find out which other prime numbers belong to these classes.

Do you think 31 is a prime or not?


text:
Limited access

A particle is traveling along an ellipse whose equation is:

$$x^2-2x+4y^2+24y+33=0$$

Which of the given formulas will compute the distance traveled from the point $(3.-3)$ to the point $(1,-4)$, if the point is traveling counterclockwise?

A

$\int^{\pi/2}_0 \sqrt{\sin^\theta+1}\,d\theta$

B

$\int^{3\pi/2}_0\sqrt{3\sin^2\theta+1}\,d\theta$

C

$\int^{3\pi/2}_0\sqrt{3\cos^2\theta+1}\,d\theta$

D

$\int^{\pi/2}_0 \sqrt{\cos^\theta+1}\,d\theta$

E

$\int^{\pi/2}_0\sqrt{3\cos^2\theta+1}\,d\theta$

Select an assignment template


text:
# Change of basis matrix(linear algebra)

1. Dec 19, 2011

### leeewl

Hi I'm stuck on this problem and I could not find similar examples anywhere.. any help would be greatly appreciated, thank you.

1. The problem statement, all variables and given/known data
Compute the change of basis matrix that takes the basis
$V1 = \begin{bmatrix} -1 \\ 3 \end{bmatrix}$ $V2 = \begin{bmatrix} 2 \\ 5 \end{bmatrix}$
of R2 to the basis
$W1 = \begin{bmatrix} 2 \\ 5 \end{bmatrix}$ $W2 = \begin{bmatrix} 3 \\ 7 \end{bmatrix}$
I have done this first part, the change of basis matrix is $A = \begin{bmatrix} 2 & 1 \\ -1 & 0 \end{bmatrix}$

next part I don't quite know how to start:
Consider v = V1 + 2(V2) $\in$ R2: Determine the column vector $\begin{bmatrix} a \\ b \end{bmatrix}$ which represents v with respect to the basis {W1, W2}

3. The attempt at a solution

Do I turn v1 into $V1 = \begin{bmatrix} -1 \\ 3 \end{bmatrix}$ and V2 into $V2 = \begin{bmatrix} 4 \\ 10 \end{bmatrix}$ and then try and find a linear combination that gives me {W1, W2}?

2. Dec 20, 2011

Set up the linear combination and make it equal to your vector in order to find the coefficients a, b.

3. Dec 20, 2011

### vela

Staff Emeritus
The fact that $\vec{v} = 1\vec{v}_1 + 2\vec{v}_2$ means that with respect to the $\{\vec{v}_1,\vec{v}_2\}$ basis,
$$\vec{v} = \begin{bmatrix} 1 \\ 2 \end{bmatrix}_{\{\vec{v}_1,\vec{v}_2\}}$$Use the matrix A to convert the coordinates from one basis to the other.

By the way, I don't think your matrix A is correct.

Last edited: Dec 20, 2011
4. Dec 20, 2011

### leeewl

Thank you for your answers. I made a mistake in the op. $V1 = \begin{bmatrix} 1 \\ 3 \end{bmatrix}$ and not (-1, 3) so my matrix A should be correct.
Is multiplying A by (coefficients of v1, v2) $v = \begin{bmatrix} 1 \\ 2 \end{bmatrix}$ all I really need to do to?
Then my answer is \begin{bmatrix} 4 \\ -1 \end{bmatrix}

5. Dec 20, 2011

### vela

Staff Emeritus
It's easy enough to check. Is $4\vec{w}_1-\vec{w}_2$ equal to $\vec{v}_1+2\vec{v}_2$?

If your matrix is correct, then yes, that's all you have to do. That's why it's called a change of basis matrix.


text:
Use the Exchange-listed tab to open a spread matrix for an exchange-listed calendar spread.

1. Open the Spread Matrix widget.
2. Click the Exchange-listed tab in the Add Tab dialogue.

3. Enter a product in the Search for products box or click Explore to select a single product.
4. Click Ok.

## Opening an inter-product Spread Matrix

Use the Autospreader tab to open an existing inter-product spread that is managed by the Autospreader® widget. This includes any inter-product spreads you've created using the Spread Matrix.

1. Open the Spread Matrix widget.

3. Click the dropdown arrow in the Select a spread field and click on a spread.

Note: The Autospreader tab only displays synthetic inter-product spreads. If there are no inter-product spreads created in Autospreader®, this dropdown will be empty.

4. click OK.

## Opening a custom inter-product Spread Matrix

To populate a Spread Matrix with two different products when there is not an existing Autospreader spread comprised of legs of the two different products, use the Custom tab.

1. Open the Spread Matrix widget.
2. Click the Custom tab from the Add Tab dialogue.

3. Click Search for a product... in the Front leg product and Back leg product fields to select products for the front and back legs of the spread.
4. Configure the following settings in the Spread Settings table:
• Ratio — Indicates the quantity of each leg in relation to the others. A negative sign (-) before the number indicates a short leg. Values entered in the Ratio field do not affect the spread price.
• Multiplier — Weights the value of the leg price to calculate the spread price when using the "Price Differential" formula:

(1 * Leg1.MergedPrice) - (1 * Leg2.MergedPrice)

Note: The multiplier can be a whole number, decimal number, or fraction. Fractional representation optimizes ticking accuracy.

Example: A Spread Multiplier of 0.333333 displays as 1/3 in the Tick Information section.

5. Click Ok.


text:
# Math Help - simultaneous equation

1. ## simultaneous equation

$\frac{3x+y+1}{8}=\frac{x-y}{5}=\frac{x^2-y^2}{5}$

$\frac{3x+y+1}{8}=\frac{x-y}{5}$

$7x+13y=-5$ --- 1
$

\frac{x-y}{5}=\frac{x^2-y^2}{5}
$

$x-y=(x+y)(x-y)$

x+y=1 (I am not sure if i can do this) ----2

So solving 1 and 2 , i gt x=3 and y=-2 .

It looks to me that there is another pair of values x and y but just couldn't find them . I am confusing my self at times . How can i find the other pair ?

2. Originally Posted by thereddevils
$\frac{3x+y+1}{8}=\frac{x-y}{5}=\frac{x^2-y^2}{5}$

$\frac{3x+y+1}{8}=\frac{x-y}{5}$

$7x+13y=-5$ --- 1
$

\frac{x-y}{5}=\frac{x^2-y^2}{5}
$

$x-y=(x+y)(x-y)$

x+y=1 (I am not sure if i can do this) ----2

So solving 1 and 2 , i gt x=3 and y=-2 .

It looks to me that there is another pair of values x and y but just couldn't find them . I am confusing my self at times . How can i find the other pair ?
Hi

Better factor : $x-y=(x+y)(x-y)$

$(x-y)(x+y-1)=0$

2 possibilities :
or x+y-1 = 0 (you have solved this case)
or x-y = 0 (you have forgotten this one)


text:
How to replace Variable With Variable [closed]

Clear[a, b, c];
a = c;    a =. ;    b = a;    b =.;    c = b;    c =.;
Print[a, b]

and the result is

{a b}

but I want the result {b a} by using a Temp help. how is the code suppose to be?

closed as unclear what you're asking by Daniel Lichtblau, Henrik Schumacher, MarcoB, Coolwater, m_goldbergApr 18 '18 at 19:33

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Is this what you need? Print[a, b] // Inactivate // Reverse // Activate – Kuba Apr 18 '18 at 8:42
• i dont get it, the expample is i want to Give the value of A to Temp, Then give the Value of B to A, and C to B and the last Temp to C. so the result if i Print[A,B] its will result B,A . And also work if i input values – Bagoes Heikhal Apr 18 '18 at 8:56
• I don't think it makes sense unless a/b/c have values. Can you provide a small example? – Kuba Apr 18 '18 at 9:02
• {a, b, c} = {b, c, a};? – Kuba Apr 18 '18 at 9:06
• Unclear what is wanted that would not induce infinite recursion. Maybe something like this (also suggested by @Kuba)? In[277]:= x = 3; y = 5; {x, y} = {y, x}; {x, y} Out[280]= {5, 3} – Daniel Lichtblau Apr 18 '18 at 13:56

Clear[a, b]
a := Defer[b]; b := Defer[a];
Print[a, b]

ba

With values

Clear[a, b, c]
a = 1; b = 2;
c = a; a = b; b = c;
Print[a, b]

21

• How to make its work if i input the variable with values – Bagoes Heikhal Apr 18 '18 at 8:59

I don't think the output the OP has in mind is possible within reasonable bounds of normal programming. If you want a to evaluate to b and b to evaluate to a, the evaluation chain will never end.

If you're only interested in the output, use Defer:

a = Defer[b];
b = Defer[a];
Print[a, b]


text:
# Block matrix

In the mathematical discipline of matrix theory, a block matrix or a partitioned matrix is a partition of a matrix into rectangular smaller matrices called blocks. Looking at it another way, the matrix is written in terms of smaller matrices written side-by-side. A block matrix must conform to a consistent way of splitting up the rows, and the columns: we group the rows into some adjacent 'bunches', and the columns likewise. The partition is into the rectangles described by one bunch of adjacent rows crossing one bunch of adjacent columns. In other words, the matrix is split up by some horizontal and vertical lines that go all the way across.

## Example

The matrix

[itex]P = \begin{bmatrix}

1 & 1 & 2 & 2\\ 1 & 1 & 2 & 2\\ 3 & 3 & 4 & 4\\ 3 & 3 & 4 & 4\end{bmatrix}[itex]

can be partitioned into 4 2×2 blocks

[itex]P_{11} = \begin{bmatrix}

1 & 1 \\ 1 & 1 \end{bmatrix}, P_{12} = \begin{bmatrix} 2 & 2\\ 2 & 2\end{bmatrix}, P_{21} = \begin{bmatrix} 3 & 3 \\ 3 & 3 \end{bmatrix}, P_{22} = \begin{bmatrix} 4 & 4\\ 4 & 4\end{bmatrix}.[itex]

The partitioned matrix can then be written as

[itex]P_{\mathrm{partitioned}} = \begin{bmatrix}

P_{11} & P_{12}\\ P_{21} & P_{22}\end{bmatrix}.[itex]

## Block diagonal matrices

A block diagonal matrix is a block matrix which is a square matrix, and having main diagonal blocks square matrices, such that the off-diagonal blocks are zero matrices. A block diagonal matrix A has the form

[itex]

\mathbf{A} = \begin{bmatrix} A_{1} & 0 & \cdots & 0 \\ 0 & A_{2} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & A_{n} \end{bmatrix} [itex]

where Ak is an square matrix. Any square matrix can be trivially considered as a block diagonal matrix, taking n=1.

## Application

In linear algebra terms, the use of a block matrix corresponds to having a linear mapping thought of in terms of corresponding 'bunches' of basis vectors. That again matches the idea of having distinguished direct sum decompositions of the domain and range. It is always particularly significant if a block is the zero matrix; that carries the information that a summand maps into a sub-sum.

Given the interpretation via linear mappings and direct sums, there is a special type of block matrix that occurs for square matrices (the case m = n). For those we can assume an interpretation as an endomorphism of an n-dimensional space V; the block structure in which the bunching of rows and columns is the same is of importance because it corresponds to having a single direct sum decomposition on V (rather than two). In that case, for example, the diagonal blocks in the obvious sense are all square. This type of structure is required to describe the Jordan normal form.

This technique is used to cut down calculations of matrices, column-row expansions, and many computer science applications, including VLSI chip design. An example is the Strassen algorithm for fast matrix multiplication.

• Art and Cultures
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Space and Astronomy


text:
# Question about normal subgroup

• November 28th 2013, 10:31 AM
Stormey
Question about normal subgroup
Suppose $G$ is a group, and $H$ is some subset of $G$.
Is it true that if $\forall g\in G$ and $\forall h\in H$: $ghg^{-1}\in H$, then $H$ is a normal subgroup?
Or that $H$ has to be a subgroup (not just any subset) for this statment to be true?

I'm asking because I need to prove it, and I not 100 percent sure my teacher didn't make a mistake here...

• November 28th 2013, 03:57 PM
johng
Re: Question about normal subgroup
Hi Stormey,
Suppose G is abelian and H is any subset of G. Isn't it true that ghg-1 is in H for all g in G and all h in H?

Perhaps your teacher wants you to prove that <H>, the subgroup generated by H, is a normal subgroup.
• November 28th 2013, 11:45 PM
Stormey
Re: Question about normal subgroup
Quote:

Originally Posted by johng
Hi Stormey,
Suppose G is abelian and H is any subset of G. Isn't it true that ghg-1 is in H for all g in G and all h in H?

Perhaps your teacher wants you to prove that <H>, the subgroup generated by H, is a normal subgroup.

But it didn't say there that G is abelian, and if G isn't abelian, then this claim isn't true.
So either G is abelian, or H is a subgroup, for this claim to be true, isn't it?
• November 29th 2013, 05:16 AM
johng
Re: Question about normal subgroup
Stormey,

One counterexample is always enough to refute a statement. However, your statement is also false for non-abelian groups.

Example: Let G=S3 be the symmetric group on {1,2,3}, x the 3 cycle (123) and H = {x,x-1}. I leave it to you to prove that ghg-1 is in H for all g in G and h in H. "Clearly", H is not a subgroup of G.
• November 30th 2013, 12:18 AM
Stormey
Re: Question about normal subgroup
Excellent. :)
This is what I was looking for.
• November 30th 2013, 12:50 AM
Stormey
Re: Question about normal subgroup
*edit

well, I found some counter example to this too:

if $H=\left \{(1 \hspace{3} 2 \hspace{3} 3),(3 \hspace{3} 2 \hspace{3} 1) \right \}$, and let's say $g=(1 \hspace{3} 2)$, then:
$ghg^{-1}=(1 \hspace{3} 2)\circ (1 \hspace{3} 2 \hspace{3} 3)\circ (1 \hspace{3} 2)\notin H$
(Worried)
• November 30th 2013, 04:30 AM
topsquark
Re: Question about normal subgroup
Quote:

Originally Posted by Stormey
*edit

well, I found some counter example to this too:

if $H=\left \{(1 \hspace{3} 2 \hspace{3} 3),(3 \hspace{3} 2 \hspace{3} 1) \right \}$, and let's say $g=(1 \hspace{3} 2)$, then:
$ghg^{-1}=(1 \hspace{3} 2)\circ (1 \hspace{3} 2 \hspace{3} 3)\circ (1 \hspace{3} 2)\notin H$
(Worried)

Actually $(1 ~ 2) \circ (1~2~3) \circ (1~2) = (1~2) \circ (1~3~2) = (1~3~2)$ which is equivalent to (3 2 1).

-Dan
• November 30th 2013, 05:17 AM
Stormey
Re: Question about normal subgroup
Oh... I also got (1 3 2), but didn't relize it's equivalent to (3 2 1).
Thanks Dan!
• November 30th 2013, 05:44 AM
topsquark
Re: Question about normal subgroup
Quote:

Originally Posted by Stormey
Oh... I also got (1 3 2), but didn't relize it's equivalent to (3 2 1).
Thanks Dan!

No problem. Someone had to point that out to me about two weeks ago. (Doh)

-Dan


text:
# Franklin graph

Franklin Graph

The Franklin Graph
Named after Philip Franklin
Vertices 12
Edges 18
Diameter 3
Girth 4
Automorphisms 48 (Z/2Z×S4)
Chromatic number 2
Chromatic index 3
Properties Cubic
Hamiltonian
Bipartite
Triangle-free
Perfect
Vertex-transitive

In the mathematical field of graph theory, the Franklin graph a 3-regular graph with 12 vertices and 18 edges.[1]

The Franklin graph is named after Philip Franklin, who disproved the Heawood conjecture on the number of colors needed when a two-dimensional surface is partitioned into cells by a graph embedding.[2][3] The Heawood conjecture implied that the maximum chromatic number of a map on the Klein bottle should be seven, but Franklin proved that in this case six colors always suffice. The Franklin graph can be embedded onto the Klein bottle so that it forms a map requiring six colors, showing that six colors are sometimes necessary in this case.

It is Hamiltonian and has chromatic number 2, chromatic index 3, radius 3, diameter 3 and girth 4. It is also a 3-vertex-connected and 3-edge-connected perfect graph.

## Algebraic properties

The automorphism group of the Franklin graph is of order 48 and is isomorphic to Z/2Z×S4, the direct product of the cyclic group Z/2Z and the symmetric group S4. It acts transitively on the vertices of the graph, making it vertex-transitive.

The characteristic polynomial of the Franklin graph is

$(x-3) (x-1)^3 (x+1)^3 (x+3) (x^2-3)^2.\$

## References

1. ^
2. ^
3. ^ Franklin, P. "A Six Color Problem." J. Math. Phys. 13, 363-379, 1934.


text:
# Caching

## About

Beaker's caching system was originally based off the Perl Cache::Cache module, which was ported for use in Myghty. Beaker was then extracted from this code, and has been substantially rewritten and modernized.

Several concepts still exist from this origin though. Beaker's caching (and its sessions, though its behind the scenes) utilize the concept of :term:NamespaceManager, and :term:Container objects to handle storing cached data.

Each back-end utilizes a customized version of each of these objects to handle storing data appropriately depending on the type of the back-end.

The :class:~beaker.cache.CacheManager is responsible for getting the appropriate NamespaceManager, which then stores the cached values. Each namespace corresponds to a single thing that should be cached. Usually a single thing to be cached might vary slightly depending on parameters, for example a template might need several different copies of itself stored depending on whether a user is logged in or not. Each one of these copies is then keyed under the NamespaceManager and stored in a Container.

There are three schemes for using Beaker's caching, the first and more traditional style is the programmatic API. This exposes the namespace's and retrieves a :class:~beaker.cache.Cache object that handles storing keyed values in a NamespaceManager with Container objects.

The more elegant system, introduced in Beaker 1.3, is to use the :ref:cache decorators <decorator_api>, these also support the use of :term:Cache Regions.

Introduced in Beaker 1.5 is a more flexible :func:~beaker.cache.cache_region decorator capable of decorating functions for use with Beaker's :ref:caching_with_regions before Beaker has been configured. This makes it possible to easily use Beaker's region caching decorator on functions in the module level.

## Creating the CacheManager Instance

Before using Beaker's caching, an instance of the :class:~beaker.cache.CacheManager class should be created. All of the examples below assume that it has already been created.

Creating the cache instance:

from beaker.cache import CacheManager
from beaker.util import parse_cache_config_options

cache_opts = {
'cache.type': 'file',
'cache.data_dir': '/tmp/cache/data',
'cache.lock_dir': '/tmp/cache/lock'
}

cache = CacheManager(**parse_cache_config_options(cache_opts))

Additional configuration options are documented in the :ref:Configuration section of the Beaker docs.

## Programmatic API

To store data for a cache value, first, a NamespaceManager has to be retrieved to manage the keys for a thing to be cached:

# Assuming that cache is an already created CacheManager instance
tmpl_cache = cache.get_cache('mytemplate.html', type='dbm', expire=3600)

Note

In addition to the defaults supplied to the :class:~beaker.cache.CacheManager instance, any of the Cache options can be changed on a per-namespace basis, as this example demonstrates by setting a type, and expire option.

Individual values should be stored using a creation function, which will be called anytime the cache has expired or a new copy needs to be made. The creation function must not accept any arguments as it won't be called with any. Options affecting the created value can be passed in by using closure scope on the creation function:

search_param = 'gophers'

def get_results():
# do something to retrieve data
data = get_data(search_param)
return data

# Cache this function, based on the search_param, using the tmpl_cache
# instance from the prior example
results = tmpl_cache.get(key=search_param, createfunc=get_results)

### Invalidating

All of the values for a particular namespace can be removed by calling the :meth:~beaker.cache.Cache.clear method:

tmpl_cache.clear()

Note that this only clears the key's in the namespace that this particular Cache instance is aware of. Therefore its recommend to manually clear out specific keys in a cache namespace that should be removed:

tmpl_cache.remove_value(key=search_param)

## Decorator API

When using the decorator API, a namespace does not need to be specified and will instead be created for you with the name of the module + the name of the function that will have its output cached.

Since its possible that multiple functions in the same module might have the same name, additional arguments can be provided to the decorators that will be used in the namespace to prevent multiple functions from caching their values in the same location.

For example:

# Assuming that cache is an already created CacheManager instance
@cache.cache('my_search_func', expire=3600)
def get_results(search_param):
# do something to retrieve data
data = get_data(search_param)
return data

results = get_results('gophers')

The non-keyword arguments to the :meth:~beaker.cache.CacheManager.cache method are the additional ones used to ensure this function's cache results won't clash with another function in this module called get_results.

The cache expire argument is specified as a keyword argument. Other valid arguments to the :meth:~beaker.cache.CacheManager.get_cache method such as type can also be passed in.

When using the decorator, the function to cache can have arguments, which will be used as the key was in the :ref:Programmatic API <programmatic> for the data generated.

Warning

These arguments can not be keyword arguments.

### Invalidating

Since the :meth:~beaker.cache.CacheManager.cache decorator hides the namespace used, manually removing the key requires the use of the :meth:~beaker.cache.CacheManager.invalidate function. To invalidate the 'gophers' result that the prior example referred to:

cache.invalidate(get_results, 'my_search_func', 'gophers')

If however, a type was specified for the cached function, the type must also be given to the :meth:~beaker.cache.CacheManager.invalidate function so that it can remove the value from the appropriate back-end.

Example:

# Assuming that cache is an already created CacheManager instance
@cache.cache('my_search_func', type="file", expire=3600)
def get_results(search_param):
# do something to retrieve data
data = get_data(search_param)
return data

cache.invalidate(get_results, 'my_search_func', 'gophers', type="file")

Note

Both the arguments used to specify the additional namespace info to the cache decorator and the arguments sent to the function need to be given to the :meth:~beaker.cache.CacheManager.region_invalidate function so that it can properly locate the namespace and cache key to remove.

## Cache Regions

Rather than having to specify the expiration, or toggle the type used for caching different functions, commonly used cache parameters can be defined as :term:Cache Regions. These user-defined regions than may be used with the :meth:~beaker.cache.CacheManager.region decorator rather than passing the configuration.

This can be useful if there are a few common cache schemes used by an application that should be setup in a single place then used as appropriate throughout the application.

Setting up cache region's is documented in the :ref:cache region options <cache_region_options> section in :ref:configuration.

Assuming a long_term and short_term region were setup, the :meth:~beaker.cache.CacheManager.region decorator can be used:

@cache.region('short_term', 'my_search_func')
def get_results(search_param):
# do something to retrieve data
data = get_data(search_param)
return data

results = get_results('gophers')

Or using the :func:~beaker.cache.cache_region decorator:

@cache_region('short_term', 'my_search_func')
def get_results(search_param):
# do something to retrieve data
data = get_data(search_param)
return data

results = get_results('gophers')

The only difference with the :func:~beaker.cache.cache_region decorator is that the cache does not need to be configured when its used. This allows one to decorate functions in a module before the Beaker cache is configured.

### Invalidating

Since the :meth:~beaker.cache.CacheManager.region decorator hides the namespace used, manually removing the key requires the use of the :meth:~beaker.cache.CacheManager.region_invalidate function. To invalidate the 'gophers' result that the prior example referred to:

cache.region_invalidate(get_results, None, 'my_search_func', 'gophers')

Or when using the :func:~beaker.cache.cache_region decorator, the :func:beaker.cache.region_invalidate function should be used:

region_invalidate(get_results, None, 'my_search_func', 'gophers')

Note

Both the arguments used to specify the additional namespace info to the cache decorator and the arguments sent to the function need to be given to the :meth:~beaker.cache.CacheManager.region_invalidate function so that it can properly locate the namespace and cache key to remove.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.


text:
Functions and Relations

# Functions and Relations

## Functions

Recall that if $X$ and $Y$ are sets then a function $f : X \to Y$ is a rule which assigns to each $x \in X$ a unique $y \in Y$. We can more precisely define a function in terms of sets.

 Definition: Let $X$ and $Y$ be sets. A Function from $X$ to $Y$ is a subset $f$ of $X \times Y$ such that for every $x \in X$ if $(x, y_1), (x, y_2) \in f$ then $y_1 = y_2$.

In other words, a function from a set $X$ to a set $Y$ can be defined as a subset of the cartesian product $X \times Y$ such that for each $x \in X$ there is exactly one ordered pair $(x, y)$ where $y \in Y$.

## Relations

 Definition: Let $X$ and $Y$ be sets. A Relation from $X$ to $Y$ is a subset $R$ of $X \times Y$.

The definition above is more precisely defining a binary relation. More generally, if $X_1, X_2, ..., X_n$ are sets then an $n$-ary relation on $X_1$, $X_2$, …, $X_n$ is a subset $R$ of $X_1 \times X_2 \times ... \times X_n$. The terms "relation" and "binary relation" will mean the same thing unless specified otherwise.

Observe the definition of a relation closely. Note that a relation from $X$ to $Y$ is simply a subset $R$ of the cartesian product $X \times Y$. There is nothing more to it!

Also observe that every function is by definition a relation. However, there are many relations that are not functions. For example, let $X = \{ 0, 1 \}$ and let $Y = \{ a, b \}$ with $a \neq b$. Let:

(1)
\begin{align} \quad R = \{ (0, a), (0, b), (1, a) \} \end{align}

Clearly $R$ is a relation. Is $R$ a function? If $R$ is a function then for $0 \in X$ we must have that $(0, a) = (0, b)$. But then $a = b$ which is a contradiction. So $R$ is NOT a function.


text:
# Newcommand with optional argument and ifthenelse

I would like to define a new command comp with two arguments where the second (and last) argument is optional, using 'ifthenelse'. I tried :

\newcommand{\comp}[2]{%
\ifthenelse{\isempty{#2}}%
{{#1}^{c}}% if #2 is empty
{#2 \backslash #1}% if #2 is not empty
}

but \comp{Y}{X} gives Y\X instead of X\Y as wanted and \comp{Y} gives Y\ instead of the result of Y^c as wanted.

Optional arguments are usually set first and specified in brackets [] rather than braces {}.

With your code, if you type $\comp{Y}=Z$, the second argument is taken to be =, because of how TeX decides what the argument to a command is. Indeed, with

\newcommand{\comp}[2]{...}

the required arguments are two.

In my opinion, the optional argument should be the first, so you read

\comp[X]{Y}        \comp{Y}

as “the complement in X of Y” or “the complement of Y” respectively.

How to define that?

\usepackage{xifthen}

\newcommand{\comp}[2][]{\ifthenelse{\isempty{#1}}{#2^c}{#1\setminus#2}}

or

\usepackage{xparse}

\NewDocumentCommand{\comp}{om}{\IfNoValue{#1}{#2^c}{#1\setminus#2}}

Here is an alternative version that checks if the code following the first parameter starts with an opening brace {. If so it treats it as a second argument, otherwise it assumes only one argument is given. However, as this makes the code less readable and maintainable, I do not really recommend its usage.

The implementation uses \@ifnextchar to test for the following character after grabbing the first parameter, and then switches to either of the two implementations \comp@single or \comp@double.

\documentclass{article}

\makeatletter

\newcommand\comp[1]{%
\@ifnextchar\bgroup{\comp@double{#1}}{\comp@single{#1}}%
}
\newcommand\comp@single[1]{%
{{#1}^{c}}%
}
\newcommand\comp@double[2]{%
{#2 \backslash #1}%
}

\makeatother

\begin{document}

$\comp{Y}{X}$\par
$\comp{Y}$

\end{document}

outputs

An answer without ifthen package:

\documentclass[10pt,a4paper]{article}
\newcommand{\comp}[2][]{%
\def\FirstArg{#1}
\ifx\FirstArg\empty
\ensuremath{{#2}^{c}}% if #1 is empty
\else
\ensuremath{#2 \backslash #1}% if #2 is not empty
\fi
}
\begin{document}

$X\backslash Y$=\comp[Y]{X}

${Y}^{C}$=\comp{Y}
\end{document}

An answer with ifthen:

\documentclass[10pt,a4paper]{article}
\usepackage{ifthen}
\newcommand{\comp}[2][]{%
\ifthenelse{\equal{#1}{}}
{\ensuremath{{#2}^{c}}}% if #1 is empty
{\ensuremath{#2 \backslash #1}}% if #2 is not empty
}
\begin{document}

$X\backslash Y$=\comp[Y]{X}

${Y}^{C}$=\comp{Y}
\end{document}

Explaining:

A command has a defined number of arguments. If the arguments are mandatory (let's say 4) you have to define it like:

\newcommand{\mycommand}[4]{<Do things>}

If it has an optional argument {like in your case} it has to be the first one and (in case of 3 mandatory and an optional) you have to define it like:

\newcommand{\mycommand}[4][<First Argument Default Value>]{<Do things>}

The rest is the usage in your case (feel free to ask for anything not clear to you.).

• I'm not sure why you're suggesting $X\backslash Y$=\comp[Y]{X} which is wrong under semantic and typographic points of view. Oct 11 '19 at 7:35
• @egreg ... it is not my code ... It is op's code ... But still I am not sure about what exactly you mean here. Oct 11 '19 at 7:49
• OP's code? I see nothing similar to \ensuremath in the OP's code. The syntax you're suggesting, namely $Z$=\comp[Y]{X} is really wrong, not because of the order of the arguments (which is wrong as well), but semantically: that should be a single formula. Oct 11 '19 at 7:54
• @egreg ... I just added \ensuremath because OP ... talked about "\comp{Y}{X}" and not "$\comp{Y}{X}$" ... So, I thought it will be useful to him/her. This is why I just tested the command out of the math environment too. But thanks anyway for your comments ... Sure will help future visitors. PS: The part inside the document environment is just a test to show that this produces the desired order etc ... Not a typographic suggestion. Oct 11 '19 at 8:01