2
$\begingroup$

I am not absolutely sure how to formulate my question but here is my first attempt:

I have 25 rods with lengths in cm

chordlength={295.21, 295.21, 294.755, 293.27, 291.085, 288.395, 284.575, 279.89,
    275.225, 269.995, 263.84, 256.695, 247.85, 238.06, 228.83, 219.175,
    208.08, 196.945, 184.89, 170.95, 155.815, 138.73, 118.755, 97.805,
    78.055}

and than I defined two possible force densities applied on the same rod

DensityTop = 
  Table[With[{j = j}, ((# - 0.6*chordlength[[j]]/10^2)^2 + .2) &], {j,
     1,25, 1}];
DensityBtm = 
  Table[With[{j = j},1 &], {j,
     1, 25, 1}];

As you can see, DensityTop is quadratic while DensityBtm is constant.

Now my idea (to be more accurate: what I really wanted and need to do) was that if I would plot the data, all the plots would look exactly the same as the first one except the scale on the x axis should change.

BUT if I actually plot them:

Table[Plot[{DensityTop[[j]][x], DensityBtm[[j]][x]}, {x, 0, 
   chordlength[[j]]/10^2}, Filling -> Axis, 
  PlotStyle -> {Gray, Orange}, 
  FrameLabel -> {StandardForm["Profile length [m]"], 
    StandardForm["Force density [N/m]"]}, 
  PlotLegends -> {StandardForm["Top"], StandardForm["Bottom"]}, 
  ImageSize -> 600, PlotLabel -> StandardForm[N[j]"Cell"], 
  Frame -> True, PlotRange -> All], {j, 1, 25, 
  1}]

You can see that the plots are far away from being the same! Let me know if the problem is not clear and please help me to find a solution.

I just want the exact same force density applied to all 25 rods with different lengths. By the same force density I mean: The same distribution.

EDIT: Since the problem was not clear I added the following:

Ok, so I have 25 rods. Each rod with different length. And than I apply some ARBITRARY force density to them. For example something looking like this. enter image description here

I deliberately deleted the ticks on both axes because they are not important. The only two things important are:

  • the shape of the force density function, which has to be the same for all rods! (Not important information: on the attached picture, the function is Sinc[x]*(x^3 + (x - 1)^2 + x) + 25 and I made it up.)

  • length of the rod.

Maybe this is a bit more clear now. In case not, here is another example. Lets say my force density is a sum of Heaviside functions $$f(x)=\lambda [\Theta(x-\frac{2}{10}L)-\Theta(x-\frac{4}{10}L)]+\mu [\Theta(x-\frac{6}{10}L)-\Theta(x-\frac{8}{10}L)]$$ where first step begins at 20% of the total Length $L$ and ends at 40%, and the second step is from 60-80%. This would look something similar to this: enter image description here And this is the force density I want to apply to each rod. And this is also the case that works exactly as I want it to. All rods will experience absolutely NO force from 0-20%, than $\lambda$ force from 20-40%, than again nothing from 40-60% and $\mu$ force from 60-80% and finally again nothing from 80-100%.

It's rather simple to do it with Heaviside functions but my needs go beyond unrealistic case of Heaviside functions. A quadratic force density is more realistic or maybe something even more complicated. But each rod has to have the same force density applied, meaning:

  • if the fist rod has minimum force at 60%, all others have the same.

  • if force density reaches maximum at 30% it has to at all rods. And The difference between minimum and maximum has to be the same for all rods.

  • If $$\frac{f(x=0)}{f(x=L)}=0.02$$ for the first rod, than this has to apply for all other 24 rods.

Now I think I can't explain in more details than I just did. Hopefully that is good enough.

$\endgroup$
  • 1
    $\begingroup$ it is not clear what you want. The same y-axis scaling? Each plot has a different x-range and a different function, in what way should they be "exactly" the same? $\endgroup$ – george2079 Sep 8 '15 at 14:12
  • $\begingroup$ Hard to understand what you are trying to do here, but I'm almost sure you want to change the definition of DensityTop to something like DensityTop = Table[With[{cl = chordlength[[j]]}, ((# - 0.6*cl/10^2)^2 + .2) &], {j, 1, 25, 1}]. Also, you want to avoid upercase variable names. $\endgroup$ – rhermans Sep 8 '15 at 14:20
  • $\begingroup$ The same y-axis scaling, yes! Let me describe a rather basic example. Let the force density be $f(x)=(x-0.6\cdot L)^2$ for L=chordlength[[j]] in the OP. Now I want $f(x=0)$ and $f(x=L)$ and minimum value at 60% ... I want those three values to be fixed for all rods (for all $L$) and quadratic function inbetween. Does that make more sense? $\endgroup$ – skrat Sep 8 '15 at 14:23
  • $\begingroup$ Are you asking how to construct a quadratic that passes through three prescribed points? $\endgroup$ – george2079 Sep 8 '15 at 14:29
  • 1
    $\begingroup$ @skrat It seems that you only need to apply Rescale[ ] to the x coordinate ... $\endgroup$ – Dr. belisarius Sep 8 '15 at 18:48
4
$\begingroup$

Try this:

DensityTop = 
    Table[With[{j = j, 
          lnorm = chordlength[[1]]/chordlength[[j]]}, 
            (.2 + 
             36.*^-6 chordlength[[1]]^2 - 
             0.012 chordlength[[1]] (# lnorm) + 
             (# lnorm)^2 ) &],
     {j, 1, 25, 1}];

enter image description here

Note this is a different result from the other answer, which should illustrate the question is still unclear.

$\endgroup$
  • $\begingroup$ This seems to do exactly what I want but I have no idea how you got this result (for example those factors 0.012 and 36.*^-6... Also I am afraid this is limited to quadratic functions only. $\endgroup$ – skrat Sep 9 '15 at 7:31
  • 1
    $\begingroup$ I found the three points from the first curve and derived a formula for a quadratic to pass through those points for the other curves. $\endgroup$ – george2079 Sep 9 '15 at 13:45
1
$\begingroup$
Partition[Table[Plot[{
     DensityTop[[j]][x],
     DensityBtm[[j]][x]},
    {x, 
     h /. Solve[DensityTop[[1]][0] == DensityTop[[j]][h], h][[1]], 
     h /. Solve[DensityTop[[1]][chordlength[[1]]/10^2] == DensityTop[[j]][h], h][[-1]]}, 
      Filling -> Axis, PlotStyle -> {Gray, Orange}, 
      PlotLabel -> j, Frame -> True, PlotRange -> All], {j, 1, 25, 1}], 
      5] // GraphicsGrid

Mathematica graphics

$\endgroup$
  • $\begingroup$ Belisarius, I have edited my OP because my explanation of the problem was really bad. Hopefully things got a bit better with my EDIT. Thank you for the time you spent to find this solution! $\endgroup$ – skrat Sep 8 '15 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.