Linked Questions

0
votes
1answer
3k views

How to find roots using the bisection method [duplicate]

First I plot the function and then I try to find a domain such that I can see the curve cut through the x-axis. I do this via trial and error ...
-4
votes
1answer
120 views

how can i convert my matlab conde into mathematica or atleast convert the bisection program? [duplicate]

(Convert matlab code into mathematica code) (I'm fairly new to mathematica) (bisect function matlab code:) ...
2
votes
1answer
89 views

Set::setraw error in implementation of bisection method [duplicate]

This is my first question on Mathematica StackExchange, and I am fairly new to the Mathematica language. This code aims to evaluate the root of f[x] == 0 between x-...
1
vote
3answers
112 views

Unable to implement bisection method using recursion [duplicate]

I have tried to implement a bisection method for finding roots using SetAttributes[BisectionItt, HoldAll] and then ...
73
votes
4answers
5k views

Using a PatternTest versus a Condition for pattern matching

My last question to the site resulted in several answers that involve using pattern matching in Mathematica, a feature I wasn't very familiar with at the time. I am currently reading Mathematica ...
35
votes
3answers
1k views

DeleteDuplicatesBy is not performing as I'd hoped. Am I missing something?

Déjà vu: a new-in-v10 function should provide a better solution to an old problem, but my enthusiasm is curbed when I run timings. This time the function is ...
24
votes
4answers
2k views

How to program a F::argx message?

How useful is it to program a user-built function in a package to produce a red warning message F::argx if you give the wrong number of arguments to that function? ...
20
votes
3answers
983 views

Quick way to use conditioned patterns when defining multi-argument function?

I have a simple function that is supposed to only accept numeric values (i.e. complex/real numbers and constant symbols e.g. Pi, E). $$f(a,b,c)=a+b+c$$ Edit: I should have chosen a less simple ...
27
votes
1answer
3k views

_?NumericQ equivalent for lists

A few months ago I got a simple answer (see: 1 ) to the question of how to force numeric evaluation during use of functions such as NMinimize[] - namely the use of <...
4
votes
4answers
753 views

More elegant way

I read ReplaceOrRemoveInvalidOrMissingData Mathematica documentation, and I tried to apply the same approach to my dataset. I've got two problems, but one is only a style problem! There is one more ...
5
votes
3answers
122 views

How to avoid repeated pattern tests in function definitions

When defining some functions which depend on many arguments, sometimes we need to include predicate constraints (?xxxQ) to reduce processing time. My question is simple: is there a way to shorten a ...
3
votes
2answers
276 views

Writing a bisection root finder

I'm trying to make a simple function that will calculate roots of equations by using bisection method. My code isn't working right. Can anyone take a look and help me? Here is the code: ...
1
vote
1answer
120 views

Is there any other way to find roots of a non-monotonic function?

I have the relation of $k$ and $w$, and now I need to plot $k$ vs $w$($k\sim 10^7$, $w\sim 10^{13}$). The relation is given as follows: parameters: ...