Looking for contributors to R mf package by dapeng

View this thread on steempeak.com
· @dapeng · (edited)
$48.21
Looking for contributors to R mf package
This article was posted in a wrong category on utopian.io and somehow removed from utopian. Following the suggestion by mcfarhat, here I am resubmitting it.

## Background

'mf' packge is an R package I have been developing for meteorological models. Now I am looking for contributors to help me solve the following problem.

I have ordinary differential equations (ODEs) in atmospheric chemistry. I have a Matlab script, written by another guy, which can solve them. Now I have converted it into R script. However, the results are different.

In Matlab many functions are available to solve ODEs, including ode15s, ode23s, ode23t, ode23tb. My Matlab script uses ode23tb.

The deSolve package in R provides a function `ode()`, where many methods are available:

```
method = c("lsoda", "lsode", "lsodes", "lsodar", "vode", "daspk",
           "euler", "rk4", "ode23", "ode45", "radau", 
           "bdf", "bdf_d", "adams", "impAdams", "impAdams_d", "iteration")
```

However, ode23tb is not included.


## What I have tested

I tested a simple ODE from [Matlab online help](https://cn.mathworks.com/help/matlab/ref/ode23tb.html):

d*y*/d*t* = - 10*t*

The Matlab script:

```
tspan = [0 2];
y0 = 1;
[t,y] = ode23tb(@(t,y) -10*t, tspan, y0);
```

My R script

```
tspan = seq(0, 2, 0.2)
y0 = 1
testf <- function(t, y, p){
  with(as.list(c(y, p)), {
    dydt = -a*t
    list(dydt)
  })
}
p <- list(a = 10)
zz <- deSolve::ode(y = y0, times = tspan, func = testf, parms = p)
```

The results are different. In the R scirpt, `ode()` uses the default method 'lsoda'.

If I use ode23 method in both scripts, i.e. in the Matlab script:

```
[t,y] = ode23(@(t,y) -10*t, tspan, y0);
```

while in R script:

```
zz <- deSolve::ode(y = y0, times = tspan, func = testf, parms = p, method = 'ode23')
```

They give the same results.

However, the atmosphereic chemistry ODEs I have to solve are complicated. If I use ode23 method, the calculation is too slow in both Matlab and R. 12 hours has passed and the calculation is still going on.


## My Problem

How can I use Matlab ode23tb function in R? Or how can I use "lsoda" method in Matlab?

Only by using the same method can I compare the results from Matlab and R.

Your contribution will be much appreciated and acknowledged in the mf package.

## Link to the repo and Proof of work

https://github.com/pzhaonet/mf

It is listed in my project page on utopian.io.

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@dapeng/6dngsm-looking-for-contributors-to-r-mf-package">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id19,605,232
authordapeng
permlink6dngsm-looking-for-contributors-to-r-mf-package
categoryutopian-io
json_metadata"{"type": "task-development", "repository": {"compare_url": "https://api.github.com/repos/pzhaonet/mf/compare/{base}...{head}", "events_url": "https://api.github.com/repos/pzhaonet/mf/events", "forks": 0, "merges_url": "https://api.github.com/repos/pzhaonet/mf/merges", "issues_url": "https://api.github.com/repos/pzhaonet/mf/issues{/number}", "contents_url": "https://api.github.com/repos/pzhaonet/mf/contents/{+path}", "fork": false, "git_url": "git://github.com/pzhaonet/mf.git", "assignees_url": "https://api.github.com/repos/pzhaonet/mf/assignees{/user}", "owner": {"login": "pzhaonet", "type": "User", "following_url": "https://api.github.com/users/pzhaonet/following{/other_user}", "received_events_url": "https://api.github.com/users/pzhaonet/received_events", "subscriptions_url": "https://api.github.com/users/pzhaonet/subscriptions", "repos_url": "https://api.github.com/users/pzhaonet/repos", "gravatar_id": "", "organizations_url": "https://api.github.com/users/pzhaonet/orgs", "id": 4011804, "avatar_url": "https://avatars3.githubusercontent.com/u/4011804?v=4", "site_admin": false, "followers_url": "https://api.github.com/users/pzhaonet/followers", "gists_url": "https://api.github.com/users/pzhaonet/gists{/gist_id}", "html_url": "https://github.com/pzhaonet", "events_url": "https://api.github.com/users/pzhaonet/events{/privacy}", "url": "https://api.github.com/users/pzhaonet", "starred_url": "https://api.github.com/users/pzhaonet/starred{/owner}{/repo}"}, "size": 562, "issue_events_url": "https://api.github.com/repos/pzhaonet/mf/issues/events{/number}", "git_refs_url": "https://api.github.com/repos/pzhaonet/mf/git/refs{/sha}", "blobs_url": "https://api.github.com/repos/pzhaonet/mf/git/blobs{/sha}", "pushed_at": "2017-05-16T14:04:39Z", "watchers_count": 0, "stargazers_url": "https://api.github.com/repos/pzhaonet/mf/stargazers", "teams_url": "https://api.github.com/repos/pzhaonet/mf/teams", "comments_url": "https://api.github.com/repos/pzhaonet/mf/comments{/number}", "archived": false, "svn_url": "https://github.com/pzhaonet/mf", "id": 91444368, "subscribers_url": "https://api.github.com/repos/pzhaonet/mf/subscribers", "watchers": 0, "ssh_url": "git@github.com:pzhaonet/mf.git", "name": "mf", "mirror_url": null, "statuses_url": "https://api.github.com/repos/pzhaonet/mf/statuses/{sha}", "has_projects": true, "milestones_url": "https://api.github.com/repos/pzhaonet/mf/milestones{/number}", "description": "An R package including Micrometeorology Functions", "subscribers_count": 1, "has_downloads": true, "keys_url": "https://api.github.com/repos/pzhaonet/mf/keys{/key_id}", "url": "https://api.github.com/repos/pzhaonet/mf", "license": null, "html_url": "https://github.com/pzhaonet/mf", "commits_url": "https://api.github.com/repos/pzhaonet/mf/commits{/sha}", "open_issues_count": 0, "stargazers_count": 0, "branches_url": "https://api.github.com/repos/pzhaonet/mf/branches{/branch}", "full_name": "pzhaonet/mf", "forks_url": "https://api.github.com/repos/pzhaonet/mf/forks", "deployments_url": "https://api.github.com/repos/pzhaonet/mf/deployments", "language": "R", "network_count": 0, "homepage": null, "trees_url": "https://api.github.com/repos/pzhaonet/mf/git/trees{/sha}", "has_issues": true, "collaborators_url": "https://api.github.com/repos/pzhaonet/mf/collaborators{/collaborator}", "git_commits_url": "https://api.github.com/repos/pzhaonet/mf/git/commits{/sha}", "open_issues": 0, "private": false, "git_tags_url": "https://api.github.com/repos/pzhaonet/mf/git/tags{/sha}", "pulls_url": "https://api.github.com/repos/pzhaonet/mf/pulls{/number}", "releases_url": "https://api.github.com/repos/pzhaonet/mf/releases{/id}", "notifications_url": "https://api.github.com/repos/pzhaonet/mf/notifications{?since,all,participating}", "contributors_url": "https://api.github.com/repos/pzhaonet/mf/contributors", "updated_at": "2017-05-16T10:09:27Z", "forks_count": 0, "downloads_url": "https://api.github.com/repos/pzhaonet/mf/downloads", "hooks_url": "https://api.github.com/repos/pzhaonet/mf/hooks", "languages_url": "https://api.github.com/repos/pzhaonet/mf/languages", "default_branch": "master", "labels_url": "https://api.github.com/repos/pzhaonet/mf/labels{/name}", "created_at": "2017-05-16T10:09:18Z", "has_pages": false, "tags_url": "https://api.github.com/repos/pzhaonet/mf/tags", "clone_url": "https://github.com/pzhaonet/mf.git", "archive_url": "https://api.github.com/repos/pzhaonet/mf/{archive_format}{/ref}", "has_wiki": true, "issue_comment_url": "https://api.github.com/repos/pzhaonet/mf/issues/comments{/number}", "subscription_url": "https://api.github.com/repos/pzhaonet/mf/subscription"}, "format": "markdown", "links": ["https://cn.mathworks.com/help/matlab/ref/ode23tb.html", "https://github.com/pzhaonet/mf", "https://utopian.io/utopian-io/@dapeng/6dngsm-looking-for-contributors-to-r-mf-package"], "platform": "github", "app": "steemit/0.1", "tags": ["utopian-io", "matlab", "programming"], "community": "utopian"}"
created2017-12-06 08:27:48
last_update2017-12-06 08:34:12
depth0
children5
net_rshares14,815,700,242,263
last_payout2017-12-13 08:27:48
cashout_time1969-12-31 23:59:59
total_payout_value35.608 SBD
curator_payout_value12.601 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,590
author_reputation64,235,894,740,263
root_title"Looking for contributors to R mf package"
beneficiaries
0.
accountarie.steem
weight47
1.
accountcnts
weight10
2.
accountfreedom
weight658
3.
accountknowledges
weight46
4.
accountnetuoso
weight6
5.
accounttransisto
weight70
6.
accountutopian-io
weight536
7.
accountxeldal
weight27
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (27)
@espoem ·
Approved.

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
post_id19,661,086
authorespoem
permlinkre-dapeng-6dngsm-looking-for-contributors-to-r-mf-package-20171206t223455744z
categoryutopian-io
json_metadata"{"app": "busy/1.0.0", "community": "busy", "tags": ["utopian-io"]}"
created2017-12-06 22:34:57
last_update2017-12-06 22:34:57
depth1
children1
net_rshares0
last_payout2017-12-13 22:34:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length128
author_reputation59,186,440,518,630
root_title"Looking for contributors to R mf package"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@dapeng ·
Thanks!
properties (22)
post_id19,720,544
authordapeng
permlinkre-espoem-re-dapeng-6dngsm-looking-for-contributors-to-r-mf-package-20171207t151240346z
categoryutopian-io
json_metadata"{"app": "steemit/0.1", "tags": ["utopian-io"]}"
created2017-12-07 15:12:39
last_update2017-12-07 15:12:39
depth2
children0
net_rshares0
last_payout2017-12-14 15:12:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length7
author_reputation64,235,894,740,263
root_title"Looking for contributors to R mf package"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-io ·
$0.05
### Hey @dapeng I am @utopian-io. I have just upvoted you!
#### Achievements
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
👍  
properties (23)
post_id19,792,226
authorutopian-io
permlinkre-dapeng-6dngsm-looking-for-contributors-to-r-mf-package-20171208t100206316z
categoryutopian-io
json_metadata"{"app": "utopian/1.0.0", "community": "utopian", "tags": ["utopian-io"]}"
created2017-12-08 10:02:06
last_update2017-12-08 10:02:06
depth1
children1
net_rshares14,066,863,763
last_payout2017-12-15 10:02:06
cashout_time1969-12-31 23:59:59
total_payout_value0.038 SBD
curator_payout_value0.012 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,004
author_reputation152,913,012,544,965
root_title"Looking for contributors to R mf package"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@dapeng ·
Thank you!
properties (22)
post_id19,841,089
authordapeng
permlinkre-utopian-io-re-dapeng-6dngsm-looking-for-contributors-to-r-mf-package-20171208t210340593z
categoryutopian-io
json_metadata"{"app": "steemit/0.1", "tags": ["utopian-io"]}"
created2017-12-08 21:03:39
last_update2017-12-08 21:03:39
depth2
children0
net_rshares0
last_payout2017-12-15 21:03:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length10
author_reputation64,235,894,740,263
root_title"Looking for contributors to R mf package"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@sajumiah ·
your article is ver educative
my dear friend 
I read your article regularly 
please follow me and give me a vote 
your vote is very needed
properties (22)
post_id20,532,672
authorsajumiah
permlinkre-dapeng-6dngsm-looking-for-contributors-to-r-mf-package-20171215t104759017z
categoryutopian-io
json_metadata"{"app": "steemit/0.1", "tags": ["utopian-io"]}"
created2017-12-15 10:48:03
last_update2017-12-15 10:48:03
depth1
children0
net_rshares0
last_payout2017-12-22 10:48:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length138
author_reputation311,410,558,444
root_title"Looking for contributors to R mf package"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000