Ask Your Question

Abby11's profile - activity

2022-10-14 00:17:05 +0200 received badge  Notable Question (source)
2022-10-14 00:14:35 +0200 received badge  Famous Question (source)
2022-03-24 13:35:03 +0200 asked a question How to tabulate $(r\cos\theta,r\sin\theta)$ from $(t,r,\theta)$ obtained from solving a system of ODE using RK4?

How to tabulate $(r\cos\theta,r\sin\theta)$ from $(t,r,\theta)$ obtained from solving a system of ODE using RK4? I am tr

2022-03-24 13:21:31 +0200 received badge  Popular Question (source)
2021-09-29 23:47:21 +0200 received badge  Notable Question (source)
2021-01-19 19:15:30 +0200 received badge  Popular Question (source)
2020-09-07 16:17:42 +0200 commented question Having trouble in solving two differential equations using desolve_system

It would be fine if I could get a numerical solution. Actually I require to obtain the M(r)-r plot.

2020-09-07 16:14:48 +0200 commented question Having trouble in solving two differential equations using desolve_system

The solution for differential equations, i.e., the plot of M(r)-r can be found in the following link: plot

2020-09-07 13:20:52 +0200 asked a question Having trouble in solving two differential equations using desolve_system

I am trying to solve the following two differential equations simultaneously: $$Ma^2\frac{dM}{dr}+(M^2a+6a)\frac{da}{dr}+\frac{1}{r^2}=0$$ $$ar\frac{dM}{dr}+7Mr\frac{da}{dr}+2Ma=0$$ where $M=M(r)$ and $a=a(r)$ are the variables.

I had written the following code in Sage:

sage: r = var('r')
sage: M = function('M')(r)
sage: a = function('a')(r)
sage: de1 = (M*a*a*diff(M,r) + (M*M*a+6*a)*diff(a,r) + 1/(r*r) == 0)
sage: de2 = (a*r*diff(M,r) + 7*M*r*diff(a,r) + 2*M*a == 0)
sage: desolve_system([de1,de2], [M,a])

After writing the above code in Sage, I am getting the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-26-6bce8159491d> in <module>()
----> 1 desolve_system([de1, de2], [M,a])

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/calculus/desolvers.py in desolve_system(des, vars, ics, ivar)
    822         for dvar, ic in zip(dvars, ics[1:]):
    823             dvar.atvalue(ivar==ivar_ic, ic)
--> 824     soln = dvars[0].parent().desolve(des, dvars)
    825     if str(soln).strip() == 'false':
    826         raise NotImplementedError("Maxima was unable to solve this system.")

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.py in __call__(self, *args, **kwds)
    606 
    607     def __call__(self, *args, **kwds):
--> 608         return self._parent.function_call(self._name, list(args), kwds)
    609 
    610     def _sage_doc_(self):

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.py in function_call(self, function, args, kwds)
    532                                        [s.name() for s in args],
    533                                        ['%s=%s'%(key,value.name()) for key, value in kwds.items()])
--> 534         return self.new(s)
    535 
    536     def _function_call_string(self, function, args, kwds):

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.py in new(self, code)
    307 
    308     def new(self, code):
--> 309         return self(code)
    310 
    311     ###################################################################

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.py in __call__(self, x, name)
    242 
    243         if isinstance(x, six.string_types):
--> 244             return cls(self, x, name=name)
    245         try:
    246             return self._coerce_from_special_method(x)

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.py in __init__(self, parent, value, is_name, name)
    670                 self._name = parent._create(value, name=name)
    671             except (TypeError, RuntimeError, ValueError) as x:
--> 672                 raise TypeError(x)
    673 
    674     def _latex_(self):

TypeError: ECL says: Error executing code in Maxima: desolve: can't handle this case.

Can someone help me with the problem. I am new to Sage and so I could not interpret the error.

Thanks in advance!

2020-09-04 09:39:31 +0200 asked a question How to solve this differential equation?

I have the following two differential equations for a system of spherical fluid flow:

$$2a\left(\frac{M^2}{2}+n\right)\dfrac{da}{dr} + Ma^2\dfrac{dM}{dr}+\dfrac{1}{r^2}=0$$ $$(2n+1)Mr^2\dfrac{da}{dr}+ar^2\dfrac{dM}{dr}+2Mar=0$$

Here, $M,a$ and $r$ are the Mach number of fluid flow, sound speed and the radial coordinate respectively, and $n=3$ is a constant.

I need to solve these two equations and plot the $M-r$ plot, i.e., the variation of $M$ with the coordinate $r$. For this purpose, I had eliminated $\dfrac{da}{dr}$ from the two equations to obtain $\dfrac{dM}{dr}$ as follows:

$$\dfrac{dM}{dr}=\dfrac{2a^2Mr(M^2+2n)-(2n+1)M}{2na^2r^2(M^2-1)}$$

Now, I have to solve this differential equation to find the $M-r$ plot with an initial condition obtained by setting the numerator and denominator to zero, i.e., a critical point of the flow.

But I am facing the following difficulty:

In the RHS of the above equation, we have the variable $'a'$ which is a function of $r$, i.e., $a=a(r)$. Thus, even though the RHS is a function of $M$ and $r$, I couldn't understand how to deal with the implicit dependence of $a$ on $r$.

The plot that one would obtain can be found in the following link: Mach number plot

In the plot, the intersection point of the two curves is the critical point obtained by setting the numerator and denominator of the $\dfrac{dM}{dr}$ equation to zero, which should be used as the initial conditions.

2020-05-29 11:38:17 +0200 received badge  Good Question (source)
2020-05-28 19:13:04 +0200 received badge  Scholar (source)
2020-05-28 19:11:20 +0200 received badge  Supporter (source)
2020-05-27 18:17:01 +0200 received badge  Nice Question (source)
2020-05-26 19:51:16 +0200 received badge  Student (source)
2020-05-26 19:32:40 +0200 asked a question How to plot projections of a 3D surface onto coordinate planes?

For the function $F=F(x,y)$, we can plot the function in 3-dimensions by choosing $z=F(x,y)$ which represents a surface. I require to plot the following projections:

  1. The projection of the surface $F(x,y)$ on the $xz$-plane and on the $yz$-plane.
  2. The projection of the extremas of $F(x,y)$ on the $xz$-plane and on the $yz$-plane.

I am new to SageMath and learning the basics. Can someone help me how to plot the projections?

Thanks!