Calculation of IRR using Secant Method
πŸ‘︎ 6
πŸ’¬︎
πŸ“…︎ May 19 2021
🚨︎ report
Grrrr. Spent 12 hours replacing offset functions to find out Goal Seek is volatile as well. Trying to implement Secant method + application.calculate in VBA to replace full volatility.

Hey folks,

Been trying to speed up a large model and spent a lot of time replacing OFFSET functions with INDEX, but my end use case is to use goal seek via a macro. Learned today that goal seek itself is volatile, so I'm trying to setup a Secant macro that replaces Goal Seek. Trying to get this right but having a hard time moving from pure code to workbook input/output with ranges.

Worksheet Setup MVE:

  • D7:K7 = 15000 in each cell
  • C8 = -100000; named "changing_value"
  • C9:L9 =Sum(C7:C8)... Sum(L7:L8)
  • B9 = IRR(C9:L9); named "result"
  • A4 = 12%; named "target_value"

B9 should result in a 6.46% IRR here. When solved to 12%, "changing_value" should solve from 100,000 to 79,925.

Code attempt (based off this example):

Function Secant(X0 As Double, X1 As Double) As Double

' Returns the root of a function of the form F(x) = 0

' using the Secant method.

' X1 is a first guess at the value of x that solves the equation

' X0 is a "previous" value not equal to X1.

' This function assumes there is an external function named FS that

' represents the function whose root is to be solved

Dim X As Double 'the current guess for root being sought

Dim Xold As Double 'previous guess for root being sought

Dim DeltaX As Double

Dim Iter As Integer 'iteration counter

Const Tol = 0.00000001 'convergence tolerance

Xold = X0

X = X1

'permit a maximum of 100 iterations

For Iter = 1 To 100

application.calculate

DeltaX = (X - Xold) / (1 - delta(Range("changing_var"), Xold) / delta(Range("changing_var"), X)) ' tried to create my own function below

X = X - DeltaX

If Abs(DeltaX) < Tol Then GoTo Solution

Next Iter

MsgBox "No root found", vbExclamation, "Secant result"

Solution:

Secant = X

End Function

Private Function delta(target As Range, current As Range)

result = target.Value - current.Value

End Function

I've been staring at this for 2 hours now and it has to be an easy solution that I'm just missing - apologies for the amateur VBA attempt :).

πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/tastingsilver
πŸ“…︎ Feb 03 2021
🚨︎ report
Numerical Analysis: why is the order of convergence of the secant method equal to the golden ratio?

Wikipedia page for reference. Particularly the Convergence section.

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/DatBoi_BP
πŸ“…︎ Oct 27 2020
🚨︎ report
SECANT: a biology-guided semi-supervised method for clustering, classification, and annotation of single-cell multi-omics biorxiv.org/content/10.11…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/sburgess86
πŸ“…︎ Nov 09 2020
🚨︎ report
Secant Method
clear;
clc;
syms x
y=input('Enter the function >> \n');
ezplot(y);
grid on;
tol=input('Enter the margin of error >> \n ');
x1=input('Enter x0 value >> \n ');
x2=input('Enter x1 value >>\n ');
y=inline(y);
cantit=0;
while true
    xn=x1-(y(x1)*((x1-x2)/(y(x1)-y(x2))));
    error= abs(xn-x1);
    x1=xn;
    x2=x1;
    cantit= cantit+1;
    if error<tol
        break
    end   
end
disp('---------------------------')
disp('The root is >> ');
disp(xn)
disp('The error is >> ')
disp(error)
disp('Number of iterations');
disp(cantit)

I made this code to calculate the root of a function with the Secant Method.

The output is: 10 eval(INLINE_INPUTEXPR_);

I think it s like an infinite loop but i m not sure.

Thanks for your help,

Regards :D

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/juan_mdq
πŸ“…︎ Apr 05 2020
🚨︎ report
Derivation of Secant Method: Approach 1 youtube.com/watch?v=jXIUi…
πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/Aculisme
πŸ“…︎ May 20 2019
🚨︎ report
Root Finding - Secant Iteration Method

Ive arrived at the 13th iteration and I've noticed a pattern. x10=0.2417; x11=0.24164; x12=0.2417; x13=0.24164. Can anyone shed any light as to why this is happening? I used the Newton/Raphson method which gave me an x value of 2.417.

πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Jul 07 2015
🚨︎ report
Comparing the Newton-Raphson and secant methods.

I know that the secant method is somewhat similar to the Newton-Raphson method. What are the advantages and disadvantages of these 2 methods relative to each other? Any links to articles or websites on this topic would also be appreciated.

Thanks!

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/madmissileer
πŸ“…︎ Nov 05 2013
🚨︎ report
ADASECANT: Robust Adaptive Secant Method for Stochastic Gradient. (arXiv:1412.7419v1 [cs.LG] CROSS LISTED) arxiv.org/abs/1412.7419
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/arXibot
πŸ“…︎ Dec 30 2014
🚨︎ report
[O-Levels] AMath Revision Checklist / Notes (Most chapters)

Putting this here if it helps anyone w/ paper 1 tmrw, jiayous

A1: Completing the square, finding max/min coordinates of function (parabola) (ax+b)^(2) + c in the form of (-b/a, c);

Usage of a, b and c in ax^(2)+bx+c to find whether a parabola is upside down, if it's above/below the X axis, left/right of Y axis for turning pt

A2: Using discriminant b^(2)-4ac = (one real root), > (2 real roots), and < (no real roots) 0 to determine if a curve crosses the X-axis. If QN ask for f(x)=g(x) and check if they have solutions, make f(x)-g(x)=0 and manipulate into the form b^(2)-4ac

Linear and quadratic inequalities, remember cannot multiply by x throughout cos u don't know if x is +/- and might flip inequality sign, for number line β€’ means "or equals to" while 。means strictly greater/lesser.

A3: Rules of surds {A, B ∈ N : Let N = sqrt(n)}, A x B = AB = sqrt(ab), A x A = a, aA x bB = abAB; Rationalizing the denominator by use of multiplying by the conjugate [if denominator is a + B, multiply by (a-B)/(a-B)]; also linking surds to indices through A = a^(1/2) and cbrt(a) = a^(1/3) and so on.

A4: Notation of f(x), g(x) and h(x) to represent a continuous and differentiable function, where f(n) represents substitution of value "n" into the function; i.e. f(x) = x^(3) , then f(2) = 8;

Long division (to solve cubics and for partial fractions);

Usage of remainder theorem [division of f(x) by (x-a) will give f(a) as a remainder], and factor theorem [if f(b) = 0, then (x-b) is a factor] - QN can also give functions with unknown constants like h(x) = ax^(2) + 3x + b + 1, and say given h(n) = (some number), (and some other condition), find a and b;

Partial fractions | denominators : result;

(ax+b)(cx+d) : A/(ax+b) + B/(cx+D);

(ax+b)(cx+d)^(2) : A/(ax+b) + B/(cx+d) + C/(cx+d)^(2) ;

(ax+b)(x^(2)+c^(2)) : A/(ax+b) + (Bx+C)/(x^(2)+c^(2))

A5: Usage of notation n! and ^(n)Cr (second one can press calculator), finding the general form of an expansion and determining properties of coefficient of x or degree of x (like why x's degree can never be even), and using the general form to find the term for a specific degree of x, for example x^(8-2r) and if you want to find the term with x^(4), you can get r = 2; (tons of examples I can't cover for this one, feel free to comment below if you have questions)

A6: Graphs of a^(x) , e^(x), logx, lnx, the laws of logarithms

log(ab) = log(a) + log(b);

log(a/b) = log(a) - log(b);

log(a^(b)) = blog(a)

(assume

... keep reading on reddit ➑

πŸ‘︎ 212
πŸ’¬︎
πŸ‘€︎ u/totallynotsusalt
πŸ“…︎ Oct 24 2021
🚨︎ report
Reducing Costs For Molybdenum Part?

I have been working on new ammunition for awhile and found what I thought would be great solution for the core material, Molybdenum! The price per KG was a lot lower than Tungsten, around the same price as Nickel, easy machine-ability, high strength, decent density, good ductility, etc. All is good right?

Then I get my first quote back. $5.5 a core...for ammunition... That is obviously not feasible, even if my ammo offers great benefits. Now when I compare that to M995, which is a Tungsten Carbide core bullet of the same caliber it gets even worse. According to this: https://www.globalsecurity.org/military/library/budget/fy2011/army/020110-ammo.pdf the unit cost for M995 is ~$1.77. How? Tungsten is almost twice as expensive and we are using nearly the same mass and shape, how can there be a huge divide? It isn't like they are producing so much of it that it is much cheaper, the Army only bought under 2000 cartridges in 2012. According to that data and the cost of tungsten, they should be selling at a huge deficit of over $4 a round. But that clearly isn't the case, or they certainly wouldn't be selling it at that price.

Surely I have to missing something on why their costs are 1/3rd of my core cost? To give a rough idea of the bullet without dropping the drawings, it has an 8 secant ogive, .190in diameter, .88in long, and ends with a boat-tail. So it is an easy part to machine to shape, a simple CNC lathe could do the part.

Is there another method I can make these cores that aren't so expensive? Casting would be ideal but clearly that isn't a case with Moly's high melting point. Powdered seem like an option, but I have insufficient information on it and don't know if it would be too brittle/disintegrate against hard targets. Additionally I have only found one place that can do Molybdenum powder parts. I am looking into Moly-Copper Alloys to reduce costs but I doubt it will be as low as I need them or rival M995 cost.

What can I do here? I can't change to a steel alloy, or a ton of other materials because the law (one or a combination of tungsten alloys, steel, iron, brass, bronze, beryllium copper, or depleted uranium). I know Moly will work, and it should be cheaper then a tungsten core, I have to missing something that can be done to drastically reduce the costs.

Any ideas or suggestions are greatly appreciated!

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/Homeboi-Jesus
πŸ“…︎ Dec 17 2021
🚨︎ report
SERIOUS: This subreddit needs to understand what a "dad joke" really means.

I don't want to step on anybody's toes here, but the amount of non-dad jokes here in this subreddit really annoys me. First of all, dad jokes CAN be NSFW, it clearly says so in the sub rules. Secondly, it doesn't automatically make it a dad joke if it's from a conversation between you and your child. Most importantly, the jokes that your CHILDREN tell YOU are not dad jokes. The point of a dad joke is that it's so cheesy only a dad who's trying to be funny would make such a joke. That's it. They are stupid plays on words, lame puns and so on. There has to be a clever pun or wordplay for it to be considered a dad joke.

Again, to all the fellow dads, I apologise if I'm sounding too harsh. But I just needed to get it off my chest.

πŸ‘︎ 17k
πŸ’¬︎
πŸ‘€︎ u/anywhereiroa
πŸ“…︎ Jan 15 2022
🚨︎ report
Why does ln(x) not show up in differential equations?

For the record, I'm a senior in aerospace engineering. I'm in a controls engineering class, and have had two differential equations classes, one linear algebra class, and a signals analysis class which have all given me lots of exposure to euler's formula and its relationship with differential equations. I still think it's a stunning equation. It allows us to set up descriptions for natural phenomena using differential equations, and (sometimes) solve them neatly with combinations of polynomials, exponentials, sine, and cosine. In particular, most of the solutions we use involve Laplace transforms, so I understand this may limit my perspective.

However, I'm confused as to why ln(x) never comes up as a solution to some of these equations. Euler's formula allows for solutions of negative and complex inputs to ln(x), yet ln(x) never pops out as a solution. Why is it so rare when describing physical systems? Is there a genuine mathematical reason, or is it mostly a product of the examples we're given and the problem-solving methods we use? For that matter, why don't I see tangent, cotangent, secant and cosecant more often in solutions to mass spring damper systems or other controls problems? Thanks!

πŸ‘︎ 102
πŸ’¬︎
πŸ‘€︎ u/GenerationSelfie2
πŸ“…︎ Nov 08 2021
🚨︎ report
Just because it's a joke, doesn't mean it's a dad joke

Alot of great jokes get posted here! However just because you have a joke, doesn't mean it's a dad joke.

THIS IS NOT ABOUT NSFW, THIS IS ABOUT LONG JOKES, BLONDE JOKES, SEXUAL JOKES, KNOCK KNOCK JOKES, POLITICAL JOKES, ETC BEING POSTED IN A DAD JOKE SUB

Try telling these sexual jokes that get posted here, to your kid and see how your spouse likes it.. if that goes well, Try telling one of your friends kid about your sex life being like Coca cola, first it was normal, than light and now zero , and see if the parents are OK with you telling their kid the "dad joke"

I'm not even referencing the NSFW, I'm saying Dad jokes are corny, and sometimes painful, not sexual

So check out r/jokes for all types of jokes

r/unclejokes for dirty jokes

r/3amjokes for real weird and alot of OC

r/cleandadjokes If your really sick of seeing not dad jokes in r/dadjokes

Punchline !

Edit: this is not a post about NSFW , This is about jokes, knock knock jokes, blonde jokes, political jokes etc being posted in a dad joke sub

Edit 2: don't touch the thermostat

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/CzarcasmRules
πŸ“…︎ Jan 23 2022
🚨︎ report
Blind Girl Here. Give Me Your Best Blind Jokes!

Do your worst!

πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Leckzsluthor
πŸ“…︎ Jan 02 2022
🚨︎ report
I heard that by law you have to turn on your headlights when it’s raining in Sweden.

How the hell am I suppose to know when it’s raining in Sweden?

πŸ‘︎ 10k
πŸ’¬︎
πŸ‘€︎ u/justshtmypnts
πŸ“…︎ Jan 25 2022
🚨︎ report
Petition to ban rants from this sub

Ants don’t even have the concept fathers, let alone a good dad joke. Keep r/ants out of my r/dadjokes.

But no, seriously. I understand rule 7 is great to have intelligent discussion, but sometimes it feels like 1 in 10 posts here is someone getting upset about the jokes on this sub. Let the mods deal with it, they regulate the sub.

πŸ‘︎ 8k
πŸ’¬︎
πŸ‘€︎ u/drak0ni
πŸ“…︎ Jan 24 2022
🚨︎ report
French fries weren’t cooked in France.

They were cooked in Greece.

πŸ‘︎ 9k
πŸ’¬︎
πŸ“…︎ Jan 20 2022
🚨︎ report
This subreddit is 10 years old now.

I'm surprised it hasn't decade.

πŸ‘︎ 14k
πŸ’¬︎
πŸ‘€︎ u/frexyincdude
πŸ“…︎ Jan 14 2022
🚨︎ report
When I was a single man, I had loads of free time.

Now that I listen to albums, I hardly ever leave the house.

πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/porichoygupto
πŸ“…︎ Jan 25 2022
🚨︎ report
You've been hit by
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/mordrathe
πŸ“…︎ Jan 20 2022
🚨︎ report
My 4 year oldest favourit joke, which he very proudly memorized and told all his teachers.

Two muffins are in an oven, one muffin looks at the other and says "is it just me, or is it hot in here?"

Then the other muffin says "AHH, TALKING MUFFIN!!!"

πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/smoffatt34920
πŸ“…︎ Jan 22 2022
🚨︎ report
I'm sick of you guys posting dumb wordplay in here for awards and upvotes.

Don't you know a good pun is its own reword?

πŸ‘︎ 11k
πŸ’¬︎
πŸ‘€︎ u/diggitygiggitycee
πŸ“…︎ Jan 21 2022
🚨︎ report
Dropped my best ever dad joke & no one was around to hear it

For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.

I said "hey look, an escaPEA"

No one near me but it didn't half make me laugh for a good hour or so!

Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies πŸ˜‚

πŸ‘︎ 20k
πŸ’¬︎
πŸ‘€︎ u/Vegetable-Acadia
πŸ“…︎ Jan 11 2022
🚨︎ report
What starts with a W and ends with a T

It really does, I swear!

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/PsychedeIic_Sheep
πŸ“…︎ Jan 13 2022
🚨︎ report
My wife left me because I couldn’t stop doing impressions of pasta

And now I’m cannelloni

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/bluestratmatt
πŸ“…︎ Jan 23 2022
🚨︎ report
Why did Karen press Ctrl+Shift+Delete?

Because she wanted to see the task manager.

πŸ‘︎ 11k
πŸ’¬︎
πŸ‘€︎ u/Eoussama
πŸ“…︎ Jan 17 2022
🚨︎ report
Steve JOBS would have made a better President than Donald Trump

But that’s comparing apples to oranges

πŸ‘︎ 8k
πŸ’¬︎
πŸ‘€︎ u/Ok-Ingenuity4838
πŸ“…︎ Jan 22 2022
🚨︎ report
I just flew in from Chernobyl

And boy are my arms legs.

πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/JhopkinsWA
πŸ“…︎ Jan 23 2022
🚨︎ report
So 2 trees got arrested in the town I live...

Heard they've been doing some shady business.

πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/K1ll47h3K1n9
πŸ“…︎ Jan 18 2022
🚨︎ report
No gains
πŸ‘︎ 8k
πŸ’¬︎
πŸ‘€︎ u/ridi86
πŸ“…︎ Jan 22 2022
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.