189 views

### On reimplementing the Select function [duplicate]

I am working through the course Programming Paradigms via Mathematica. One of the exercises asks that you construct a function that mimics Select,even with three ...
273 views

### How to define a function based on the output of DSolve? [duplicate]

I would like to define a function based on the output of the following DSolve call: ...
136 views

### Check if an inequality holds among the solutions returned by Solve [duplicate]

Let's say I solve a system: Solve[{a == 3* c, b == 2 *a}, {a, b}] and then want to see if the values found for a and ...
131 views

### Find minimum value of function which calls NDsolve [duplicate]

I have defined a function which takes a coefficient for a differential equation as an argument, solves the differential equation with NDSolve, and returns the value of the solution at time t=10. I can ...
200 views

### Fitting a Function With a Numerical Integral [duplicate]

I am having trouble using FindFit with the following function. ...
136 views

### Replace doesn't replace the denominator [duplicate]

I have the following expression in Mathematica -((E^(2 - 2 Sqrt[(x[1] - x[2])^2]) (x[1] - x[2]))/Sqrt[(x[1] - x[2])^2]) I want to replace anything of the ...
75 views

### Adding a tree to a list of trees within a loop [duplicate]

I'm trying to write a function which for a list of trees checks if a given tree is isomorphic with any of the listed, and if not - adds it to the list. I tried to use both ...
43 views

### How to define a variable updating function? [duplicate]

I tried to program a Sudoku solver when I suddenly ran into this problem: I need a function which effectivley does this: ...
149 views

### Do loop - variable does not change [duplicate]

I got the follwing code which should add a '1' 100 times to an empty list. plotVals = {} Do[Append[plotVals, 1], {l, 1, Nmax}]; The output is again an empty ...
83 views

### What is wrong with setting one list to another within function? [duplicate]

I have built a function which carries out a set of operations given two parameters. The function looks as follows: ...
61 views

### Change input variable in a function [duplicate]

I'd like to write a function, that would take a matrix as an input parameter and would change it by multiplying one of its rows by a factor. I try to do it in the following way: ...
126 views

### The /. syntax in numerical methods [duplicate]

I have an analytical approximation method for solving an ODE and want to compare this to an NDSolve solution, but the syntax is confusing me. To get the solution from NDSolve, I define the ODE as eqn ...
97 views

### Assigning the answer of Solve to a variable [duplicate]

If I enter Solve[(x-2)(x+2)==0,x] then the answer comes up as {{x -> 2}, {x -> -2}} I want to make two variables ...
56 views

### “not a list of numbers” and “cannot be used for replacing ” [duplicate]

I am trying to plot a function which is based on the solution of some equation; I could get the correct figure but only after lots of warnings are printed out. The following is a minimum version of ...
72 views

### Defining a Function, := versus = [duplicate]

Consider: ...

15 30 50 per page