Ask Your Question

soking's profile - activity

2023-08-14 10:26:29 +0200 received badge  Notable Question (source)
2023-04-11 19:56:56 +0200 received badge  Famous Question (source)
2021-04-13 01:58:53 +0200 received badge  Notable Question (source)
2021-02-18 10:50:48 +0200 received badge  Popular Question (source)
2020-03-11 09:09:59 +0200 received badge  Popular Question (source)
2019-03-30 20:58:33 +0200 received badge  Popular Question (source)
2018-08-05 08:17:50 +0200 received badge  Popular Question (source)
2017-06-15 09:20:44 +0200 asked a question Equation with sign function

Hi all,

I have the following piece of code

f(x) = 2*unit_step(x)
u = function('u')(x)
eqn = diff(u,x) + u == f(x)
v = desolve(eqn, u,ics=[0,0])
solve(v,x)

which gives me [x == 0, sgn(x) == -1] as solutions to the last equation. Could you help me find a way for Sage not to stop at sgn(x) == -1?

Thanks

2017-06-13 10:39:13 +0200 commented question solve ode on given interval

No, I didn't think about the problem that way, I was rather think of a way to make Sage solve the ode on a specified interval. But, thanks, it's still something that works (at least for this problem).

2017-06-10 14:24:58 +0200 asked a question solve ode on given interval

Hi,

I would like to tell Sage to solve ode on a given interval that I will specify. My final goal is to use this method to solve ode that contains 'piecewise' function like 2*diff(u,x) + u == f(x), where

f = piecewise([((-1,0),0), ((0,1),x), ((1,2),2-x), (RealSet.unbounded_above_closed(2),0)])

Thanks.

2017-06-09 10:22:51 +0200 commented answer ode and piecewise function

Thank you, for your answer, but could I have a more general solution because I can't apply your answer when for instance

f = piecewise([((-1,0),0), ((0,1),x), ((1,2),2-x), (RealSet.unbounded_above_closed(2),0)])

I thought of telling sage to solve the ode on each interval, but I don't see how to do it with Sage.

2017-06-08 16:48:43 +0200 commented question ode and piecewise function

Does it mean that I have to switch to Maxima in order to solve such ode?

2017-06-08 16:38:47 +0200 asked a question ode and piecewise function

Hi all,

I am trying to solve, using Sage, an ode which includes a piecewise. For that I wrote the following piece of code which raises an error :

f = piecewise([(RealSet.unbounded_below_open(0),0), (RealSet.unbounded_above_closed(0),10)])
u = function('u')(x)
eqn = 2*diff(u,x) + u == f(x)
u = desolve(eqn, u, ivar=x)
show(expand(u))

Since the error vanishses when I replace the function f by either of the functions exp or log, I guess the problem is coming from the piecewise function. Could anyone help me solve this issue and explain what is wrong here?

Thanks

2017-06-08 16:23:41 +0200 commented answer Periodic function

OK, thanks for the explanation. I didn't get everything, but I'll take sometime to read and understand each step.

2017-05-28 18:33:03 +0200 commented answer Periodic function

I agree with you, that's why I initially started with this piece of code

v(x) = piecewise([([0, pi], -x + pi), ((pi, 2*pi), x - pi)])

where v is the function I want to duplicate all over the real line. But when I write

f(x) = v(T*RR(abs(x)/T).frac())

it raises an error, and it seems that the issue is coming from T*RR(abs(x)/T).frac().

Even though your answer is correct and defines the function I wanted, I still want to find a way to do the same with the piecewise function I defined earlier, can you help me with it?

2017-05-27 09:21:57 +0200 commented answer Periodic function

Yeah that's the plot I wanted, but I don't understand the procedure. Can you explain it please?

2017-05-27 09:20:35 +0200 commented answer Periodic function

thanks, ndomes for your answer, bu the function should be even, yours is not :(. By the way are we obliged to rescale the function from [0, pi) to [0,1)? Is it not possible to solve this question directly (I mean without working on the interval [0,1))?

2017-05-26 14:51:21 +0200 asked a question Periodic function

HI all,

I want to write in sage a 2pi periodic even function defined by f(t) = -t + pi, for t in [0, pi). I already checked Defining a periodic function and defining periodic functions on this plateform, but none of the provided solutions works for me. My main issue is that I need a way to transform any real number x into its unique representative in the interval [-pi, pi). For that I used frac and % but they both raise errors. Could anyone help me out?

Thanks.

2017-05-25 12:41:21 +0200 received badge  Supporter (source)
2017-05-25 12:40:59 +0200 commented answer exponential inequality

Great, it works. Thanks a lot.

2017-05-25 10:41:40 +0200 received badge  Student (source)
2017-05-25 10:39:00 +0200 commented question exponential inequality

ok, thanks for the comment, but I still don't have an answer to my question^^

2017-05-25 10:37:54 +0200 received badge  Editor (source)
2017-05-25 10:19:02 +0200 asked a question exponential inequality

Hi all, I am trying to solve, using sage, the inequality exp(x) >= 5, but this is what I get

sage: solve(exp(x)>=5,x)
#0: solve_rat_ineq(ineq=%e^_SAGE_VAR_x >= 5)
[[e^x - 5 == 0], [e^x - 5 > 0]]

Can anyone tell me what's wrong and how to solve this kind of inequalities?

Thanks

sorry for the presentation of the code, I am new on this plateform.

2017-05-25 10:19:02 +0200 asked a question exponential inequality

Hi all, I am trying to solve (using sage) the inequality exp(x) >= 5, but this what I get

sage: solve(exp(x)>=5,x) #0: solve_rat_ineq(ineq=%e^_SAGE_VAR_x >= 5) [[e^x - 5 == 0], [e^x - 5 > 0]]

Can anyone tell me what's wrong, and how to solve that kind of inequalities using sage?

Thanks.