modeling

Modelica - join connectors after some distance

孤者浪人 提交于 2020-01-24 19:36:05
问题 In modelica I need to connect two spaces and pass an object, lets say a ball, between them after some distance. In my example I have two spaces one which is free space (no forces) and suddenly we enter near earth space (gravity) which acts on the ball. I need to be able to pass the ball from the first space to the second but I can't get it. Here is a minimal example. model Ball Real[2] position; Real[2] velocity; parameter Real mass=1; equation der(position) = velocity; end Ball; connector

Convert R read.csv to a readLines batch?

ぐ巨炮叔叔 提交于 2020-01-24 17:26:06
问题 I have a fitted model that I'd like to apply to score a new dataset stored as a CSV. Unfortunately, the new data set is kind of large, and the predict procedure runs out of memory on it if I do it all at once. So, I'd like to convert the procedure that worked fine for small sets below, into a batch mode that processes 500 lines at a time, then outputs a file for each scored 500. I understand from this answer (What is a good way to read line-by-line in R?) that I can use readLines for this. So

Ridge regression in glmnet in R; Calculating VIF for different lambda values using glmnet package

匆匆过客 提交于 2020-01-24 13:04:20
问题 I have a set of multicollinear variables and I'm trying to use ridge regression to tackle that. I am using the GLMNET package in R with alpha = 0 (for ridge regression). library(glmnet) I have a sequence of lambda values; and I am choosing the best lambda value through cv.glmnet lambda <- 10^seq(10, -2, length = 100) -- creating model matrix and assigning the y variable x <- model.matrix(dv ~ ., datamatrix) [,-1] y <- datamatrix$dv -- Using cross validation to determine the best lambda and

Ridge regression in glmnet in R; Calculating VIF for different lambda values using glmnet package

心已入冬 提交于 2020-01-24 13:04:04
问题 I have a set of multicollinear variables and I'm trying to use ridge regression to tackle that. I am using the GLMNET package in R with alpha = 0 (for ridge regression). library(glmnet) I have a sequence of lambda values; and I am choosing the best lambda value through cv.glmnet lambda <- 10^seq(10, -2, length = 100) -- creating model matrix and assigning the y variable x <- model.matrix(dv ~ ., datamatrix) [,-1] y <- datamatrix$dv -- Using cross validation to determine the best lambda and

Firebase efficiently model nXn relationship

你说的曾经没有我的故事 提交于 2020-01-22 02:19:09
问题 Let's say I have the following scenario: I have multiple events, that multiple users can attend. Also, users can attend multiple events. What's the best way of storing the required information with maintaining data consistency? Here's what I came up with and why I don't really fancy them: collection "events" -> event document -> subcollection "users" -> user document Problem: Each user exists on each event, resulting in multiple documents of each user. I can't just update user information as

Installing PDQ on windows

…衆ロ難τιáo~ 提交于 2020-01-16 03:44:07
问题 I am trying to install "pretty damn quick", an analysis tool for Layered Queing networks. However there seems to be a lot wrong with my system, and switching to Linux is not an option. Here is what i tried to get the PDQ running: First try: Python I installed python2.7 and downloaded the PDQ for python distribution (its in the tarball in the python dir) : C:\pdq\pdq42\python>python setup.py install running install running build running build_ext building 'pdq' extension error: Unable to find

How to fit predefined offsets to models containing categorical variables in R

雨燕双飞 提交于 2020-01-14 05:30:11
问题 Using the following data: http://pastebin.com/4wiFrsNg I am wondering how to fit a predefined offset to the raw relationship of another model i.e. how to fit the estimates from Model A, thus: ModelA<-lm(Dependent1~Explanatory) to model B thus: ModelB<-lm(Dependent2~Explanatory) Where the explanatory variable is either the variable "Categorical" in my dataset, or the variable "Continuous". I got a useful answer related to a similar question on CV: https://stats.stackexchange.com/questions

Need to querying into a column (or collection) in Cassandra

僤鯓⒐⒋嵵緔 提交于 2020-01-06 20:19:45
问题 everyone :D I'm working with Cassandra (Datastax version) and I have an issue. I want to modeling a column who (always) gonna change. That's very hard, because I can't just create a column family with 1,2,3,4..10 columns. Because, tomorrow probably can change. I think in collections, but I got to query into these. I mean, I need query into this information every second. Ex: With map: <'col1':'val1','col2':'val2'> I need to query like this: SELECT * FROM example WHERE 'col1' = 'val1' AND 'col2

Rising or Falling Edge-Triggered Delayer for SIMULINK models

假如想象 提交于 2020-01-06 14:48:41
问题 My Problem I want to model a block called "confirmer". The specification is that the output will SIMPLY be the delayed version of input based on an edge (rising/falling). To clarify, I will try to put the timing diagrams below: ___________________________ | | Input _______| |____________________________ (Tdelay) _____________________ | | Output ______________| |____________________________ And ____________________________ | | Input _______________| |____________________________ (Tdelay) _____

Inheritance or enum

痞子三分冷 提交于 2020-01-03 08:45:12
问题 I must structure new model for application and I don't what is better: using inheritance or using enum as type of object: For example : Books class Book { public string Name {get;set;} public string Author {get;set;} public int NumberOfPages {get;set;} } public class Encyclopedie:Book { } public class Novel:Book { } or better use: class Book { public BookType Type {get;set;} public string Name {get;set;} public string Author {get;set;} public int NumberOfPages {get;set;} } public enum