{ "cells": [ { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "execution_count": 20, "metadata": { }, "output_type": "execute_result" }, { "data": { "text/html": [ "" ] }, "execution_count": 20, "metadata": { }, "output_type": "execute_result" }, { "data": { "text/html": [ "" ] }, "execution_count": 20, "metadata": { }, "output_type": "execute_result" } ], "source": [ "var('r2 si co')\n", "assume(r12>0,r22>0,r32>0,d32>0)\n", "eq1 = r12==r2*d32*(1.-si*(co+(3.0*(1-co*co))^(1./2.))/2.)/2.\n", "eq2 = r22==r2*d32*(1.-si*(co-(3.0*(1-co*co))^(1./2.))/2.)/2.\n", "eq3 = r32==r2*d32*(1.+si*co)/2.0\n", "eq1.show()\n", "eq2.show()\n", "eq3.show()" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "ename": "TypeError", "evalue": "unable to make sense of Maxima expression '[if((-pi/2\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0msolve\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0meq1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0meq2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0meq3\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mr2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msi\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mco\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;32m/ext/sage/sage-8.1/local/lib/python2.7/site-packages/sage/symbolic/relation.pyc\u001b[0m in \u001b[0;36msolve\u001b[0;34m(f, *args, **kwds)\u001b[0m\n\u001b[1;32m 1048\u001b[0m \u001b[0ms\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1049\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1050\u001b[0;31m \u001b[0msol_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstring_to_list_of_solutions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrepr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1051\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1052\u001b[0m \u001b[0;31m# Relaxed form suggested by Mike Hansen (#8553):\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/ext/sage/sage-8.1/local/lib/python2.7/site-packages/sage/symbolic/relation.pyc\u001b[0m in \u001b[0;36mstring_to_list_of_solutions\u001b[0;34m(s)\u001b[0m\n\u001b[1;32m 578\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0msage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msequence\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mSequence\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 579\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0msage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcalculus\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcalculus\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0msymbolic_expression_from_maxima_string\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 580\u001b[0;31m \u001b[0mv\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msymbolic_expression_from_maxima_string\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mequals_sub\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 581\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mSequence\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mv\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muniverse\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mObjects\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcr_str\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 582\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/ext/sage/sage-8.1/local/lib/python2.7/site-packages/sage/calculus/calculus.pyc\u001b[0m in \u001b[0;36msymbolic_expression_from_maxima_string\u001b[0;34m(x, equals_sub, maxima)\u001b[0m\n\u001b[1;32m 2157\u001b[0m \u001b[0m_augmented_syms\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2158\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mSyntaxError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2159\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"unable to make sense of Maxima expression '%s' in Sage\"\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2160\u001b[0m \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2161\u001b[0m \u001b[0mis_simplified\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mTypeError\u001b[0m: unable to make sense of Maxima expression '[if((-pi/2