{"action":"created","issue":{"url":"https://api.github.com/repos/convexopt/gpkit/issues/269","labels_url":"https://api.github.com/repos/convexopt/gpkit/issues/269/labels{/name}","comments_url":"https://api.github.com/repos/convexopt/gpkit/issues/269/comments","events_url":"https://api.github.com/repos/convexopt/gpkit/issues/269/events","html_url":"https://github.com/convexopt/gpkit/issues/269","id":79868051,"number":269,"title":"Solution not printing due to nans in vector variable","user":{"login":"pgkirsch","id":8702579,"avatar_url":"https://avatars.githubusercontent.com/u/8702579?v=3","gravatar_id":"","url":"https://api.github.com/users/pgkirsch","html_url":"https://github.com/pgkirsch","followers_url":"https://api.github.com/users/pgkirsch/followers","following_url":"https://api.github.com/users/pgkirsch/following{/other_user}","gists_url":"https://api.github.com/users/pgkirsch/gists{/gist_id}","starred_url":"https://api.github.com/users/pgkirsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgkirsch/subscriptions","organizations_url":"https://api.github.com/users/pgkirsch/orgs","repos_url":"https://api.github.com/users/pgkirsch/repos","events_url":"https://api.github.com/users/pgkirsch/events{/privacy}","received_events_url":"https://api.github.com/users/pgkirsch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"pgkirsch","id":8702579,"avatar_url":"https://avatars.githubusercontent.com/u/8702579?v=3","gravatar_id":"","url":"https://api.github.com/users/pgkirsch","html_url":"https://github.com/pgkirsch","followers_url":"https://api.github.com/users/pgkirsch/followers","following_url":"https://api.github.com/users/pgkirsch/following{/other_user}","gists_url":"https://api.github.com/users/pgkirsch/gists{/gist_id}","starred_url":"https://api.github.com/users/pgkirsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgkirsch/subscriptions","organizations_url":"https://api.github.com/users/pgkirsch/orgs","repos_url":"https://api.github.com/users/pgkirsch/repos","events_url":"https://api.github.com/users/pgkirsch/events{/privacy}","received_events_url":"https://api.github.com/users/pgkirsch/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/convexopt/gpkit/milestones/2","html_url":"https://github.com/convexopt/gpkit/milestones/0.2%20-%20Documentation%20&%20stale%20fixes","labels_url":"https://api.github.com/repos/convexopt/gpkit/milestones/2/labels","id":989413,"number":2,"title":"0.2 - Documentation & stale fixes","description":"Close documentation tickets, check docs are accurate, and push what we've done over the last 6 mos.\r\n\r\nNote that Signomials are experimental, expected to work well with initial conditions at 0.3, and without initial conditions at 0.5","creator":{"login":"bqpd","id":1482776,"avatar_url":"https://avatars.githubusercontent.com/u/1482776?v=3","gravatar_id":"","url":"https://api.github.com/users/bqpd","html_url":"https://github.com/bqpd","followers_url":"https://api.github.com/users/bqpd/followers","following_url":"https://api.github.com/users/bqpd/following{/other_user}","gists_url":"https://api.github.com/users/bqpd/gists{/gist_id}","starred_url":"https://api.github.com/users/bqpd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bqpd/subscriptions","organizations_url":"https://api.github.com/users/bqpd/orgs","repos_url":"https://api.github.com/users/bqpd/repos","events_url":"https://api.github.com/users/bqpd/events{/privacy}","received_events_url":"https://api.github.com/users/bqpd/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":18,"state":"open","created_at":"2015-02-21T15:32:11Z","updated_at":"2015-07-17T17:21:31Z","due_on":"2015-07-24T04:00:00Z","closed_at":null},"comments":2,"created_at":"2015-05-23T14:55:32Z","updated_at":"2015-07-22T16:10:13Z","closed_at":null,"body":"It seems that the solution isn't printing is because of the `nan's`. Notice that these `nan's` appear where the vector element value has been substituted, and it doesn't matter what the substituted value is.\r\n\r\nSo this issue has two parts:\r\n- the vector variables have `nan's` where they should have the value of `eps`.\r\n- the solution doesn't print when some of it's values contain `nan's`\r\n\r\nCode:\r\n```\r\nfrom gpkit.shortcuts import *\r\nfrom numpy import ones\r\n\r\nN = 6\r\nL = 5.\r\ndx = L/(N-1)\r\n\r\nEI = Var(\"EI\",10)\r\n\r\nP = 100\r\np = Vec(N, \"p\", descr=\"Distributed load\")\r\np = p.sub(p, P*ones(N))\r\n\r\nV  = Vec(N, \"V\", descr=\"Internal shear\")\r\nM  = Vec(N, \"M\", descr=\"Internal moment\")\r\nth = Vec(N, \"th\", descr=\"Slope\")\r\nw  = Vec(N, \"w\", descr=\"Displacement\")\r\n\r\neps = 1E-6 #something small\r\n\r\nV[-1] = V[-1].sub(V[-1], eps)\r\nM[-1] = M[-1].sub(M[-1], eps)\r\nth[0] = th[0].sub(th[0], eps)\r\nw[0]  = w[0].sub(w[0], eps)\r\n\r\nobjective = w[-1]\r\n\r\nconstraints = [EI*V.left[1:N]     >= EI*V[1:N]    + 0.5*dx*p.left[1:N]     + 0.5*dx*p[1:N],\r\n               EI*M.left[1:N]     >= EI*M[1:N]    + 0.5*dx*V.left[1:N]     + 0.5*dx*V[1:N],\r\n               EI*th.right[0:N-1] >= EI*th[0:N-1] + 0.5*dx*M.right[0:N-1]  + 0.5*dx*M[0:N-1],\r\n               EI*w.right[0:N-1]  >= EI*w[0:N-1]  + 0.5*dx*th.right[0:N-1] + 0.5*dx*th[0:N-1]]\r\n\r\ngp = GP(objective, constraints)\r\n\r\nsol = gp.solve()\r\n\r\nprint sol.table()\r\n```\r\n\r\nOutput:\r\n```\r\nIn [17]: %run beam.py\r\nUsing solver 'mosek'\r\nSolving for 20 variables.\r\nSolving took 0.0283 seconds.\r\n\r\nCost\r\n 0.781   \r\n\r\nVariables\r\n---------\r\nEI : 10      \r\n\r\nConstant sensitivities\r\n----------------------\r\nEI : -4  \r\n```\r\n\r\nIf I inspect `sol`, the \"second\" solution seems to be:\r\n```\r\n'variables': {EI: array(10),\r\n  w: array([        nan,  0.05125112,  0.18500127,  0.36625144,  0.57000162,\r\n          0.78125184]),\r\n  M: array([ 12.5000031 ,   8.00000206,   4.50000166,   2.00000138,\r\n           0.50000117,          nan]),\r\n  V: array([ 50.00000892,  40.00000314,  30.00000193,  20.00000143,\r\n          10.00000115,          nan]),\r\n  th: array([        nan,  1.02500128,  1.65000149,  1.97500168,  2.10000187,\r\n          2.12500215])}\r\n```"},"comment":{"url":"https://api.github.com/repos/convexopt/gpkit/issues/comments/123774554","html_url":"https://github.com/convexopt/gpkit/issues/269#issuecomment-123774554","issue_url":"https://api.github.com/repos/convexopt/gpkit/issues/269","id":123774554,"user":{"login":"pgkirsch","id":8702579,"avatar_url":"https://avatars.githubusercontent.com/u/8702579?v=3","gravatar_id":"","url":"https://api.github.com/users/pgkirsch","html_url":"https://github.com/pgkirsch","followers_url":"https://api.github.com/users/pgkirsch/followers","following_url":"https://api.github.com/users/pgkirsch/following{/other_user}","gists_url":"https://api.github.com/users/pgkirsch/gists{/gist_id}","starred_url":"https://api.github.com/users/pgkirsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgkirsch/subscriptions","organizations_url":"https://api.github.com/users/pgkirsch/orgs","repos_url":"https://api.github.com/users/pgkirsch/repos","events_url":"https://api.github.com/users/pgkirsch/events{/privacy}","received_events_url":"https://api.github.com/users/pgkirsch/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T16:10:13Z","updated_at":"2015-07-22T16:10:13Z","body":"Will work on this today"}}