Questions on writing non-trivial programs in Mathematica. Do not use this tag for questions on plotting/graphics or for questions on doing mathematics with Mathematica, where the focus is more on the math than the program.

learn more… | top users | synonyms

0
votes
1answer
70 views

A problem with the output

i using mathmatica to study lagrange Interpolating,however i couldn't make the output as I want I wrote both who is the output and how i needed ...
0
votes
1answer
61 views

Graphics is not a primitive or directive- please help! [closed]

I cannot seem to draw a windmill that fits in the photo background. Any help is appreciated! Thank you :)
0
votes
1answer
49 views

Solving simultaneous and determinant given constant value and variable T (temperature) [closed]

How to solve this two simultaneous equations? these two equations got from this free energy equation ...
0
votes
1answer
67 views

errors in simple for loops

Im trying to run the following code, which I have translated from Matlab. I created a for loop nested inside another for loop. mW is a matrix, and ...
0
votes
1answer
134 views

Mean squared displacement of a single trajectory

I have a single particle trajectory and would like to calculate the mean squared displacement. The particle is moving from blue over yellow, green to red data points. The {x,y} data are available ...
0
votes
1answer
86 views

Formulate an equation to find a fixed point [closed]

I have the following equation: Subscript[x, n + 1] = Subscript[x, n]^2 + c with Subscript[x, 0] = 0. This equation is restricted ...
0
votes
1answer
66 views

How do I get the last three vectors to complete this cube?

Looking at this file, what vectors do I need to add to the cube:={...} in order to get a full cube?
0
votes
1answer
79 views
0
votes
1answer
106 views

Dynamic programming: Fibonacci generator

I have the following piece of code: ...
0
votes
1answer
75 views

Write a function pollard[n, B] that tries to factor an integer n, using Pollard's p − 1 method with at most B iterations [closed]

This is what I got but it seems it's not working. When I test it, it just goes through and nothing gets returned. Is there something I'm missing? ...
0
votes
1answer
101 views

How to count column occurrences in a matrix?

I have a matrix of data, and I want to count the number of columns that match, and have some way to organize them by frequency. But I don't want to count the entire column, but consider the matrix ...
0
votes
1answer
282 views

Implementing the Golden Section Rule

I am attempting to write a code which brackets the minimum of a unimodal function, using the Golden Section Method Below. I am have serious issues debugging my program though, any help will be ...
0
votes
1answer
192 views

Eigen energies of 2D time independent Schrödinger equation

Firstly, I am aware that a similar question of this type was asked, but it was not helpful as it was only one dimensional (so please don't mark my question as a duplicate) The trouble I am having is ...
0
votes
1answer
37 views

How to combine two or more groups while selecting form the unbalanced panel data if the number of obs is less than a scalar in certain groups

I have an unbalanced panel data. I want to calculate group statistics for each group. However, if ith group has less than K obs, then I want to combine ith and (i+1)th groups to calculate group ...
0
votes
1answer
96 views

How to improve this function that selects parameters from arbitrary distribution using Recursion?

Below, I have defined a function using Which to select model parameters based upon various conditions. My questions are: Is there any danger in writing this function using Recursion? Is there a more ...
0
votes
1answer
43 views

Why does this cause an error? [closed]

In[73]:= f[x_] := Save["C:\\Users\\user\\Desktop\\file", x <> x] f["###"] During evaluation of In[73]:= Save::sym: Argument ###:f3b5.01<>.01:f3b5###:...
0
votes
1answer
117 views

converting DO loop into NestList form

I would like to rewrite this Do loop using NestList. Can you help me? ** DO loop ...
0
votes
1answer
38 views

New output cell generated for each run of a GraphicsGrid - is there a way to simply update the same output cell each run?

I have a Code cell that generates a set of plots in a GraphicsGrid[]. Each time I execute the Code cell, a new Output cell is generated. Is there a way to simply update a single output cell instead ...
0
votes
1answer
68 views

Data file organized in strings

I am working in a data set : The original question, They are strings of thousands stars,and each one contains a lot of parameters, and the following item is called identifies, they are the names (...
0
votes
2answers
174 views

Exctrating data information from a file.txt

I really did previous long search in the site and I couldn't find any answer that might help me. So I am asking it. I have the following data set, https://onedrive.live.com/redir?resid=...
0
votes
1answer
93 views

How can I assign a vector unknown function to solve the ODE system?

I noted that using non-scalar variables is convenient when a system of differential equations is governed by a process that may be difficult to express symbolically. Taking a example from the tutorial ...
0
votes
1answer
57 views

Programming a series involving alternative log expressions

This is likely my error but I cannot see it. I define a vector: x1 = {{{2, 2}}, {{2, 1}, {3, 1}}, {{3, 2}}, {{2, 1}, {5, 1}}} If x1[[ i, 1,2]] is 2, I would like to find $(\log$ x1[[ i,1,1]]$^2$). ...
0
votes
1answer
196 views

Turning a 2D 3 body problem into 3D not so easy? [closed]

I have programmed a 3 body problem, that can in theory work for more than 3 bodies. I apologize in advance for the length of the code that I posted, I don't really know how much one would need to help....
0
votes
1answer
149 views

Using a LocatorPane

I have a network of a power grid where the edge are the power lines and the vertices are loads or generators. I was wondering how I can import an image into Mathematica to derive some sort of ...
0
votes
1answer
483 views

A problem with functions and Infinite expression 1/0 encountering

Following code (function) makes integrals and then replace f[x] with Cos functions and calculate the definite parametric ...
0
votes
1answer
95 views

How to produce functions [closed]

I want to produce n functions. For example, assume that by giving n=3, 3 definite integrals will be created, like the following: ...
0
votes
2answers
546 views

Mathematica Implementation of Householder’s Method

I typed the Householder code in this paper, which starts on page 7. The code is: ...
0
votes
1answer
620 views

Heat Transfer equation by numerical methods

I want to solve the following heat conduction equation using numerical methods: D[u[x, t], t] -alpha*D[u[x, t], {x, 2}] == 0 u[x, 0] == 1/(1 + x^2)^0.25, u[-10, t] == u[10, t] == 0, ...
0
votes
1answer
2k views

Evaluate function of two variables using nested Do loops

Is there a more efficient way of evaluating a function of two variables on a rectangular grid the the following nested Do loops? ...
0
votes
1answer
144 views

Collecting roots of different equations and create a list

I solve two equations and have two solutions one by each equation. I want to create list of these roots. Could anyone please help me? Appreciate it. m02R150 = FindRoot[P1 == 0, {E1, 0.07, 0.1}] ...
0
votes
2answers
175 views

How to obtain a smaller-sized output from Solve

I am solving a system of 15 simultaneous linear equations using Solve. On running the code, I get a message saying "A very large output was generated" with options ...
0
votes
1answer
391 views

Problem with Eventlocator Method for NDSolve

I want to solve the ode and plot the solution v[x] for different values of parameter a where ...
0
votes
1answer
442 views

How to solve a problem in relative motion?

I have a project due tomorrow that I have been struggling with for a month. I am utterly stumped, any help would be appreciated. The problem is: There is a ferris wheel, 30m in radius, set 80m ...
0
votes
0answers
37 views

Gauss-Jordan program in Mathematica

Hi to everyone I made this program to solve a linear system by Gauss Jordan, this is my code to solve the system: 2x+ 1y+ 1z+ 0w=1 4x+ 3y+ 3z +1w=8 8x+ 7y +9z+ 5w=30 6x+ 7y+ 9z+ 8w=41 CODE= In[...
0
votes
1answer
45 views

System of two implicit equations subject to (complicated) constraints. Infinite recursion?

I am trying to solve a system of two equations subject to 3 constraints which are rather implicit. With my (naive) code I obtain a list of recursions that Mathematica keeps on writing until I abort ...
0
votes
0answers
30 views

Produce a function of parameters from a solution to parametric equation

I am trying to produce a very simple result, namely given some function $f(x,a)=0$ find a solution $x(a)$ and let it be a function that I later plot depending on $a$. However Mathematica does not ...
0
votes
0answers
14 views

Find a conformal map from disc onto trapezoidal plate [migrated]

how can conformal mapping a disk into a trapezoidal plate with defining favorite central point?
0
votes
0answers
63 views

Why Mathematica rather than matlab? [duplicate]

I am not sure I can ask question here, but in my lab, there are two people using Matlab, and two people including me using MMA. They told me that Matlab can do Matrix calculation much faster than MMA....
0
votes
0answers
38 views

Construction of palettes [duplicate]

Is there a good documentation to help to construct my own palettes. The problem is to use a palette as an assistant to remember some long command line with many place holder and not to be obliged to ...
0
votes
0answers
53 views

Function that outputs the dual of the formula

The exercise is simple: define a function that gives the dual of the formula. While I have experience in mathematics and logic, I do not have real experience in programming. Logic is propositional ...
0
votes
0answers
25 views

Discretization of a region for NDSolve using [duplicate]

I would like to mesh the region below in order to use it for a calculation by means of NDSolve. Could anyone help me to discretize this region for NDSolve using. Thank you very much. Needs["NDSolve<...
0
votes
0answers
31 views

Run mathematica script from python program [duplicate]

Is it possible to run the mathematica code inside the Python program? A simple pseudo-code to describe what I mean: ...
0
votes
0answers
35 views

How to transfer the list of parameters values into With [duplicate]

In the following case: With[{x=1,y=2},Print[x+y]] the values of x and y are declared in ...
0
votes
0answers
48 views

Incorporating sophisticated constraints on the approximating function into NMinimize

Following the approach as given in the answer of Belisarius here I just wonder how one could incorporate some more sophisticated requirements on the approximating function. Suppose the approximating ...
0
votes
0answers
40 views

Could not access a specific element of ConstantArray, why ? partw error [duplicate]

I could not access a specific element of ConstantArray, why ? The following is piece of my code: ...
0
votes
0answers
102 views

Best practices, tools, and snippets for manipulating notebooks, cells, packages, and help access? [duplicate]

Where is the best place to find/submit lists of Wolfram Language/Mathematica best practices, idioms, and patterns, perhaps grouped by topics? I'm personally interested in those that involve using ...
0
votes
0answers
49 views

system.dllnotfoundexception unable to load DLL“ .dll”: can not find corresponding module

There are two computers. One of them works correctly, whereas the second one writes an error system.dllnotfoundexception unable to load DLL" .dll": can not find corresponding module in Wolfream....
0
votes
0answers
53 views

Get Domain resp. implicit piecewise definition of numeric Function

Given the following quintic polynomial ...
0
votes
0answers
122 views

Extract frames as image files from video files [duplicate]

I have a set of video files where the frame rate is 1 frame/sec and the file shows the evolution of a particular object with time. Now, I want to extract each frame of the video and analyze as ...