Questions tagged [broken-code]

Use this tag only if you did your research and you still don't know why your syntactically correct code does not work.

Use this tag only and only if you did your research, you read the Documentation Center, debugged your program and you still don't know why your nicely presented, syntactically correct code does not work. If it could be reasonably answered, the tag will be removed.

Please use of for review of style and improvement of already functioning code, for non-trival programming as the tag description says, and for questions about debugging techniques.

111 questions
2
votes
1 answer

Why different output is obtained for the same code (Mathematica 10.1)?

I wrote some code in Mathematica: ClearAll["Global`*"] w = 1/H[x] D[q[x], x] (\[Eta][x] - z) + q[x]/H[x] D[H[x], x] (1 - (\[Eta][x] - z)/(\[Eta][x] - Zb[x])) + q[x]/H[x] D[Zb[x], x]; der = Simplify[\!\( \*SubscriptBox[\(\[PartialD]\),…
Misery
  • 2,640
  • 1
  • 30
  • 39
1
vote
0 answers

Define a function using symbolic constants

I want to calculate the derivative and find critical points of the following function: $\begin{equation} \frac{(w+w_s)(w^2+w_s^2)L^2C^3}{(wR^2C+(w^2 LC-1)^2)(w_s R^2C+(w_s^2 LC-1)^2)} \end{equation}$ Here's the code snippet: f[x_] := ((x + ws)*(x^2…
E. Ginzburg
  • 111
  • 1
1
vote
2 answers

MaxValue does not use composed function correctly

I used the compose operator on two functions (a vector-valued interpolated from ndsolve composed with Norm) and then passed the result to MaxValue, which works fine only if I reapply the norm. What is happening? Raw input sol = NDSolve[{v[u] ==…
migrral
  • 15
  • 4
1
vote
1 answer

Defining constants inside a script?

At the beginning of my script, I define a constant E by writing E:=2u+2uv, but then at the end of the script after running the final command, the result comes out with the form K/(2u+2uv). My question is simple: how do I make Mathematica recognise…
1
vote
0 answers

Inconsistency when adding a variable to an analysis

I have a system of three ODEs that I want to find the steady states of, and whether or not they're stable via a simple analysis. To do so, I just calculate the eigenvalues of the Jacobian evaluated at each steady state, and then determine what…
Matt
  • 11
  • 1
0
votes
1 answer

How do I use a while-loop to find the gain of a transfer function's limit?

At the moment I can find the limit of my transfer function as follows: (5 4001.6`)/(5 4001.6` + (4 + s) (200 + s)) /. s -> 0 This works as I would expect and provides a final value of 0.961553 In this example my value of gain, k, is 4001.6` so…
0
votes
0 answers

How to create 2-D or 3-D curves to simulate something like the SIR model

I don’t know what is wrong with my code. I am trying to create 2-D or 3-D curves to simulate something like the SIR model, but with tumor growth instead. It is a proliferation-invasion/ reaction-diffusion model. Clear[a, r, d,…
user79647
  • 1
  • 1
0
votes
0 answers

How to get a full name function

I have some function in string format,and I can get it short name without context First[Defer /@ ToExpression[#, InputForm, HoldComplete]] & /@ {"GeneralUtilities`AllSameBy","GeneralUtilities`Buzz"} {AllSameBy,Buzz} But actually…
yode
  • 26,686
  • 4
  • 62
  • 167
0
votes
1 answer

I just don't see the difference

I checked it by hand and i am sure that the first code does what i want it to do. But i just don't get even by calculating by hand why the 2nd code is wrong. The only difference in the two codes is that once i use j= and the other time j:= . By…
user34047
  • 335
  • 2
  • 7