## Graph of points with unknown function – How to curve fit it?

So I’m in my physics lab trying to graph these points:

``data = {{-0.02, 1.9}, {-0.08, 1.8}, {-0.11, 1.7}, {-0.16, 1.6},{-0.22, 1.45}, {-0.28, 1.4}, {-0.35, 1.35}, {-0.40, 1.35}, {-0.45, 1.4}, {0.02, 1.9}, {0.08, 1.82}, {0.11, 1.7}, {0.16, 1.63}, {0.22, 1.45}, {0.28, 1.4}, {0.35, 1.3}, {0.40, 1.35}, {0.45, 1.4}} ``

And I was able to plot the points as:

``plot = ListPlot[data] ``

But I can’t make its fitting curve where it should look like this scheme: ## Unity world curve shader graph, how to start curving from a specific distance?

I’ve made simple world curving shader following some online tutorials and cleaning few things up. It’s doing its job, however I have small issue where it curves objects that are very close to a camera. So, I am trying to figure out how to start curving only if objects are certain distance form the camera, lets say 20 units or more?

Below is a sub-graph I use to output a value for a vertex position i.e. curve world shader, this is the one I need to figure out how to modify Posted on Categories Free Proxy

## I have a function f[b,d] that defines an implicit curve f[b,d]=0. I want to plot that implicit curve but it takes ages when using ContourPlot

I have a messy function `f[b,d]`. I need to plot the implicit curve `f[b,d]=0`, and I have tried with the classical function

``ContourPlot[f[b,d]==0,{b,-0.001,0.001},{d,0.03,0.05}] ``

but even after waiting for 6 hours, I have not been able to get an output.

I was thinking of using the method of Pseudo Arc-Length continuation to plot the function, but I have discovered that there is no general function for that. I have tried to implement the procedure written in the first answer of this page:

Is there any predictor-corrector method in Mathematica for solving nonlinear system of algebraic equations?

but I have not been able to adapt that code to my case.

In particular, after defining the function TrackRootPAL, I have run the following line:

``tr = TrackRootPAL[{f[b,d]}, {d}, {b, -0.001, 0.001}, 1.0011*10^(-5), {0.04}]; tempplot = Plot[Evaluate[d[b] /. tr]], {b, 0, 4}] ``

However, I get the following output: The function I am currently trying to plot is quite large (it has more than 100000 characters) so it cannot be copied over here but the code seems easy to adapt so if you need an example, I think you could try with `f[b,d]=b+d`. In fact, I get a similar problem with that function.

EDIT: I know that one zero of my complicated function `f[b,d]` is approximately located at `b=1.0011*10^(-5)` and `d=0.4`.

Posted on Categories cheapest proxies

## How to draw tangents to a curve and obtain the corresponding angle?

I’m trying to solve an equation and plot the solutions in the complex plane:

``   Solve[Rationalize[E^(-b (1.365)) + E^(-b (-0.350)) + E^(-b (-0.378)), 0] == 0, b]    ListPlot[ReIm[b /. % /. C -> 0], ImageSize -> Large] ``

Here is the plot: Now, I need to draw tangent lines on the middle curve at the point where it is crossing the real axis, and obtain the angle. It is possible to do it by hand on the paper, but can one also do it by Mathematica?

Posted on Categories cheapest proxies

## How to straighten a curve?

What’s the easiest way to get the following animation for a given parabola My main goal is the following, given a set of random points and a set of points following a parabola, I want to "straighten" the parabola and all the surrounding points according to the straightening of that parabola. Consider the following schematic For instance, we could consider the points as a starter

``f[x_, a_, b_] := a x^2 + b; pts1 = RandomReal[{-1, 1}, {150, 2}]; ptsf = RandomReal[{-1, 1}, 50]; pts2 = Map[{#, f[#, .5, -.5]} &, ptsf]; Graphics[{Gray, Point /@ pts1, Red, Point /@ pts2}] `` Where the red dots follow a parabola. How do change `pts1` based on `a` and `b`? From such a pattern, I’d expect, after the transformation, to get something like where the dots are sparser above the line and denser below it. I tried to make it work by using preservation of the arc length somehow, but it’s too slow.

## How to fit a curve in a picture with an equation?

For a curve taken from a picture, is there any method to fit it with an equation if it appears to be some standard curve?

For example, in the following picture, the curve looks like an ellipse or a circle or something else of a conic section. How can I fit the shape with a proper equation using Mathematica? Furthermore, is it possible to assess two different fittings with a criterion (e.g. error)? Thank you in advance. # The system

• The system relies on Traits and Skills (which both range from 0 to 6).
• Players rolls a number of d6 equal to the Skill they’re using.
• Any dice result equal or under the related Trait value is considered a success.

Example : Bob attacks an orc. He has a Melee Skill of 3 and a Strength Trait of 4. He rolls 3d6 and the results are: 2 5 3. He has 2 successes.

## Special cases

• The result of a dice is 1, the dice counts as 2 successes.

Example : Bob attacks again. He still rolls 3d6 and the results are: 1 3 6. He has 3 successes.

• The character does not have the required Skill, he rolls 1d6, only a result of 1 counts as 1 success (instead of 2), other values are failures.

Example : Bob tries to parry. Since he does not have the Parry skill, he rolls 1d6 and the result is a 2. He fails.

# My questions

How can I make sure that progression is "coherent"?

How are highly skilled characters better than those with good Traits? Is the last assumption even correct?

What would the success curve (skill over trait over difficulty) look like?

I’ve tried various things over excel and anydice but cannot comprehend the statistics or get formulas to work.

Finally, sorry for any grammar mistake, english is not my first language and thanks for the help.

## Plotting a normal curve over a histogram

I am teaching a basic introduction to normal curves, and the textbook introduces the topic with the idea of rolling five dice and recording the sum. Do this many times and create a histogram of the results. (which looks more and more like the normal curve as the number of trials increases) My "code" to simulate this for 10000 rolls is below.

``rolls = Table[Table[RandomChoice[Range], {5}], {10000}]; sums = Total /@ rolls; Histogram[sums, {0.5, 31.5, 1}] ``

I am way out of my depth here, but wondered if anyone could help with how to plot the "perfect" normal curve that would match the histogram?

I have the following to plot a normal curve, but for it to match the dice example, I need the mean and standard deviation, and how no idea what that would be.

``Plot[PDF[NormalDistribution[0, 1], x], {x, -3, 3}, Ticks -> None,   Axes -> None] ``

Any help is appreciated.

## How can I make a best fit curve from a dataset from specific data columns in order to display it with their respective points?

I’ve got the next dataset:

`` ArstreYSust = Dataset[{ <|"Velocidad [m/s]" -> 8,   "Fuerza de arrastre \[Theta]=2\[Degree] SIN FLAP [N]" -> 0.06,   "Fuerza de sustentación \[Theta]=2\[Degree] SIN FLAP [N]" ->    0.19, "Fuerza de arrastre \[Theta]=14\[Degree] SIN FLAP [N]" ->    0.14, "Fuerza de sustentación \[Theta]=14\[Degree] SIN FLAP \   [N]" -> 0.38,   "Fuerza de arrastre \[Theta]=20\[Degree] SIN FLAP [N]" -> 0.21,   "Fuerza de sustentación \[Theta]=20\[Degree] SIN FLAP [N]" ->    0.4, "Fuerza de arrastre \[Theta]=8\[Degree] CON FLAP [N]" ->    0.24, "Fuerza de sustentación \[Theta]=8\[Degree] CON FLAP [N]" \   -> 0.75|>,   <|"Velocidad [m/s]" -> 10,    "Fuerza de arrastre \[Theta]=2\[Degree] SIN FLAP [N]" -> 0.08,    "Fuerza de sustentación \[Theta]=2\[Degree] SIN FLAP [N]" ->    0.31, "Fuerza de arrastre \[Theta]=14\[Degree] SIN FLAP [N]" ->    0.2, "Fuerza de sustentación \[Theta]=14\[Degree] SIN FLAP [N]" \   -> 0.5, "Fuerza de arrastre \[Theta]=20\[Degree] SIN FLAP [N]" -> 0.3,   "Fuerza de sustentación \[Theta]=20\[Degree] SIN FLAP [N]" ->    0.68, "Fuerza de arrastre \[Theta]=8\[Degree] CON FLAP [N]" ->    0.35, "Fuerza de sustentación \[Theta]=8\[Degree] CON FLAP [N]" \   -> 1.36|>, <|"Velocidad [m/s]" -> 12,   "Fuerza de arrastre \[Theta]=2\[Degree] SIN FLAP [N]" -> 0.11,   "Fuerza de sustentación \[Theta]=2\[Degree] SIN FLAP [N]" ->    0.49, "Fuerza de arrastre \[Theta]=14\[Degree] SIN FLAP [N]" ->    0.28, "Fuerza de sustentación \[Theta]=14\[Degree] SIN FLAP \  [N]" -> 0.79,   "Fuerza de arrastre \[Theta]=20\[Degree] SIN FLAP [N]" -> 0.46,   "Fuerza de sustentación \[Theta]=20\[Degree] SIN FLAP [N]" ->    0.86, "Fuerza de arrastre \[Theta]=8\[Degree] CON FLAP [N]" ->    0.44, "Fuerza de sustentación \[Theta]=8\[Degree] CON FLAP [N]" \  -> 1.96|>, <|"Velocidad [m/s]" -> 14,   "Fuerza de arrastre \[Theta]=2\[Degree] SIN FLAP [N]" -> 0.15,   "Fuerza de sustentación \[Theta]=2\[Degree] SIN FLAP [N]" ->    0.72,   "Fuerza de arrastre \[Theta]=14\[Degree] SIN FLAP [N]" -> 0.4,   "Fuerza de sustentación \[Theta]=14\[Degree] SIN FLAP [N]" ->    1.12, "Fuerza de arrastre \[Theta]=20\[Degree] SIN FLAP [N]" ->    0.69, "Fuerza de sustentación \[Theta]=20\[Degree] SIN FLAP \  [N]" -> 1.32,   "Fuerza de arrastre \[Theta]=8\[Degree] CON FLAP [N]" -> 0.6,   "Fuerza de sustentación \[Theta]=8\[Degree] CON FLAP [N]" ->    3.17|>, <|"Velocidad [m/s]" -> 16,   "Fuerza de arrastre \[Theta]=2\[Degree] SIN FLAP [N]" -> 0.18,   "Fuerza de sustentación \[Theta]=2\[Degree] SIN FLAP [N]" -> 0.8,   "Fuerza de arrastre \[Theta]=14\[Degree] SIN FLAP [N]" -> 0.45,   "Fuerza de sustentación \[Theta]=14\[Degree] SIN FLAP [N]" ->    1.29, "Fuerza de arrastre \[Theta]=20\[Degree] SIN FLAP [N]" ->    0.78, "Fuerza de sustentación \[Theta]=20\[Degree] SIN FLAP \  [N]" -> 1.53,   "Fuerza de arrastre \[Theta]=8\[Degree] CON FLAP [N]" -> 0.71,   "Fuerza de sustentación \[Theta]=8\[Degree] CON FLAP [N]" ->    3.48|>}]; ``

BUt I don’t know how to build a fit curve directly from my dataset in order to include it in the show command. I need to do it this way for different columns.

## Exiting CrossSlidingDiscontinuity in NDSolve to follow equilibrium curve

I am trying to figure out how to get the solution curve to an `NDSolve` to slide along once it reaches a boundary and then to exit the `CrossSlidingDiscontinuity` once it reaches an equilbrium curve and follow the equilibrium curve back within a set boundary.

If the x[t] solution curve reaches the boundary edge on this interval [0,1] I needed it to slide along this boundary, hence I used `CrossSlidingDiscontinuity`. However once, the solution reaches the yellow equilibrium sine curve, I need it to exit the sliding discontinuity and follow the equilibrium curve. I tried using `EventLocator` (in the code below). It manages to fall back within [0,1] but does not follow the equilibrium sine curve. I attached the image of the plot below.

I also tried using two `WhenEvents` (one for when x[t] reaches 1 triggering the sliding and one where x[t] reaches the sine curve triggering to follow the sine curve) but only the sliding `WhenEvent` was triggered.

Here is my code:

``normalDE2[x_, t_] := -(x + 1/2)*(x - 1/2)*(x - (1 + .1*Sin[t]));  testDE3[x_?NumberQ, t_] :=  If[0 < x < 1, normalDE2[x, t], -1*normalDE2[x, t]];  sol4 = NDSolve[{x'[t] == testDE3[x[t], t], x == .75,  WhenEvent[{x[t] == 1, x[t] == 0},  {Print[t],"CrossSlidingDiscontinuity"}]},  x, {t, 0, 10}, Method -> {"EventLocator", "Event" -> {x[t] - (1 +.1*Sin[t])}, "EventAction" :> {{x[t] -> (1 + .1*Sin[t])}}}];  Plot[{x[t] /. sol4, (1 + .1*Sin[t])}, {t, 0, 10},  Frame -> True, GridLines -> Automatic]  `` Plot Image

Posted on Categories cheapest proxies