2019-12-12 10:46:24 -0500 | received badge | ● Popular Question (source) |

2019-08-26 08:36:13 -0500 | received badge | ● Famous Question (source) |

2019-08-26 08:36:13 -0500 | received badge | ● Notable Question (source) |

2019-01-17 17:09:31 -0500 | received badge | ● Popular Question (source) |

2018-10-11 01:31:21 -0500 | commented answer | Numerical calculation speed: Sagemath vs. C vs. Matlab Thanks. I think that is meant for very short code (which is a good thing for some situations). |

2018-10-10 14:31:52 -0500 | commented answer | Numerical calculation speed: Sagemath vs. C vs. Matlab Thank you for the answer. I will look up some Numpy benchmarks. I might even write the numerical part in plain python without Sagemath, but I will probably run into problems with regard to lack of linear algebra packages there. But my aim is to distribute the resulting software in a small program. Relying on Sagemath will need the 2-Gig installation. |

2018-10-10 14:26:53 -0500 | received badge | ● Commentator |

2018-10-10 14:26:53 -0500 | commented answer | Numerical calculation speed: Sagemath vs. C vs. Matlab Thank you for the very detailed response. I am trying write a research paper and I want to use free software for doing it, and I think Python based Sagemath Jupyter is gaining traction within the scientific community (did you hear that the economy nobel price winner of this year uses it?). It would benefit me to streamline all parts (both the symbolic computations and the numerical part) in one sheet. Thank you answering the question I was too shy to ask: how to force Sagemath to stop treating numbers as symbolic and just do regular double-precision calculations. I will post the feedback if I did end up writing it in Sagemath instead of taking numerics to a separate C program. Thanks again. |

2018-10-10 02:23:47 -0500 | asked a question | Speed of numerical calculation: Sagemath vs. C vs. Matlab I mostly use Sagemath for performing symbolic operations on trigonometric polynomials. But I was wondering if it is also a good tool in numerical methods. This includes matrix operations and iterative solution of PDEs with finite difference methods. Usually I take the Sagemath outputs to another program more suited to numerical work. But I was wondering if Sagemath itself is a viable choice in this resepct. Can you tell me about its numerical performance and speed compared to other programs such as C, Matlab, Julia, Mathematica etc.? Thanks |

2018-10-10 02:22:46 -0500 | asked a question | Numerical calculation speed: Sagemath vs. C vs. Matlab I mostly use Sagemath for performing symbolic operations on trigonometric polynomials. But I was wondering if it is also a good tool in numerical methods. This includes matrix operations and iterative solution of PDEs with finite difference methods. Usually I take the Sagemath outputs in another program more suited to numerical work. But I was wondering if Sagemath itself is a viable choice in this resepct. Can you tell me about its numerical performance and speed compared to other programs such as C, Matlab, Julia, Mathematica etc.? Thanks |

2018-10-06 04:14:19 -0500 | marked best answer | How to get coefficients of a multivariate trigonometric polynomial? I have a trigonometric polynomial which is something like this: A = (b1+2) * sin(x) + (b2+q) * sin(x)^2 I want to get the coefficients of the multivariate polynomial with respect to sin(x1) and cos(x1). Please note that all other variables should be treated as coefficients, including b1, b2, b3, b4, b5 and q. I would rather do this with coefficient() command, but my only problem is that coefficient command works for univariate polynomial. I can write: A.coefficients(sin(x)) But I can't write A.coefficients({sin(x),cos(x)}) because it given an error. What can I do? The answer should produce something like this: coefficient,(exponent of sin(x),exponent of cos(x)); b1+1,(1,0); b2+q,(2,1); b3/b1+6,(1,1); b4,(0,1); b5,(0,0). |

2018-10-06 04:14:16 -0500 | marked best answer | get the coefficients of polynomial of several variables? Consider that I have a polynomial with n variables x1,x2,...,xn and want to get the coefficient of that polynomial. For example I can have:
x1+2 I would like to ask Sage to give coefficient for the polynomial with variables x1..x9 and the result should be something like this: coefficient,(exponent of x1..x9); 1,(1,0,0,0,0,0,0,0,0); 2,(1,0,0,0,2,0,0,0,0); 3,(2,0,0,1,0,0,0,0,0); -5,(0,1,0,0,2,0,0,0,0); 1/2,(0,1,1,0,0,0,0,0,0); 1,(0,0,0,0,0,2,1,1); 9,(0,0,1,0,0,0,0,0,3) How can I achieve this? |

2018-10-06 04:14:11 -0500 | marked best answer | Should I always use .expand() before using .coefficient()? I used the following code in SageMath (Windows binary, version 8.1): Obtaining the coefficients of polynomial with respect to eps: but using Clearly the second one is correct. Does this mean that I should always use |

2018-10-06 04:06:05 -0500 | commented answer | Print symbolic variables like a_1 in A[1] style Yes, I noticed your answer edit. Thanks alot. I was trying to substitute but I had to use a new name, but your approach eliminates the need for declaring new names. Thank you. Also thanks about the sympy advice for automatic C code conversion. Are there options for MATLAB and BASIC languages too? |

2018-10-06 03:55:26 -0500 | received badge | ● Scholar (source) |

2018-10-06 03:55:08 -0500 | commented answer | Print symbolic variables like a_1 in A[1] style Thank you very much! Yes your solution actually works! I will make the substitution at the very end before interfacing to C. Incidentally, since you have been so helpful, would it be possible to give me a hint about what I can do about the conversion of |

2018-10-06 03:43:00 -0500 | commented answer | Print symbolic variables like a_1 in A[1] style Thank you for the answer. However, the solution you said is causing problems for me. When I try to apply the |

2018-10-06 03:37:35 -0500 | received badge | ● Supporter (source) |

2018-10-06 03:25:13 -0500 | received badge | ● Student (source) |

2018-10-05 22:30:25 -0500 | asked a question | Print symbolic variables like a_1 in A[1] style Because of Sagemath's problem with symbolic arrays, I have defined my vectors like this: I have some symbolic variables stored in another variable. Lets say I have a subroutine that works with |

2018-09-17 04:34:50 -0500 | commented answer | Function of symbolic array elements Thank you. Your solution works! With this new method of writing if I have |

2018-09-16 11:06:06 -0500 | edited question | Function of symbolic array elements I want to create a function like this: However, the thing that the function is supposed to return is calculated in an earlier part of the program. Since Sagemath has a problem with symbolic indices, I have previously defined A and B as follows: The thing that the function should return is calculated in another part of the program. Suppose that it is something like this (evaluated from a separate subroutine): So my question is: how do I turn this |

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.