{"id":990,"date":"2018-07-28T17:25:02","date_gmt":"2018-07-28T15:25:02","guid":{"rendered":"https:\/\/aerospaceresearch.net\/?p=990"},"modified":"2018-08-13T18:18:49","modified_gmt":"2018-08-13T16:18:49","slug":"gsoc18vismashantanu-week-10-11-dynamic-simplification-and-plotting","status":"publish","type":"post","link":"https:\/\/aerospaceresearch.net\/?p=990","title":{"rendered":"[GSoC&#8217;18|VisMa|Shantanu] Week #10-11: Dynamic Simplification and Plotting"},"content":{"rendered":"<p>This is GSoC\u201918 log#05. Here I will cover on what I have done in week #10-11. Link to the\u00a0<a href=\"https:\/\/aerospaceresearch.net\/?p=880\">previous log<\/a>. The work during this period is mostly done in\u00a0<a href=\"https:\/\/github.com\/aerospaceresearch\/visma\/blob\/master\/visma\/gui\">visma\/gui<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-706\" src=\"https:\/\/aerospaceresearch.net\/wp-content\/uploads\/2018\/05\/vismabanner.jpg\" alt=\"\" width=\"1280\" height=\"800\" \/><\/p>\n<h2>Done so far&#8230;<\/h2>\n<p>A quick solver (<a href=\"https:\/\/github.com\/aerospaceresearch\/visma\/blob\/master\/visma\/gui\/qsolver.py\">visma\/gui\/qsolver.py<\/a>) has been implemented which dynamically simplifies the expression as the user inputs. Instead of implementing the\u00a0<em>logger<\/em>\u00a0which was supposed to report if the input expression is invalid, I have implemented this feature in the\u00a0<em>qsolver<\/em>\u00a0itself. It lets the user know what is missing in the input or if the input syntax is wrong.<\/p>\n<p><!--more--><\/p>\n<p>A basic\u00a0<em>plotter<\/em>\u00a0using\u00a0<strong>matplotlib<\/strong>\u00a0was implemented in the first phase which plotted the result in 2D. It is now modified for plotting graphs in both 2D and 3D. The 3D graph is a mesh which resembles the surface of the input. Given the input,\u00a0<em>plotter<\/em>\u00a0decides (based on the number of variables and the type of input) in which dimension is the graph to be plotted.<\/p>\n<p>The\u00a0<em>plotter<\/em>\u00a0logic is:<\/p>\n<pre class=\"highlight\">if (noOfVars == 1 and eqType == \"expression\") or (noOfVars == 2 and eqType == \"equation\"):\r\n    graphVars, func = plotIn2D(LHStok, RHStok, variables)\r\nelif (noOfVars == 2 and eqType == \"expression\") or (noOfVars == 3 and eqType == \"equation\"):\r\n    graphVars, func = plotIn3D(LHStok, RHStok, variables)<\/pre>\n<p>The above snippet can be found\u00a0<a href=\"https:\/\/github.com\/aerospaceresearch\/visma\/blob\/4476efceddabb7e543332e377062e8d166591844\/visma\/gui\/plotter.py#L22\">here<\/a>.<\/p>\n<p>For example:<\/p>\n<ul>\n<li>If input is\u00a0<strong>x^2<\/strong>\u00a0, the plot\u00a0<strong>f(x) = x^2<\/strong>\u00a0is plotted in 2D.<\/li>\n<li>If input is\u00a0<strong>x^2 + y^2 = 5<\/strong>\u00a0, the plot\u00a0<strong>x^2 + y^2 &#8211; 5 = 0<\/strong>\u00a0is plotted in 2D.<\/li>\n<li>If input is\u00a0<strong>x^2 &#8211; 2*y<\/strong>\u00a0, the plot\u00a0<strong>x^2 &#8211; 2y = 0<\/strong>\u00a0is plotted in 3D. This case (expression type with 2 variables) needs a fix. A plot for\u00a0<strong>f(x,y) = x^2 &#8211; 2y<\/strong>\u00a0must be plotted instead.<\/li>\n<li>If input is\u00a0<strong>x^2\/2 + y^2\/5 = z<\/strong>\u00a0, the plot\u00a0<strong>0.5x^2 + 0.2y^2\/5 &#8211; z = 0<\/strong>\u00a0is plotted in 3D.<\/li>\n<\/ul>\n<p>Below the\u00a0<em>qsolver<\/em>\u00a0and\u00a0<em>plotter<\/em>\u00a0can be seen in action.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium\" src=\"https:\/\/raw.githubusercontent.com\/8hantanu\/8hantanu.github.io\/master\/assets\/images\/vismademo5.gif\" width=\"1214\" height=\"880\" \/><\/p>\n<h2 id=\"what-i-will-be-doing-next\">What I will be doing next\u2026<\/h2>\n<p>Almost all of the basic work related to GUI is finished. I will try to enhance the UI by adding settings menu and options to enable or disable certain UI elements. A simple option for enabling\/disabling\u00a0<em>qsolver<\/em>\u00a0has been already added.<\/p>\n<p>In the coming days, I will package\u00a0<strong>visma<\/strong>\u00a0for all desktop operating systems(Linux, Mac, and Windows). I am looking into pyinstaller for packaging\u00a0<strong>visma<\/strong>\u00a0for windows. Also in the final weeks, I will write docstrings and inline comments for the code, and update the github wiki.<\/p>\n<p>Link to\u00a0<a title=\"visma\" href=\"https:\/\/github.com\/aerospaceresearch\/visma\">project source<\/a>\u00a0and\u00a0<a title=\"Project Progress\" href=\"https:\/\/github.com\/aerospaceresearch\/visma\/projects\/1\">to-do board<\/a>.<\/p>\n<p>Read on <a href=\"https:\/\/8hantanu.github.io\/gsoc18\/2018\/08\/11\/gsoc-log06-packing-up.html\">my blog<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is GSoC\u201918 log#05. Here I will cover on what I have done in week #10-11. Link to the\u00a0previous log. The work during this period is mostly done in\u00a0visma\/gui. Done so far&#8230; A quick solver (visma\/gui\/qsolver.py) has been implemented which dynamically simplifies the expression as the user inputs. Instead of implementing the\u00a0logger\u00a0which was supposed to &hellip; <a href=\"https:\/\/aerospaceresearch.net\/?p=990\" class=\"more-link\"><span class=\"screen-reader-text\">\u201e[GSoC&#8217;18|VisMa|Shantanu] Week #10-11: Dynamic Simplification and Plotting\u201c<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=\/wp\/v2\/posts\/990"}],"collection":[{"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=990"}],"version-history":[{"count":4,"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=\/wp\/v2\/posts\/990\/revisions"}],"predecessor-version":[{"id":995,"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=\/wp\/v2\/posts\/990\/revisions\/995"}],"wp:attachment":[{"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aerospaceresearch.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}