joelahoover / mathjs-simple-integral

Extends Math.js to be able to compute simple integrals.
Apache License 2.0
35 stars 9 forks source link

Fuse this with Mathjs? #1

Open peq42 opened 6 years ago

peq42 commented 6 years ago

Why not make this extension a part of mathjs(since integrals are really important/used nowadays)?

JasonShin commented 6 years ago

+1

peq42 commented 5 years ago

@joelhoover So, its been over a year this extension has been made. Are there any expectations for when will it be part of the default lib?

Integrals are REALLY important....

harrysarson commented 5 years ago

@elpeleq42 This library contains some really nice work on evaluating integrals symbolicly, however evaluating integrals is "REALLY" hard - much harder than differentiation for example - and more work is needed for mathjs is able to make integral evaluation part of the default library.

Efforts like this library represent steps in that direction but we are all working on these projects in our spare time. If you want to help contribute then that would be very much appreciated (coding a solution to issue #1 would be a decent place to start).

In the meantime there are many tools for symbolic integration and you will have to make to with one of them 🙂

BenjaminLeonhardt commented 4 years ago

Hi everybody. the last comment on this topic is more than a year ago. I want to ask what is the current status for that. I'm writing at the moment a graphic calculator in JS and HTML it would be awesome to have that feature on my page.

The next thing is that i got problems to integrade the beta of the mathjs-simple-integral on my page. Because math.import(require('mathjs-simple-integral')); does not work in a browser. That only works in node.js...

Is there a workaround or some trick to get that work?

m93a commented 4 years ago

@BenjaminLeonhardt You can check the commit history of this repo to see that, indeed not much happened here in past two years. If you want to use mathjs-simple-integral with the current version of mathjs, I recommend that you check out PR #4.

Also, most web applications nowadays use modules. You can use require(...) in your code and then package it into a single javascript file using webpack or similar software.

BenjaminLeonhardt commented 4 years ago

@m93a Thank you for your fast response. I got mathjs-simple-integral now up an running :)

But I saw a problem with mathjs-simple-integral an mathJS version >7. In my project mathjs-simple-integral is only running with mathJS <7 so it is now running with 6.6.5.

I can reproduce the problem all time. I think at verision 7 is a breaking change. The error that I get says: "Error: Cannot import "factory": already exists" and it points an line 60981 in the file math.js

m93a commented 4 years ago

Have you tried using the version from PR #4? @JThobbyist claims their PR works with mathjs v7. If you're unable to get the PR working with mathjs v7, I recommend that you ask in the PR's comment section, since JT is probably the one most experienced person when it comes to running mathjs-simple-integral with mathjs v7 😉️

JThobbyist commented 4 years ago

@BenjaminLeonhardt there’s probably an elegant way to switch the integral.js file in the mathjs-simple-integral package in your node_modules directory, but the fastest way to use the integral.js file that I patched for mathjs 7+ is to just put the actual integral.js file in the same folder as your project and use it as described in the example in the PR. If you do it the fast way, make sure to include the [[]] brackets as shown in the example, because that’s part of the format that mathjs expects.

Mathjs did make breaking changes somewhere in version 6: it’s been a minute since I looked at the code, but I remember they changed the way that they import modules (something with factory functions), and so my patch was just a wrapper to format this into the new format that mathjs now expects.

ghost commented 2 years ago

@BenjaminLeonhardt there’s probably an elegant way to switch the integral.js file in the mathjs-simple-integral package in your node_modules directory, but the fastest way to use the integral.js file that I patched for mathjs 7+ is to just put the actual integral.js file in the same folder as your project and use it as described in the example in the PR. If you do it the fast way, make sure to include the [[]] brackets as shown in the example, because that’s part of the format that mathjs expects.

Mathjs did make breaking changes somewhere in version 6: it’s been a minute since I looked at the code, but I remember they changed the way that they import modules (something with factory functions), and so my patch was just a wrapper to format this into the new format that mathjs now expects.

I know it’s been two years (lol), but if you still have it, could you send the working version here? Thanks in advance.

JThobbyist commented 2 years ago

@supernova350 see my fork, it works with mathjs 7+ last time I checked.

https://github.com/JThobbyist/mathjs-simple-integral/commit/c86a693648945706b1be9852e77b4e91a995a62b