Ask Your Question

C. Thompson's profile - activity

2023-09-21 20:03:56 +0200 received badge  Famous Question (source)
2023-05-23 04:26:14 +0200 received badge  Popular Question (source)
2019-06-05 22:40:26 +0200 received badge  Notable Question (source)
2016-08-24 16:12:20 +0200 received badge  Popular Question (source)
2015-06-01 01:25:40 +0200 asked a question Error while trying to use srange and for loops

I am trying to execute some instructions containing for loops and variables in sranges. The instructions are simple; yet I keep getting an error message and can't figure out where the error is. My program is at https://cloud.sagemath.com/projects/f.... I am trying to use this simple program to see if I have correctly executed a much larger program.

2015-05-04 01:42:46 +0200 asked a question How to print a text file containing multiple tuples from a function

I am trying to use Sagemath Cloud to create a text file with multiple columns of data. Each column is the input or output value of the variables of a system of functions being evaluated with for loops. I am very new to Python, and when I try to do this, I either get an error message or I get a text file with only one line, and that line is constantly overwritten by a new value of the function. On my own laptop with its standalone version of Sage, I can easily generate what I want simply by telling Sage to print the values of the variables of the function for each iteration of the for loops. The standalone version even creates an output text file that I can save. How do I do this with the cloud version?

2015-05-04 00:32:12 +0200 asked a question How to write output of a cell to text file using Sagemath Cloud?

How do I write the output of several parameters of a function to a text file while using Sagemath Cloud?

2015-04-29 02:18:25 +0200 asked a question Trying to print and plot two parameters of multivariate functions

I am trying to numerically find the values of two parameters that will make three multivariate functions true. I am trying to use for loops and if statements to do this. I need this for a university project I am working on. I am completely new to Python, and the syntax of the Sage notebook I have created does not seem to be working. Below is what I typed. Also, here is the link to the notebook I created.

var('V_m,phi_0,f_0,Lambda,sigma_q,T_i,t,T_2,I_0,sigma_B,T_amb,eta')
V_m=3.06*10^-4
T_i=1300
Lambda=4.5
phi_0=0.5
f_0=srange(0.1,100,step=0.1,universe=None)
T_2=srange(500,2000,step=0.1,universe=None)
sigma_q=srange(0.5*10^12,3.5*10^12,step=10^6,universe=None)
I_0=700000
T_amb=300
pi_n=pi.numerical_approx()
sigma_B=5.67*10^-8
for i in f_0:
    for j in T_2:
        for k in sigma_q:
            R_0=n(((V_m/((1-phi_0)*float(pi)*i))^(1/3))*sqrt(phi_0))
            H_0=n(((V_m/((1-phi_0)*float(pi)*i))^(1/3)))
            L_0=n((((V_m*(i)^2)/((1-phi_0)*float(pi))))^(1/3))
            T_R0L0=n(T_i+((k)/(2*Lambda))*(1/2)*(((R_0)^2)-((H_0)^2))+((H_0)^2)*ln((H_0)/(R_0)))
            T_MAXR0=n((((I_0)/(float(pi)*((H_0)^2)*sigma_B))+((T_amb)^4)-((k)/(sigma_B))*((((H_0)^2)-((R_0)^2))
            /R_0))^(1/4))
            T_Mean=n((T_MAXR0+T_R0L0)/2)
            T_R00=n(((1/2)*(((I_0)/(float(pi)*((H_0)^2)*sigma_B))+((T_amb)^4)+((T_Mean)^4)-((k)/(sigma_B))*
            ((((H_0)^2)-((R_0)^2))/R_0)))^(1/4))
            A1=n((-1/2*I_0*(i - sqrt(i^2 + 4*phi_0))*i))
            A2=n(V_m * k + 1/30*(15*j^4*i^6 + 15*T_amb^4*i^6 - 6*(i^6 - 20*(3*i^2*phi_0^2
            - 4*phi_0^3)*arcsinh(1/2*i/sqrt(phi_0)))*T_R00^4 - 6*(i^6 + 40*(3*i^2*phi_0^2 -
            8*phi_0^3)*arcsinh(1/2*i/sqrt(phi_0)))*T_R00^3*T_R0L0 - 6*(i^6 -120*(i^2*phi_0^2 -
            4*phi_0^3)*arcsinh(1/2*i/sqrt(phi_0)))*T_R00^2*T_R0L0^2 - 6*(i^6 + 40*(3*i^2*phi_0^2 -
            8*phi_0^3)*arcsinh(1/2*i/sqrt(phi_0)))*T_R00*T_R0L0^3 - 6*(i^6 - 20*(3*i^2*phi_0^2 - 
            4*phi_0^3)*arcsinh(1/2*i/sqrt(phi_0)))*T_R0L0^4 - 3*(5*j^4*i^5 + 5*T_amb^4*i^5 - 2*(i^5 + 
            3*i^3*phi_0 - 44*i*phi_0^2)*T_R00^4 - 2*(i^5 - 2*i^3*phi_0 + 176*i*phi_0^2)*T_R00^3*T_R0L0 - 
            2*(i^5 - 2*i^3*phi_0 - 264*i*phi_0^2)*T_R00^2*T_R0L0^2 - 2*(i^5 - 2*i^3*phi_0 +
            176*i*phi_0^2)*T_R00*T_R0L0^3 - 2*(i^5 + 3*i^3*phi_0 - 44*i*phi_0^2)*T_R0L0^4)*\
            sqrt(i^2 + 4*phi_0) + 32*(144*T_R00^2*T_R0L0^2*i*phi_0^2 - (5*i^3*phi_0 - 24*i*phi_0^2)\
            *T_R00^4 + (5*i^3*phi_0 - 96*i*phi_0^2 ...
(more)