Skip to main content
Engineering LibreTexts

22: Storage of tests of Libretext's ability

  • Page ID
    43172
  • Hi Anonymous User,

    Ok the style sheets on this system are incredibly inconsistent so sometimes you need to do things one way and sometimes another way. Just going to have to figure it out by trial and error.

    Note: /html control does not really give you /html control...it is normally corrected by the style sheets again, but not always...it requires hours of trial and error to figure out what works and what doesn't...but R says it is the same on her NASA sheets, so maybe this is an overall problem with todays way of doing things.

    Help in one end makes it difficult in the other end...ah! Another learning lesson that I will not give the students until they are ready to be masters...:)

    In this particular list I use dl class="EXPAND_COLLAPSE" but in others this dl will fail (maybe in sections?) so you need to do just <dl>. Symptoms of failure is that the list will expand then collapse immediately...that is when you should just use <dl>...a bit strange...need to understand this better.

    What is an engineer? Discuss in class or with friends. Note there is not just one answer as with anything in the real world definitions can be complex with multiple subtleties, but there is one specific word that is a must.

    ¬ A person who applies science and mathematics to produce a product?
    This could describe an engineer, but doesn't it also describe artists and scientists (among others)? A professional artist might mix elements together to produce a specific effect ("chemistry of paint") and use mathematics to produce a pleasing image ("divine proportions").

    Testing having another paragraph in this list....did it work? Yes

     
    ¬ A person who fixes things?
    No this is not an engineer. This is more of a technician or even just a repair person. An engineer may fix things, but that does not define an engineer, just like you fixing the plumbing in your house does not make you a plumber.
    printf('Hello world!')
    pkg load optim
    pkg list
     
    So this is an attempt just to use dl here...it does not work. This could be because this is a "chapter" not a "section"...section rules seem to be different then chapter rules. Need to be careful.
     
    ¬ A person who applies science and mathematics to produce a product?
    This could describe an engineer, but doesn't it also describe artists and scientists (among others)? A professional artist might mix elements together to produce a specific effect ("chemistry of paint") and use mathematics to produce a pleasing image ("divine proportions").

    Testing having another paragraph in this list....did it work? Yes

    ¬ A person who fixes things?
    No this is not an engineer. This is more of a technician or even just a repair person. An engineer may fix things, but that does not define an engineer, just like you fixing the plumbing in your house does not make you a plumber.

    Some equations tests:

    \[\frac{dx}{dy} = \lim_{y \to -\infty} \frac{\Delta x}{\Delta y}\]

    \[\frac{\partial{x}}{\partial{y}}\]

    Above was wrong (opps, I know better than that...mental burp...) but it does tell me how to do infty...

    Below is right.

    \[\frac{dx}{dy} = \lim_{y \to 0} \frac{\Delta x}{\Delta y}\]

    -------

    Something useful...how to do matrix in latex

    column:

    \[\vec{x} = \left(\array{x \\ y \\ z}\right)\]

    or row

    \[\vec{x} = \left(\array{x & y & z}\right) = \left(\array{i & j & k}\right)\]

    Another cool thing is doing inline equations where we need to use a "\ and a ( together" and then a ") and a \ together" instead of the "$$". Here is our tensor inline, \(\overleftrightarrow{I}\).

    10 ⅔ meters per seconds (mps)...for "vulgar" fractions (which just means common fractions) use "&frac23;"

    Let us say a car is moving at 10 ⅔ meters per second (mps), how long does it take for it to go 5 ⅘ meters? Try this problem in class and discuss the answer.

    ¬The answer is...
    The answer is 87 ⁄ 160 seconds (about a half of a second). Sometimes people with perfectly excellent math skills get this problem wrong. One of the most common answers to this question is 160 ⁄ 87 seconds (this is wrong!). Why is that? The simple answer, because people don't take the time to check their units. Generally they know what the unit should be but they don't check to see if their procedure will get that unit. Lets do a unit check. Let us first try each possible unit combination :$$\frac{meters}{seconds} + meters$$Ok this clearly can't be done, the units are not alike and there is no way to convert one to the other, so as suspected addition (and by association subtraction) is not the way to solve this. Ok we did the obvious, lets go to less obvious now. $$\frac{meter}{seconds} \times meters = \frac{meters^2}{seconds}$$Ok this also is not going to work. You probably suspected that, but did you check the units? Next division, but here we have two possibilities because division is not commutative (at least not until you make it multiplication). $$\frac{meters}{seconds} \div \frac{meters}{1} = \frac{\cancel{meters}}{seconds} \times \frac{1}{\cancel{meters}} = \frac{1}{seconds}$$Hmmm...looks kinda of right, but it is wrong. Dividing this way is the reason that 160 ⁄ 87 (the unit is "assumed" not checked) is one of the most common erroneous answers. Let's check the right way for completeness sake. $$\frac{meters}{1} \div \frac{meters}{seconds} = \frac{\cancel{meters}}{1} \times \frac{seconds}{\cancel{meters}} = {seconds}$$So now this gets us the right units and hence the right answer. Note this is a rather easy example (and can be done in your head), when problems get tougher (and can't be done in your head) this unit check can be used to help ensure you are getting the correct answer (sometimes it can even help you "remember" your formulas).

    How to do sums and integrals and tabs (\quad,\qquad, and \hspace) for a space just use "\ "

    \[\sum F_s = 0 \ \sum F_x = 0 \quad \sum F_y = 0 \qquad \sum F_z = 0 \hspace{15mm} \int f(x)dx\]

    Integrals are \int....the vertical line from a solution of an integral:

    \[A = \left. \theta \right|_0^{2\pi}\]

    or

    \[A = \theta \vert_0^{2\pi}\]

    or

    \[A = \theta \Biggr|_0^{2\pi}\]

    Gif animations work...This is a simulation from Wikipedia (public domain) of moment of inertia...

    Rolling_Racers_-_Moment_of_inertia.gif

    What can I do in a math function (you know the "$$" stuff or the "\(" stuff). We can do text and arrows...watch...(rightarrow, leftarrow, uparrow, downarrow and \text, \textbf, etc...Note \textnormal does not seem to work here...)

    \[\text{apples} = \textbf{apples} = \textit{apples} \rightarrow \textrm{oranges} \uparrow \downarrow \textbf{fruit} \leftarrow \text{What?}\]

    Note here we used textbf but for math you would want to use \mathbf

    \[\mathbf{\ddot{x}}\]

    Testing a function...this works...now more complicated....

    sombrero()

    Oh my gosh! This works...awesome...I can do more then what I thought I could...

    Ok now we are going to test writing a file...this would require some place to write this, so we will look for error actually. Ok THIS WORKS in the binder; surprise!!!

    % 
    % Test of reading and writing files in libretext, very small file, for real work
    % Use your own computer and octave (free!)
    %
    function nul = readwritefile()
    %
    %
    num1 = [1,2,3];
    num2 = [];
    sznum1 = size(num1);
    %
    % Note there are many commands to write a file in octave including 
    % fprintf (which we use here), fputs, fwrite, dlmwrite, etc...
    % this does not include octaves own method of 
    % saving matricies (for a much faster access) of just "save"...the better way to go for 
    % mathematical work...
    %
    fidw = fopen("testfile","w");
    for i = 1:sznum1(2)
        fprintf(fidw,"%d\n",num1(i))
        disp("Wrote in testfile"), disp(num1(i))
    end %for
    fclose(fidw);
    disp("File written and closed")
    disp("Now we will read it and print the result")
    %
    % Note there are many commands to read a file in octave including 
    % fgets (which we use here), fread, fscanf, dlmread, importdata, etc....
    % this does not include ocaves own method of 
    % reading its matricies (for much faster access) of just "load"
    %
    fidr = fopen("testfile","r");
    test = fgets(fidr);
    do
        rnumber = str2num(test);
        num2 = [num2,rnumber];
        test = fgets(fidr);
    until(test == -1)
    for i = 1:sznum1(2)
        disp(num2(i))
    end %for
    disp("This is the end - JM")
    return
    end
    
    readwritefile()

    Ok some comments on the align feature. In general it is not something that should be used all the time, but it has it uses in situations like this.

    \[\begin{align*} &3= A+B\\[4pt] &\underline{0= -A+2B}\\[4pt] &3= 0+3B\\[4pt] &1= B \end{align*}\]

    Note there is a * in these aligns, that seems to shut of the ability to reference labels, so don't do * if you want to reference an equation.

    \[\cancel{a}\]

    \[\bcancel{a}\]

    \[\xcancel{a}\]



    Don't delete this templat.showorg thing....just don't...no...no....no...no...no

      • Was this article helpful?