Git Product home page Git Product logo

Comments (12)

cbm755 avatar cbm755 commented on June 8, 2024

Improved but still need 2D expansions and orderMode

from symbolic.

trueutkarsh avatar trueutkarsh commented on June 8, 2024

can i try 2D expansions ?

from symbolic.

cbm755 avatar cbm755 commented on June 8, 2024

Sure @trueutkarsh that would be great.

Maybe this is helpful? http://stackoverflow.com/questions/22857162/multivariate-taylor-approximation-in-sympy

from symbolic.

trueutkarsh avatar trueutkarsh commented on June 8, 2024

@cbm755 i have written the python code(function) which does it ,tested and compared it with few outputs from the matlab .Its working fine.(i havent checked on when taylor series cant be computed .. will do so soon..)
But I am facing problems in how to incorporate it in octave. Since the function is not present in sympy how I can I use it ?
Thanks

from symbolic.

cbm755 avatar cbm755 commented on June 8, 2024

Sounds great so far.

If you look in inst/@sym/taylor, near the end there is a cmd = { ' ... ' }; bit. This is python code, you can probably do something similar. Fork this project, start a new branch, then send a pull request--- even if its not perfect---we'll help!

from symbolic.

trueutkarsh avatar trueutkarsh commented on June 8, 2024

cool that should do the job..
as soon as I'll incorporate it in octave will send a pull request.

from symbolic.

trueutkarsh avatar trueutkarsh commented on June 8, 2024

@cbm755 Now that expr=f(x,y) my code needs a list [x,y] as parameter .
"(f, x, a, n) = _ins' " interprets f as expr ,I want it to interpret x as list of variables and 'a' as list of evaluation points .
Right now it throws
"Python exception: TypeError: 'Zero' object does not support indexing
occurred at line 8 of the Python code block
"
'expr=f'
'var=x'
'i=a'
'expn=expr.subs([(var[x],i[x]) for x in range(len(var))]) ' %this is line 8

from symbolic.

cbm755 avatar cbm755 commented on June 8, 2024

Bit hard for me to comment without seeing your whole code... I suggest you start the pull request, even if it doesn't work yet (then I can see the actual code and even check it out).

from symbolic.

trueutkarsh avatar trueutkarsh commented on June 8, 2024

here's the pull request #364
Edit 1: is there some other way to contact you other than commenting here since you're not on irc channel and there's not much help for octsympy their.

from symbolic.

cbm755 avatar cbm755 commented on June 8, 2024

Not at the moment, no. I should probably get on IRC.

from symbolic.

trueutkarsh avatar trueutkarsh commented on June 8, 2024

@cbm755 I am facing a new problem. the follwing code snippet does'nt seems to work

cmd ={'(f, x, a, n) = _ins'
'z=f'
'if not isinstance(x,list):'
' z=(z.series(x,a,n).removeO())'
'var=list(x)'
'for m in range(len(var)):'
' z=z.series(var[m],a[m],3).removeO()'
'return nsimplify(z)'
};
Using this it woks for single variable taylor series but not multiple variable.
if this code snippet works then we can simply merge mtaylor and taylor.
Rather I am using
cmd ={'(f, x, a, n) = _ins'
'z=f'
'if len(z.atoms(Symbol)) ==1 :'
' return nsimplify(z.series(x,a,n).removeO())'
'var=list(x)'
'for m in range(len(var)):'
' z=z.series(var[m],a[m],3).removeO()'
'return nsimplify(z)'
};
Using this single variable works and multivariable also works
but this case
"mtaylor(sin(x+y),x)" is not working.
What am I missing ? Please help.

from symbolic.

cbm755 avatar cbm755 commented on June 8, 2024

you could just use two cmd and two calls to python python_cmd, one in case numel(x)>1 and one when numel(x) == 1 for now. Once that works, worry about whether code is nicer by merging them...

from symbolic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.