Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust dt for external functions under R-K #34

Merged
merged 2 commits into from
Feb 25, 2015
Merged

Conversation

kupiqu
Copy link
Collaborator

@kupiqu kupiqu commented Feb 22, 2015

This modification is to keep the same precision for external functions, such as the Poisson input, dicated by the integration method. So if RK2 or RK4 is used instead of Euler, then actual dt of the external function is scaled down to 0.5dt.

@kupiqu
Copy link
Collaborator Author

kupiqu commented Feb 23, 2015

Needs to be improved: currently, this only works if codegen is used.

@kupiqu
Copy link
Collaborator Author

kupiqu commented Feb 23, 2015

The only solution I can think of, is to use the same variable names in both cases, when coder is used and when it is not. However, when coder is not used, we can pass pset.p as an argument and avoid saving params.mat. Jason, what do you think?

In addition to solve the issue, that would clean the code in buildmodel (only saving params.mat would be different on the two versions), and it would make more clear to understand what is going on in odefun file when codegen is not used...

@kupiqu
Copy link
Collaborator Author

kupiqu commented Feb 25, 2015

I am merging this now, we will need to clean the code and use params.mat independently of coder/codegen options

kupiqu added a commit that referenced this pull request Feb 25, 2015
adjust dt for external functions under R-K
@kupiqu kupiqu merged commit dd0cb37 into dev Feb 25, 2015
@kupiqu kupiqu deleted the adjust_dt_extFunctions branch February 25, 2015 00:47
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants