6 votes
Accepted

Can I write a function that describes a hysteron?

To define a memory, you can define a variable and, for safety, put it in a separate name space, like e.g. ns`k. Further, you did not specify what k should be if x==a or x==b and what K shloud be the ...
Daniel Huber's user avatar
  • 47.2k
5 votes
Accepted

First argument -h is not a valid variable

h is a local to Series, you cannot use it as a functionargument. Try ...
Ulrich Neumann's user avatar
5 votes
Accepted

Map list of strings to appropriately nested functions

Not sure if this is what you need... If it is not, I will delete. ...
kglr's user avatar
  • 384k
5 votes

Creating a list of functions with desired coefficients

Instead of using Subscript[x, 1], I suggest using x[1]. You can still use Format to display ...
Domen's user avatar
  • 18.9k
4 votes

How to construct a custom-made matrix conditional on a set of rules?

EDITED in response to comment. Your input: m0 = {{1, 2, -3, 1}, {0, 2, -1, 5}, {-1, 2, 3, 1}, {0, 1, 2, 4}}; The function definition: ...
jdp's user avatar
  • 1,061
3 votes
Accepted

Write Integral in Ostrogradsky's Method Form

...
Bob Hanlon's user avatar
  • 151k
3 votes
Accepted

How to construct a custom-made matrix conditional on a set of rules?

I hope that the following will be useful a bit, and fun. There's a small flexing bit. So, the question essentially boils down to the following two tasks: How do I delete all negative elements of a ...
bmf's user avatar
  • 12.9k
2 votes

How to obtain the function of a plotted Bezier curve?

I've made a function that can convert any BezierCurve of any degree into a set of curves, each parameterized from 0 to 1. First, convert the BezierCurve points to a new set of points: ...
kevind's user avatar
  • 41
2 votes

First argument -h is not a valid variable

Or s[h_, n_ : 4] := Normal[f[t] + O[t, x]^(n + 1)] /. t -> x + h s[h] + s[-h]
cvgmt's user avatar
  • 63.5k
2 votes
Accepted

How can I Save function defintion without its DownValues?

Okay, something like this might work. g[][x_] := x^2; g[x_] := memo`g[x]; memo`g[x_] := memo`g[x] = g[][x] When you save, exclude the ...
lericr's user avatar
  • 24.4k
2 votes

How can I Save function defintion without its DownValues?

One way would be to use a separate symbol for the memoization. Here is a toy example: ...
WReach's user avatar
  • 68.4k
2 votes

Write Integral in Ostrogradsky's Method Form

Defining a module to perform and display the Ostrogradski method ...
Bob Hanlon's user avatar
  • 151k
2 votes

Define function to test arguments and set value to 0 (application 0 Log [0] = 0)

Maybe ClearAll @ g SetAttributes[g, Listable] Off[Infinity::indet] g[0, 0 | 0.] := 0 g[x_?NumericQ, y_?NumericQ] := Re[x Log @ y] g[__] := 0 g[10^-5, -10.^-8] -0....
eldo's user avatar
  • 47.9k
1 vote

Define function to test arguments and set value to 0 (application 0 Log [0] = 0)

Rather than define your function directly, you could define it based on the result of the log expression. ...
lericr's user avatar
  • 24.4k
1 vote

Define function to test arguments and set value to 0 (application 0 Log [0] = 0)

I would define my own Log like e.g.: ClearAll[myLog] SetAttributes[myLog, Listable] myLog[x_] = If[x <= 0, 0, Log[x]]; Now zero arguments are defined: ...
Daniel Huber's user avatar
  • 47.2k
1 vote

Constructing a function that returns two distinct values by Mathematica

Using Query : list = {{-4, -1}, {-5, 2}, {-5, -5}, {3, 1}, {-5, -1}}; Query[All, Apply /@ {Plus, Times}] @ list {{-5, 4}, {-3,...
eldo's user avatar
  • 47.9k
1 vote

Grouping consecutive elements at specified positions

Question 1: ...
eldo's user avatar
  • 47.9k

Only top scored, non community-wiki answers of a minimum length are eligible