<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">AJCM</journal-id><journal-title-group><journal-title>American Journal of Computational Mathematics</journal-title></journal-title-group><issn pub-type="epub">2161-1203</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/ajcm.2022.122010</article-id><article-id pub-id-type="publisher-id">AJCM-117034</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Designing Physics Problems with &lt;i&gt;Mathematica&lt;/i&gt;
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Haiduke</surname><given-names>Sarafian</given-names></name><xref ref-type="aff" rid="aff1"><sub>1</sub></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>The Pennsylvania State University, University College, York, USA</addr-line></aff><pub-date pub-type="epub"><day>09</day><month>05</month><year>2022</year></pub-date><volume>12</volume><issue>02</issue><fpage>191</fpage><lpage>196</lpage><history><date date-type="received"><day>19,</day>	<month>March</month>	<year>2022</year></date><date date-type="rev-recd"><day>7,</day>	<month>May</month>	<year>2022</year>	</date><date date-type="accepted"><day>10,</day>	<month>May</month>	<year>2022</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  We envision utilizing the versatility of a Computer Algebra System, specifi
  cally &lt;i&gt;Mathematica&lt;/i&gt; to explore designing physics problems. As a focused project, we consider for instance a thermo-mechanical-physics problem showing its development
   
  from the ground up. Following the objectives of this investigation first by applying the fundamentals of physics principles we solve the problem symbolically.<b> </b>Applying the solution we investigate the sensitivities of the quantities of interest for various scenarios generating feasible numeric parameters.<b> </b>Although a physics problem is investigated, the proposed methodology may as well be applied to other scientific fields.<b> </b>The codes needed for this particular project are included enabling the interested reader to duplicate the results, extend and modify them as needed to explore various extended scenarios.
 
</p></abstract><kwd-group><kwd>Thermo-Mechanical Physics</kwd><kwd> Designing Physics Problems</kwd><kwd> Computer Algebra System</kwd><kwd> &lt;i&gt;Mathematica&lt;/i&gt;</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>The problem poses as a thermo-mechanical. It inherits both features; the thermodynamic side embodies a confined gas in a cylindrical vessel with a mobile piston; the mechanical side is a flexible spring. For the sake of simplicity, the gas and the spring both are considered ideal. <xref ref-type="fig" rid="fig1">Figure 1</xref> shows the setup of the problem.</p><p>A μ mole of the gas within the vessel of base area A and initial height of y at temperature T<sub>1</sub> generates pressure P<sub>1</sub>. In this version, we consider a massless piston. The alternate version may include a massive piston. The named parameters may be adjusted to counterbalance the atmospheric pressure P<sub>0</sub>. The piston is connected to a spring. The other end of the spring is tied to the stationary red rod shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>. The gas and the spring are subject to the ideal gas equation of state, Boyle’s law, and a linear spring, Hooke’s law, respectively [<xref ref-type="bibr" rid="scirp.117034-ref1">1</xref>].</p><p>This report is composed of three sections. In addition to the Introduction, Section 2 is the Procedure. Applying fundamental physics laws we craft the needed description of the proposed thermo-mechanical problem. Manipulating the needed equations we arrive at the final symbolic result. Instead of utilizing a “given” set of parameters, by applying Mathematica’s [<xref ref-type="bibr" rid="scirp.117034-ref2">2</xref>] numeric capabilities we explore the range of numeric parameters conducive to practical reasonable output. Utilizing one such set we objectively interpret the output. Whenever needed the results are accompanied by plots assisting to the insightfulness of the problem [<xref ref-type="bibr" rid="scirp.117034-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.117034-ref4">4</xref>]. We also embedded an animation code such that the interested reader readily may produce the results graphically. Section 3 is the Conclusions. Here we discuss the achieved goals and propose a modification to extend the future projects.</p></sec><sec id="s2"><title>2. Procedure</title><p>We begin by utilizing the fundamental physics principle applicable to the proposed problem. For an ideal gas, the equation of state is [<xref ref-type="bibr" rid="scirp.117034-ref1">1</xref>],</p><p>P 1 V 1 = μ R T 1 , (1)</p><p>we consider a cylindrical canister of equal diameter and height of 10.0 cm. The corresponding volume is 7.8 &#215; 10<sup>−3</sup> m<sup>3</sup>; this is about the volume of a one-liter plastic soda bottle. Assuming the room temperature is about ~27<sup>&#176;</sup> i.e. T<sub>1</sub> = 300.0 K. At one atmospheric pressure ~100 KPa (1) yields the number of moles, μ = 0.03. The corresponding number of the air molecules is ~0.18 &#215; 10<sup>23</sup>. Having this many molecules as schematically shown with the red dots in <xref ref-type="fig" rid="fig1">Figure 1</xref> we may apply the principle of Classical Mechanics in the Kinetic Theory of Gases [<xref ref-type="bibr" rid="scirp.117034-ref1">1</xref>] and/or the Maxwell-Boltzmann speed distribution [<xref ref-type="bibr" rid="scirp.117034-ref5">5</xref>] assisting to envision the mobile molecules producing the gas pressure, respectfully. The typical speed of</p><p>these molecules i.e. the Root-Mean-Square speed is v r m s = 3 R T m m o l . Applying</p><p>to air assuming being an ideal gas with a molar mass of 28.8 g/mol at mentioned temperature this gives ~510 m/s. For additional detailed C.F. [<xref ref-type="bibr" rid="scirp.117034-ref6">6</xref>].</p><p>Increasing the initial temperature to T<sub>2</sub> increases the molecular speeds and the interior pressure causing the spring to compress as shown in <xref ref-type="fig" rid="fig1">Figure 1</xref> by Δy. Assuming the piston at the end of each incremented temperature is in equilibrium the zero net force yields,</p><p>F s + A P 1 − A P 2 = 0 , (2)</p><p>where F<sub>s</sub> is the spring force, subject to Hooke’s law F<sub>s</sub> = kΔy and P<sub>1</sub>, P<sub>2</sub> are the initial and secondary gas pressures at initial and secondary temperatures.</p><p>Applying Boyle’s law for the second stage (1) yields,</p><p>P 2 ( V 1 + A Δ y ) = μ R T 2 , (3)</p><p>substituting P<sub>2</sub> from (3) andP<sub>1</sub> from (1) into (2) after simplification yields,</p><p>k Δ y 2 + ( μ R P 0 k A T 1 + A P 0 ) Δ y − μ R ( T 2 − T 1 ) = 0 . (4)</p><p>The first and second coefficients of the quadratic Equation (4) are always positive. Since we are considering increasing the temperature i.e. T<sub>2</sub> &gt; T<sub>1</sub> the 3rd term also always stays positive as well. In short, the discriminant of the quadratic (4) is always positive and larger than the 2nd term so that one of the roots of (4) is positive and the other negative. This observation leads to only one unique positive acceptable positive Δy&gt; 0. To set the parameters yielding to a reasonable compression Δy first we solve (4) symbolically and then explore values for the stiffness, k.</p><p>{ a , b , c } = { k , μ R P 0 k A T 1 + A P 0 , μ R ( t 2 − T 1 ) }</p><p>solΔy = Solve[(a Δy<sup>2</sup>+b Δy-c) = = 0,Δy];</p><p>Δy/.solΔy</p><p>{ − A P 0 − k R T 1 μ A P 0 − ( A P 0 + k R T 1 μ A P 0 ) 2 − 4 k ( R T 1 μ − R t 2 μ ) 2 k , − A P 0 − k R T 1 μ A P 0 + ( A P 0 + k R T 1 μ A P 0 ) 2 − 4 k ( R T 1 μ − R t 2 μ ) 2 k } (5)</p><p>as shown (5) only the second root is positive. <xref ref-type="fig" rid="fig2">Figure 2</xref> graphically justifies the observation.</p><p>Next, we store the relevant parameters in values,</p><p>values = {μ-&gt;0.03 moles,R-&gt;8.31 J/(mol. K), P0-&gt;1.01*10<sup>5</sup>Pa,A-&gt;7.8.*10<sup>−3</sup>m<sub>^3</sub> ,T1-&gt;300 K.}.</p><p>For a semi-stiff spring k = 500 N/m. Utilizing this we plot (4) vs its roots, see <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p><p>Plot[(aΔy<sup>2</sup>+bΔy − c)/.values/.k −&gt; 500/.t2 −&gt; T2/.T2 −&gt;500,{Δy,−2.,0.2}, PlotStyle −&gt; Black,GridLines → Automatic,AxesLabel] → {&quot;Δy&quot;, &quot;left side of (4)&quot;}]</p><p>For a test drive, we run the positive root of (5) at a typical temperature T<sub>2</sub> = 500 K for a range of stiffness-es, k. One of the objectives of this report is to investigate what is the reasonable range of the parameters conducive to a practical output. Assuming the final temperature is e.g., T<sub>2</sub> = 500 K or any reasonable temperature we consider springs with stiffness 100 ≤ k ≤ 1000 N/m. The lower limit corresponds to a semi-soft and the upper limit to a hard spring. The search results are tabulated in <xref ref-type="table" rid="table1">Table 1</xref>.</p><p><xref ref-type="table" rid="table1">Table 1</xref> shows as expected the soft spring with the stiffness of k = 100 N/m is compressed more than a hard spring with the stiffness of k = 1000 N/m. Note, the entire calculation of this report is carried out in the MKS units, however, for practical purposes, the compressed lengths are in cm; as shown the compressions are practically reasonable.</p><p>For the rest of the computation, we select a stiffness of k = 500 N/m. To stress the thermodynamic aspect of the report we plot the compression length Δy vs. the secondary temperature, T<sub>2</sub>. See <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p><p>Motivated by the linearity of the shown graph we looked into the functional behavior of (5). The root square of the discriminant is Δ = b 2 − 4 a c . Because</p><p>b 2 ≫ 4 a c , we write Δ = b 1 − 4 a c b 2 ~ b − 2 a c b . This simplifies the positive root of (5) i.e. Δ y ~ − c b ~ T 2 . Indeed this justifies the linearity relationship shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p><p>And, finally putting all the information together we craft a code with a desired graphic output (<xref ref-type="fig" rid="fig4">Figure 4</xref>).</p><p>Plot[(aΔy<sup>2</sup>+bΔy-c)/.values/.k-&gt;500/.t2-&gt;T2,{Δy,-0.01,0.2},PlotRange-&gt;{{0,0.2}, {-5.,40}},AxesLabel→{“Δy(m)”,None},GridLines→Automatic,PlotLabel→StringJoin[“T2(k) = “,ToString[T2]]], Graphics[{Red,,PointSize[0.03],Point[{Δy/.solΔy 〚2〛/.values/.{k-&gt;500}/.t2-&gt;T2,0}]},PlotRange→{{0,0.1},{-5.,40}}]],{t2,Δy/.solΔy〚2〛}/.values/.k-&gt;500/.t2-&gt;T2},{T2,300,1000,5}]</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Stiffness vs. the compression length. These are calculated at temperature T<sub>2</sub> = 500 K</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >k (N/m)</th><th align="center" valign="middle" >Δy (cm)</th></tr></thead><tr><td align="center" valign="middle" >100</td><td align="center" valign="middle" >6.205</td></tr><tr><td align="center" valign="middle" >200</td><td align="center" valign="middle" >6.088</td></tr><tr><td align="center" valign="middle" >300</td><td align="center" valign="middle" >5.976</td></tr><tr><td align="center" valign="middle" >400</td><td align="center" valign="middle" >5.871</td></tr><tr><td align="center" valign="middle" >500</td><td align="center" valign="middle" >5.77</td></tr><tr><td align="center" valign="middle" >600</td><td align="center" valign="middle" >5.673</td></tr><tr><td align="center" valign="middle" >700</td><td align="center" valign="middle" >5.581</td></tr><tr><td align="center" valign="middle" >800</td><td align="center" valign="middle" >5.493</td></tr><tr><td align="center" valign="middle" >900</td><td align="center" valign="middle" >5.408</td></tr><tr><td align="center" valign="middle" >1000</td><td align="center" valign="middle" >5.326</td></tr></tbody></table></table-wrap><p>Running this animation yields the plot of the solution of (4), vs. the compression Δy. The blue curve is the magnified black curve shown in the first quadrant of <xref ref-type="fig" rid="fig2">Figure 2</xref>. The positive root of (5) is shown with a red dot along the horizontal axis. The Plot Title is an automated counter showing the temperature variation, the far-right list is an automated contour displaying the temperature and its associated Δy in meters.</p></sec><sec id="s3"><title>3. Conclusion</title><p>In this report, we show the steps for seeking feasible parameters designing a physics problem conducive to a meaningful outcome that has a mixture of two flavors from two areas of physics; thermodynamics and mechanics. The objective is merely not to solve the proposed problem per se but rather to deduce a systematic solution conducive to exploring the range of numeric parameters to a meaningful practical output. The interested reader may expand on the given problem by for instance considering scenarios such as a massive piston, a non-ideal spring, a non-ideal gas, etc. As such for instance replacing the massless piston with a heavy one (2) modifies as F s → F s + m g , where the added term is the weight of the piston. All the needed codes to investigate the modified version are embedded in bold-face in the report.</p></sec><sec id="s4"><title>Acknowledgements</title><p>The author acknowledges the John T. and Page S. Smith Professorship funds for completing and publishing this work.</p></sec><sec id="s5"><title>Conflicts of Interest</title><p>The author declares no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s6"><title>Cite this paper</title><p>Sarafian, H. (2022) Designing Physics Problems with Mathematica. American Journal of Computational Mathematics, 12, 191-196. https://doi.org/10.4236/ajcm.2022.122010</p></sec></body><back><ref-list><title>References</title><ref id="scirp.117034-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Halliday, D., Resnick, R. and Walker, J. (2021) Fundamentals of Physics. 11th Edition, John Wiley &amp; Sons, Inc., New Jersey.</mixed-citation></ref><ref id="scirp.117034-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Mathematica&amp;#174 V13.0. (2021) http://Wolfram.com</mixed-citation></ref><ref id="scirp.117034-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Wolfram, S. (2003) Mathematica Book. 5th Edition, Cambridge University Press, New York.</mixed-citation></ref><ref id="scirp.117034-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Sarafian, H. (2019) Mathematica Graphics Examples. 2nd Edition, Scientific Research Publishing, Wuhan.</mixed-citation></ref><ref id="scirp.117034-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Longair, M.S. (1984) Theoretical Concepts in Physics. Cambridge University Press, New York.</mixed-citation></ref><ref id="scirp.117034-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Sarafian, H. (2022) Maxwell-Boltzmann Distribution, Mathematica Based Practitioner’s Approach. American Journal of Computational Mathematics, 12, 79-86. https://doi.org/10.4236/ajcm.2022.121006</mixed-citation></ref></ref-list></back></article>