npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-mat-miyagi-dolab

v0.0.11

Published

This is set of public packages from Miyagi-Do lab, related to mathematical modeling applied to life sciences.

Downloads

4

Readme

Miyagi-Do lab

Euler's method

Working on a better documention, for now, see: https://github.com/JorgeGuerraPires/Miyagi-Do-lab/blob/version_1_0_1_unittesting/src/app/components/sandbox1/model1/model1.component.ts

Just replace:

import { Linear } from 'src/app/mathematics/utils/functions/linear';
import { Euler } from 'src/app/mathematics/utils/integrators/euler';

by:

//Public library from Miyagi-Do lab
import { Euler, Linear } from 'ngx-mat-miyagi-dolab';

The app should work just fine, but now you are using a public library!

Should you create a simple example, just send me!

Import the package

Just go to your component, that you wants to use numerical integration:

//Public library from Miyagi-Do lab
import { Euler, Linear } from 'ngx-mat-miyagi-dolab';

Use the Euler's integrator

Quite simple actually!

      //create the linear derivative function
      const derivative = new Linear();
      const x0 = 4;//initial condition

      //creating the object
      const euler = new Euler(derivative, [x0])

      //2 time span step forward
      euler.forward(2);
     
    //get the state, saved on the object
     euler.getcurrentState()[0]

Can I create my own function

Sure thing! Should you create, please let me know! See an example here: https://github.com/JorgeGuerraPires/Miyagi-Do-lab/blob/version_1_0_1_unittesting/src/app/mathematics/utils/functions/linear.ts

Cameleon function

Cameleon is a generic function, that uses mathjs. Working to make it even better. For now, it can be heady to create your own function! I have already tested with the integrator, see the specs!

//From our public package
import { Cameleon } from 'ngx-mat-miyagi-dolab';

.....
    
    const arg: string = '"a":4, "b":3';
    const model = "x ^ a +b  ";
    const cameleon = new Cameleon(model, arg);


    cameleon.calculate(1);//print if you will
.....

Can I create my own integrator

Sure thing! Should you create, please let me know! See an example here: https://github.com/JorgeGuerraPires/Miyagi-Do-lab/blob/version_1_0_1_unittesting/src/app/mathematics/utils/integrators/euler.ts

Unit testing

Unit testing? Got you covered! Glad I had implemented! On the moment of deploy:

10 specs, 0 failures

Euler
Testing the internal methods
Testing the Cameleon function: two step forward
Simulation time should be equal real time when they are multiples
two step forward
One step forward
should create an instance
Testing methods
Testing the superclass method
Linear
should return values in a straight line with inclination equal to alfa
should create an instance from given parameter to constructor, and store the parameter
should create an instance
Cameleon should be created
should create an instance