symbolic-math

Use Matlab/Maple to find roots of a nonlinear equation

本小妞迷上赌 提交于 2019-12-13 20:15:13
问题 I am having difficulty in finding roots of a nonlinear equation. I have tried Matlab and Maple both, and both give me the same error which is Error, (in RootFinding:-NextZero) can only handle isolated zeros The equation goes like -100 + 0.1335600000e-5*H + (1/20)*H*arcsinh(2003.40/H) The variable is H in the equation. How do I find the roots (or the approximate roots) of this equation? Matlab Code: The function file: function hor_force = horizontal(XY, XZ, Lo, EAo, qc, VA) syms H equation = (

Matlab: latex command to output with 4 significant digits or with certain amount of decimals?

做~自己de王妃 提交于 2019-12-13 18:21:55
问题 I want to generate a table for the results in Matlab. I use the symbolic box's latex command. How can I specify the amount of significant digits? Problem profile >> results results = 0.0025 0.0024 0.0024 >> latex(vpa(sym(results),4)) #THIS SHOULD PRINT with 4 decimals, how? ans = \left(\begin{array}{ccc} 0.0025401858540021748922299593687057 & 0.0023686521873358401535369921475649 & 0.0023649304185866526495374273508787 \end{array}\right) >> vpa(sym(results),4) ans = [ 0.00254, 0.002369, 0

Julia changing name in loop, using symbolic variables

故事扮演 提交于 2019-12-13 13:13:48
问题 I'd like to change the name of a symbolic variable in each iteration of a loop, and then solve an equation using these symbolic variables e.g: using SymPy for i in 1:5 p{i} = symbols("p"{i}, real=true,positive=true) solve(p{i}^2-i^2) end So I'm looking to create a series of scalar symbolic variables (since I don't think it is possible to create a vector valued symbolic variable) each with a different name - p1,p2,p3,p4 and p5 - and then use these in a equation solver. However the curly braces

how to construct sub-expressions with only two variables and one arithmatic operation from complex Expression Maple/Matlab?

只愿长相守 提交于 2019-12-13 09:14:42
问题 let the Symbolic expression is as below. y = s + (a/b)*log((a+c)/(b*a)); %# it can be any type of expression how can I get all possible sub-expressions with two variables and one operator between them. subExpression1 = b*a; subExpression2 = a/b; I got stuck whlie extracting sub-expressions based on operator. if I read one operator I have to study its LHS and RHS and verify that it operates just on one variable but not a other subexpression. Is there a way to study both LHS and RHS of a

How to define cumulative normal distribution using symbolic math

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 05:17:26
问题 I have the following code in MATLAB x=sym('x',[1 2]); DV=x(1)*ED+x(2); sv=x(1)*DV; DD=DV./sv; p=normcdf(-DD); where DV and ED are both 13242 x 1 vectors. Up to DD all it is ok. When i define p as above, i obtain this message: Error using symfun>validateArgNames (line 205) Second input must be a scalar or vector of unique symbolic variables. When i define p=1./(1+exp(-DD)) all it is ok. So there is a problem with normcdf . Any idea? Regards 回答1: normcdf , like most of the functions in the

What is the opposite to symbolic computation?

和自甴很熟 提交于 2019-12-13 02:17:12
问题 I was wondering what the opposite concept(s) to symbolic computation is(are)? In other words, what does symbolic computation belong to, and what other subcategories does it have besides symbolic computation in the same classification? Thanks and regards! 回答1: I believe what you're looking for is numeric computation. 来源: https://stackoverflow.com/questions/5588962/what-is-the-opposite-to-symbolic-computation

convert a set to expression Maple/ Change prefix to In-fix expression

一个人想着一个人 提交于 2019-12-12 20:07:23
问题 How to convert the below set to expression Expression := {{a°b}, {a°x°y}} # ° can be any operator required output as result := {a°b, a°x°y} #required output I have tried to convert using convert function like below, asString := convert(Expression, string); with(StringTools): asString :=Remove("{}", asString) result := InertForm:-Parse(asString); but my output is in the order of Pre-fix expression. result := {" ° (a,b), ° ( ° (a,x),y)"} Kind regards 回答1: restart; foo := {{a/b}, {a+x*y}}:

Matlab: “Error using assignin: Attempt to add ”c“ to a static workspace”

跟風遠走 提交于 2019-12-12 15:24:52
问题 I have the following piece of function definition (test code): function [X,Y,Z] = test(x,y,z) syms a b c; a = b + c; % This is where it gets wrong X=x; Y=y; Z=z; keyboard % nested functions function y = fun1(t,x) y=t+x; end function res = bvpbc(y0,yT) res= y0+yT; end end Basically, I have some nested functions within the test function, where I declared some symbolic variables a , b and c . However, when I run the function by typing test(1,1,1) there is always this error message: Error using

Using solve and/or linsolve with the symbolic toolbox in R2010b

坚强是说给别人听的谎言 提交于 2019-12-12 14:43:19
问题 I asked a question a few days ago here and got an answer that seems like it would work- it involves using linsolve to find the solutions to a system of equations that are all modulo p, where p is a non-prime integer. However, when I try to run the commands from the provided answer, or the linsolve help page, I get an error saying linsolve doesn't support arguments of type 'sym'. Is using linsolve with sym variables only possible in R2013b? I've also tried it with my school's copy, which is

Matlab: linear congruence solver that supports a non-prime modulus?

孤人 提交于 2019-12-12 12:33:21
问题 I'm working on some Matlab code to perform something called the Index Calculus attack on a given cryptosystem (this involves calculating discrete log values), and I've gotten it all done except for one small thing. I cant figure out (in Matlab) how to solve a linear system of congruences mod p, where p is not prime. Also, this system has more than one variable, so, unless I'm missing something, the Chinese remainder theorem wont work. I asked a question on the mathematics stackexchange with