ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 16 Feb 2022 12:12:15 +0100Using "Z with subscript" parameters in `solve` solutionshttps://ask.sagemath.org/question/61127/using-z-with-subscript-parameters-in-solve-solutions/Trying to solve some equation and faced with `z` with subscript notation. Tried to google it but failed.
sage: t = SR.var('t')
sage: eq = cos(t) + 6 - 5 - 1.5 * sin(t) == 0
sage: sol = solve([eq], t, to_poly_solve=True)
sage: sol
[t == pi + 2*pi*z1798, t == 2*pi*z1816 + arctan(12/5)]
Guess `z1798` and `z1816` mean "any integer".
But what do numbers after z mean?
Can I set an integer manually and calculate the corresponding solution?protaWed, 16 Feb 2022 12:12:15 +0100https://ask.sagemath.org/question/61127/Smallest positive numerical solution of an equation in one variablehttps://ask.sagemath.org/question/43152/smallest-positive-numerical-solution-of-an-equation-in-one-variable/ I have some functions, all of which are functions of variable $x$ but some of them may not have any positive solutions. It is known that at least one of them have a positive solution. Now I need a list of all smallest positive solutions for those functions. For example consider $f=x^2+3x+2$ and $g=2^{(5x + 1)} - 3.2^{(3x + 1)}$. Here $f$ doesn't have any positive root but $g$ has (0.792481250360578). I want a sage code like min(solve([f,x>1],x))+min(solve([g,x>1],x)) to get the list as [0.792481250360578]. Thank you in advance.Deepak SarmaWed, 25 Jul 2018 13:48:40 +0200https://ask.sagemath.org/question/43152/Missing solution in homogeneous equationhttps://ask.sagemath.org/question/11025/missing-solution-in-homogeneous-equation/ var('x y')
solve(x*y, [x, y])
returns only the solution x=0, missing y=0.
Is this a known bug? I am using sage 5.13.jllbWed, 12 Feb 2014 04:45:46 +0100https://ask.sagemath.org/question/11025/Real Solution of x^3+8 == 0?https://ask.sagemath.org/question/8393/real-solution-of-x38-0/I do not understand the following:
sage: assume(x,'real')
sage: solve(x^3+8==0,x)
[]
Why does this equation have no solution?
But -2 is a solution!
Thanks for help!
amaleaTue, 18 Oct 2011 15:07:48 +0200https://ask.sagemath.org/question/8393/solve solution change after cell evaluationhttps://ask.sagemath.org/question/10127/solve-solution-change-after-cell-evaluation/Hello everyone,
I wanted to fit some data and I found a strange behaviour of solve(). After evaluating cell 1,2 and 3 and further evaluations of cell 2,3,2,3,2,3,... the solution for kf changes and gets smaller and smaller. I use Sage 5.9 in a VM in Win7Prof
cell1
# data=[another list]
data=((0.004,34.915),(0.018,34.665),(0.040,34.254),(0.071,33.695),(0.159,32.146),(0.282,30.323))
p1=list_plot(data,plotjoined=True,xmin=0,xmax=1,ymin=20,ymax=35)
cell2
# modell for fitting
lg=20
lm=35
A=(lm-lg)/(1-exp(-k))
c=lm-A
var('kf')
testmodel(t)=c+A*exp(-kf*t)
best_fit_par=find_fit(data,testmodel(t),initial_guess=[0.5],parameter=[kf],variables=[t],solution_dict=True)
print 'best_fit_par'
print best_fit_par
cell3
k=best_fit_par[kf]
lg=20
lm=35
A=(lm-lg)/(1-exp(-k))
c=lm-A
p2=plot(A*exp(-k*t)+c,(t,0,1),xmin=0,xmax=1,ymin=20,ymax=35)
show(p1*p2)
The values for kf started at 0.49 and are wandering towards 0.35
Thanks in advancegod.oneFri, 17 May 2013 06:20:46 +0200https://ask.sagemath.org/question/10127/Extract solutions from solvehttps://ask.sagemath.org/question/8726/extract-solutions-from-solve/I am new to sage. So, sorry if my question is trivial.
How can I get the values of a solve operation. Say I have
x = var('x');
f = x^2 - 5*x + 6;
z = solve(f = 0, x);
show(z);
gives me something like
[x == 2, x == 3]
How can I take the value 2 or 3 from that?
Also, when I was trying to solve another equation (quiet a long one), I get the solution as
[0 = something something.....]
What does that zero mean?RejeeshWed, 22 Feb 2012 11:27:44 +0100https://ask.sagemath.org/question/8726/